コード例 #1
0
        private void TSMIOptionsSettings_Click(object sender, EventArgs e)
        {
            SettingsAdminClient SACForm = new SettingsAdminClient();

            SACForm.ShowDialog();
        }
コード例 #2
0
        private void AdminPanelForm_Load(object sender, EventArgs e)
        {
            TabControl.SelectedIndex         = 0;
            CBinstSelect.SelectedIndex       = 0;
            CBInstStatQuarter1.SelectedIndex = 0;
            CBInstStatQuarter2.SelectedIndex = 3;
            for (int i = 0; i < 5; i++)
            {
                DGVinstStat.Rows.Add(CBinstSelect.Items[i].ToString(), 0, 0, 0.0);
            }
            int      Year    = DateTime.Now.Year;
            DateTime Quarter = Convert.ToDateTime($"1001.{DateTime.Now.Month}.{DateTime.Now.Day}");

            if (Quarter >= Convert.ToDateTime("1001.1.1") && Quarter < Convert.ToDateTime("1001.03.25"))
            {
                TBYearCompReport.Text             = $"{Year - 1}";
                CBQuarterCompReport.SelectedIndex = 3;
            }
            else if (Quarter >= Convert.ToDateTime("1001.03.25") && Quarter < Convert.ToDateTime("1001.06.25"))
            {
                TBYearCompReport.Text             = $"{Year}";
                CBQuarterCompReport.SelectedIndex = 0;
            }
            else if (Quarter >= Convert.ToDateTime("1001.06.25") && Quarter < Convert.ToDateTime("1001.09.25"))
            {
                TBYearCompReport.Text             = $"{Year}";
                CBQuarterCompReport.SelectedIndex = 1;
            }
            else if (Quarter >= Convert.ToDateTime("1001.09.25") && Quarter < Convert.ToDateTime("1001.12.25"))
            {
                TBYearCompReport.Text             = $"{Year}";
                CBQuarterCompReport.SelectedIndex = 2;
            }
            else
            {
                TBYearCompReport.Text             = $"{Year}";
                CBQuarterCompReport.SelectedIndex = 3;
            }
            //Загрузка параметров плана
            try
            {
                if (Program.IF.KeyExists("PlanSettings", "Workplaces"))
                {
                    PlanSettingsParam1 = Convert.ToInt32(Program.IF.ReadINI("PlanSettings", "Workplaces"));
                }
                if (Program.IF.KeyExists("PlanSettings", "Number"))
                {
                    PlanSettingsParam2 = Convert.ToDouble(Program.IF.ReadINI("PlanSettings", "Number"));
                }
                if (Program.IF.KeyExists("PlanSettings", "Proceeds"))
                {
                    PlanSettingsParam3 = Convert.ToDouble(Program.IF.ReadINI("PlanSettings", "Proceeds"));
                }
                if (Program.IF.KeyExists("PlanSettings", "Proceeds1"))
                {
                    PlanSettingsParam4 = Convert.ToDouble(Program.IF.ReadINI("PlanSettings", "Proceeds1"));
                }
            }
            catch (FormatException)
            {
                MessageBox.Show("Неверные настройки параметров плана", "Ошибка чтения настроек", MessageBoxButtons.OK, MessageBoxIcon.Error);
                SettingsAdminClient SACForm = new SettingsAdminClient();
                SACForm.ShowDialog();
            }
        }