Example #1
0
        private void YearsBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            LoadInputData();

            if (showGatewaySchedule.Checked)
            {
                gsSetup.YearOfCalculation = YearOfCalculation;
                gsSetup.LoadScheduleData();
            }
        }
Example #2
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();
            }
        }