/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.cosmodas.validaciones;

import java.util.Calendar;
import java.util.GregorianCalendar;

/**
 *
 * @author obper
 */
public class obtenerPrograma {
    
    public String Prog(){
        
    String programa;  
    
    	Calendar c = new GregorianCalendar(); 
	   
	Integer mes = c.get(Calendar.MONTH)+1;
        System.out.println(mes);
        switch(mes)
        {
            case 1: programa = "ENE";
                break;
            case 2: programa = "FEB";
                break;
            case 3: programa = "MAR";
                break;
            case 4: programa = "ABR";
                break;
            case 5: programa = "MAY";
                break;
            case 6: programa = "JUN";
                break;
            case 7: programa = "JUL";
                break;
            case 8: programa = "AGO";
                break;
            case 9: programa = "SEP";
                break;
            case 10: programa = "OCT";
                break;
            case 11: programa = "NOV";
                break;
            case 12: programa = "DIC";
                break;
            default: programa = "";
                break;
        }
    
        return programa;
    }
    
    public String ProgANT(){
        
    String programa;  
    
    	Calendar c = new GregorianCalendar(); 
	   
	Integer mes = c.get(Calendar.MONTH);
        System.out.println(mes);
        switch(mes)
        {
            case 1: programa = "ENE";
                break;
            case 2: programa = "FEB";
                break;
            case 3: programa = "MAR";
                break;
            case 4: programa = "ABR";
                break;
            case 5: programa = "MAY";
                break;
            case 6: programa = "JUN";
                break;
            case 7: programa = "JUL";
                break;
            case 8: programa = "AGO";
                break;
            case 9: programa = "SEP";
                break;
            case 10: programa = "OCT";
                break;
            case 11: programa = "NOV";
                break;
            case 12: programa = "DIC";
                break;
            default: programa = "";
                break;
        }
    
        return programa;
    }
       
    public String ProgramaAnterior(int mes){
        
    String programa;  

        switch(mes)
        {
            
            case 0 : programa = "DIC";
                break;
            case 1: programa = "ENE";
                break;
            case 2: programa = "FEB";
                break;
            case 3: programa = "MAR";
                break;
            case 4: programa = "ABR";
                break;
            case 5: programa = "MAY";
                break;
            case 6: programa = "JUN";
                break;
            case 7: programa = "JUL";
                break;
            case 8: programa = "AGO";
                break;
            case 9: programa = "SEP";
                break;
            case 10: programa = "OCT";
                break;
            case 11: programa = "NOV";
                break;
            case 12: programa = "DIC";
                break;
            default: programa = "";
                break;
        }
    
        return programa;
    }
    
     public String ProgramaAnteriorByCodigoPrograma(String mes){
        
    String programa;  

        switch(mes)
        {
            
            case "ENE" : programa = "DIC";
                break;
            case "FEB": programa = "ENE";
                break;
            case "MAR": programa = "FEB";
                break;
            case "ABR": programa = "MAR";
                break;
            case "MAY": programa = "ABR";
                break;
            case "JUN": programa = "MAY";
                break;
            case "JUL": programa = "JUN";
                break;
            case "AGO": programa = "JUL";
                break;
            case "SEP": programa = "AGO";
                break;
            case "OCT": programa = "SEP";
                break;
            case "NOV": programa = "OCT";
                break;
            case "DIC": programa = "NOV";
                break;
            default: programa = "";
                break;
        }
    
        return programa;
    }
     
     public String ProgramaAnteriorByCodigoProgramaNumero(String mes){
        
    String programa;  

        switch(mes)
        {
            
            case "ENE" : programa = "12";
                break;
            case "FEB": programa = "01";
                break;
            case "MAR": programa = "02";
                break;
            case "ABR": programa = "03";
                break;
            case "MAY": programa = "04";
                break;
            case "JUN": programa = "05";
                break;
            case "JUL": programa = "06";
                break;
            case "AGO": programa = "07";
                break;
            case "SEP": programa = "08";
                break;
            case "OCT": programa = "09";
                break;
            case "NOV": programa = "10";
                break;
            case "DIC": programa = "11";
                break;
            default: programa = "";
                break;
        }
    
        return programa;
    }
    
}
