Пример #1
0
        private void DataBerem_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Delete)
                {
                    if (MessageBox.Show("Вы действительно хотите удалить данную запись?", "Удаление выделенной записи", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        DeleteClass.deleteBerem(int.Parse(dataBerem.CurrentRow.Cells[11].Value.ToString()), int.Parse(dataBerem.CurrentRow.Cells[12].Value.ToString()));

                        dataBerem.AutoGenerateColumns = false;
                        dataBerem.DataSource          = LoadClass.LoadBeremCertif(dateFrom.Value.ToString("yyyy-MM-dd"), dateTo.Value.ToString("yyyy-MM-dd"));
                    }
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                logger.Debug("\n/--------------------------------------------------------------------/\n" + ex.StackTrace + "\n//----------------------------//\n" + ex.Message + "\n\n");
            }
        }
Пример #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                txtNameOrg.Text = Properties.Settings.Default.Name_LPU;

                DateTime checkDate = DateTime.Today.AddMonths(-1);

                dateFrom.Value = new DateTime(checkDate.Year, checkDate.Month, 25);
                dateTo.Value   = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 25);

                dataCertifRod.AutoGenerateColumns = false;
                dataCertifRod.DataSource          = LoadClass.FuncLoadFromTable(dateFrom.Value.ToString("yyyy-MM-dd"), dateTo.Value.ToString("yyyy-MM-dd"));

                dataBerem.AutoGenerateColumns = false;
                dataBerem.DataSource          = LoadClass.LoadBeremCertif(dateFrom.Value.ToString("yyyy-MM-dd"), dateTo.Value.ToString("yyyy-MM-dd"));

                FuncInsertDataTable();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                logger.Debug("\n/--------------------------------------------------------------------/\n" + ex.StackTrace + "\n//----------------------------//\n" + ex.Message + "\n\n");
            }
        }
Пример #3
0
        private void DataBerem_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                using (AddBerem abForm = new AddBerem(int.Parse(dataBerem.CurrentRow.Cells[12].Value.ToString()), false))
                {
                    abForm.ShowDialog();
                }

                dataBerem.AutoGenerateColumns = false;
                dataBerem.DataSource          = LoadClass.LoadBeremCertif(dateFrom.Value.ToString("yyyy-MM-dd"), dateTo.Value.ToString("yyyy-MM-dd"));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                logger.Debug("\n/--------------------------------------------------------------------/\n" + ex.StackTrace + "\n//----------------------------//\n" + ex.Message + "\n\n");
            }
        }
Пример #4
0
        private void DateTo_CloseUp(object sender, EventArgs e)
        {
            try
            {
                dataCertifRod.AutoGenerateColumns = false;
                dataCertifRod.DataSource          = LoadClass.FuncLoadFromTable(dateFrom.Value.ToString("yyyy-MM-dd"), dateTo.Value.ToString("yyyy-MM-dd"));

                dataBerem.AutoGenerateColumns = false;
                dataBerem.DataSource          = LoadClass.LoadBeremCertif(dateFrom.Value.ToString("yyyy-MM-dd"), dateTo.Value.ToString("yyyy-MM-dd"));

                FuncInsertDataTable();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                logger.Debug("\n/--------------------------------------------------------------------/\n" + ex.StackTrace + "\n//----------------------------//\n" + ex.Message + "\n\n");
            }
        }