private void OptionCleanToolStripMenuItem_Click(object sender, EventArgs e)
 {
     pdfFileName = string.Empty;
     ClearResults();
     ConfigureForm();
     YearComboBox.Focus();
 }
Пример #2
0
        public Statistics(int id)
        {
            emp_id = id;
            InitializeComponent();
            controllerObj = new Controller();
            YearComboBox.DisplayMember = "stat_year";
            YearComboBox.ValueMember   = "stat_year";
            YearComboBox.DataSource    = controllerObj.DisStatYears();

            YearComboBox.Update();

            if (!(controllerObj.checkSuperid(emp_id)))
            {
                EditButton7.Enabled  = false;
                DeleteButton.Enabled = false;
                insert.Enabled       = false;
            }

            DataTable dt = controllerObj.DisStatFMonths((int)YearComboBox.SelectedValue);

            FromComboBox.DisplayMember = "from_month";
            FromComboBox.ValueMember   = "from_month";
            FromComboBox.DataSource    = dt;
            FromComboBox.Update();

            ToComboBox.DisplayMember = "till_month";
            ToComboBox.ValueMember   = "till_month";
            ToComboBox.DataSource    = controllerObj.DisStatTMonths((int)YearComboBox.SelectedValue);

            ToComboBox.Update();
        }
 private void ConfigureForm()
 {
     Text = rolId == 3 ? "Informe de ventas clientes externos" : "Informe de ";
     FilterGroupBox.Width           = Width;
     YearComboBox.SelectedIndex     = 0;
     YearRadioButton.Checked        = true;
     MonthComboBox.SelectedIndex    = DateTime.Now.Month - 1;
     SemesterComboBox.SelectedIndex = DateTime.Now.Month > 6 ? 1 : 0;
     DateDateTimePicker.Value       = DateTime.Now.Date;
     RangeFromDateTimePicker.Value  = DateTime.Now.Date;
     RangeToDateTimePicker.Value    = DateTime.Now.Date.AddDays(1);
     EnableOrDisableControls(0);
     ClearResults();
     YearComboBox.Focus();
 }
Пример #4
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            if ((int)FromComboBox.SelectedValue >= (int)ToComboBox.SelectedValue)
            {
                MessageBox.Show("Please choose a valid date");
            }
            else
            {
                controllerObj.DeleteStat((int)YearComboBox.SelectedValue,
                                         (int)FromComboBox.SelectedValue, (int)ToComboBox.SelectedValue);

                MessageBox.Show("Selected Statistic has been deleted successfully!");

                YearComboBox.DataSource    = controllerObj.DisStatYears();
                YearComboBox.DisplayMember = "stat_year";
                YearComboBox.ValueMember   = "stat_year";
                YearComboBox.Update();


                FromComboBox.Update();
                ToComboBox.Update();
            }
        }