Exemplo n.º 1
0
        public void UpdateDate()
        {
            int resulttri = ControllerRq.AskTrimestre(year.Year);

            comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBox2.DropDownStyle = ComboBoxStyle.DropDownList;
            switch (resulttri)
            {
            case 0:
                if (year.Month >= 1)
                {
                    comboBox1.Items.Add("1 Trimestre");
                    comboBox2.Items.Add(year.Year.ToString());
                }
                break;

            case 4:
                if (year.Month <= 3)
                {
                    comboBox1.Items.Add("2 Trimestre");
                    comboBox2.Items.Add(year.Year.ToString());
                }
                break;

            case 8:
                if (year.Month >= 6)
                {
                    comboBox1.Items.Add("3 Trimestre");
                    comboBox2.Items.Add(year.Year.ToString());
                }
                break;

            case 12:
                if (year.Month >= 9)
                {
                    comboBox1.Items.Add("4 Trimestre");
                    comboBox2.Items.Add(year.Year.ToString());
                }
                break;

            case 16:
                if (year.Month >= 12)
                {
                    int result = year.Year + 1;
                    comboBox2.Items.Add(result);
                    comboBox1.Items.Add("1 Trimestre");
                }
                break;
            }
        }