Ejemplo n.º 1
0
        private void ShowGatewaySchedule_CheckedChanged(object sender, EventArgs e)
        {
            if (showGatewaySchedule.Checked)
            {
                gsSetup = new GatewayScheduleSetup(DataAccess)
                {
                    YearOfCalculation      = this.YearOfCalculation,
                    IsGatewayScheduleEnter = true
                };

                try
                {
                    Calculation calc = new Calculation(DataAccess)
                    {
                        YearOfCalculation = this.YearOfCalculation
                    };

                    if (calc.IsExist)
                    {
                        gsSetup.LoadScheduleData();
                    }
                    else
                    {
                        gsSetup.ClearFields();
                    }

                    gsSetup.Show();
                }
                catch (ArgumentNullException)
                {
                    gsSetup.IsGatewayScheduleEnter = false;
                    showGatewaySchedule.Checked    = false;

                    MessageDialog.Show(MessageDialog.AlertTitle1, MessageDialog.AlertText1, MessageDialog.Icon.Alert);
                }
            }
            else
            {
                gsSetup.IsGatewayScheduleEnter = false;
                gsSetup.Close();
            }
        }
Ejemplo n.º 2
0
        private void ClearFields_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 12; i++)
            {
                H1Boxes[i].Text       = "";
                H2Boxes[i].Text       = "";
                VzBoxes[i].Text       = "";
                PIsmailBoxes[i].Text  = "";
                PBolgradBoxes[i].Text = "";
                DorEBoxes[i].Text     = "";
            }

            s1InJanuaryBox.Text = "";
            sumVgBox.Text       = "";
            yearsBox.Text       = "";

            if (showGatewaySchedule.Checked)
            {
                gsSetup.ClearFields();
            }
        }