Exemplo n.º 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");
            }
        }
Exemplo 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");
            }
        }
Exemplo n.º 3
0
        private void FuncInsertDataTable()
        {
            try
            {
                dataReportTable = LoadClass.FuncTable(dateFrom.Value.ToString("yyyy-MM-dd"), dateTo.Value.ToString("yyyy-MM-dd"));

                for (int i = 0; i < dataReportTable.Rows.Count; i++)
                {
                    if (dataReportTable.Rows[i][0].ToString() == "В период беременности")
                    {
                        lblPeriodBerem.Text             = dataReportTable.Rows[i][2].ToString();
                        lblPeriodBeremCountryWomen.Text = dataReportTable.Rows[i][1].ToString();
                    }
                    else
                    {
                        lblPeriodRodov.Text             = dataReportTable.Rows[i][2].ToString();
                        lblPeriodRodovCountryWomen.Text = dataReportTable.Rows[i][1].ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                logger.Debug("\n/--------------------------------------------------------------------/\n" + ex.StackTrace + "\n//----------------------------//\n" + ex.Message + "\n\n");
            }
        }
        private void EditRodBTN()
        {
            try
            {
                using (AddPatient apForm = new AddPatient(int.Parse(dataCertifRod.CurrentRow.Cells[13].Value.ToString()), false))
                {
                    apForm.ShowDialog();
                }

                dataCertifRod.DataSource = LoadClass.FuncLoadFromTable(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");
            }
        }
Exemplo n.º 5
0
        private void DataCertifRod_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                using (AddPatient apForm = new AddPatient(int.Parse(dataCertifRod.CurrentRow.Cells[13].Value.ToString()), false))
                {
                    apForm.ShowDialog();
                }

                dataCertifRod.AutoGenerateColumns = false;
                dataCertifRod.DataSource          = LoadClass.FuncLoadFromTable(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");
            }
        }
Exemplo n.º 6
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");
            }
        }
        private void BtnApply_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                dataRodOtdel.DataSource = LoadClass.FuncLoad(dateFrom.Value.ToString("yyyy-MM-dd"), dateTo.Value.ToString("yyyy-MM-dd"));

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

                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                logger.Debug("\n/--------------------------------------------------------------------/\n" + ex.StackTrace + "\n//----------------------------//\n" + ex.Message + "\n\n");
            }
        }
        private void DataCertifRod_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Delete)
                {
                    if (MessageBox.Show("Вы действительно хотите удалить данную запись?", "Удаление выделенной записи", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        DeleteClass.deleteRod(int.Parse(dataCertifRod.CurrentRow.Cells[13].Value.ToString()), int.Parse(dataCertifRod.CurrentRow.Cells[14].Value.ToString()), dataCertifRod.CurrentRow.Cells[0].Value.ToString());

                        dataCertifRod.DataSource = LoadClass.FuncLoadFromTable(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");
            }
        }
Exemplo n.º 9
0
        private void AddBerem_Load(object sender, EventArgs e)
        {
            try
            {
                cbTypeDoc.DataSource = docName;

                if (insert == true)
                {
                    woman = LoadClass.FuncINSRT(client_id);

                    tbLNAME.Text            = woman.Rows[0][0].ToString();
                    tbFNAME.Text            = woman.Rows[0][1].ToString();
                    tbMNAME.Text            = woman.Rows[0][2].ToString();
                    dateBDATE.Value         = DateTime.Parse(woman.Rows[0][3].ToString());
                    tbADDRESS.Text          = woman.Rows[0][4].ToString();
                    tbSNILS.Text            = woman.Rows[0][5].ToString();
                    tbSPOLICY.Text          = woman.Rows[0][6].ToString();
                    tbNPOLICY.Text          = woman.Rows[0][7].ToString();
                    cbTypeDoc.SelectedIndex = int.Parse(woman.Rows[0][8].ToString());
                    tbSDOC.Text             = woman.Rows[0][9].ToString();
                    tbNDOC.Text             = woman.Rows[0][10].ToString();
                    dateDDOC.Value          = DateTime.Parse(woman.Rows[0][11].ToString());
                    tbODOC.Text             = woman.Rows[0][12].ToString();
                    tbSCERTIF.Text          = woman.Rows[0][13].ToString();
                    tbNCERTIF.Text          = woman.Rows[0][14].ToString();
                    dateDCERTIF.Value       = DateTime.Parse(woman.Rows[0][15].ToString());
                    tbSLEAF.Text            = woman.Rows[0][16].ToString();
                    tbNLEAF.Text            = woman.Rows[0][17].ToString();
                    dateDLEAF.Value         = DateTime.Parse(woman.Rows[0][18].ToString());
                }
                else
                {
                    forUpdate = InsertUpdateClass.LoadMotherUPDT_BTAL1(client_id);

                    tbLNAME.Text            = forUpdate.Rows[0][1].ToString();
                    tbFNAME.Text            = forUpdate.Rows[0][2].ToString();
                    tbMNAME.Text            = forUpdate.Rows[0][3].ToString();
                    dateBDATE.Value         = DateTime.Parse(forUpdate.Rows[0][4].ToString());
                    tbADDRESS.Text          = forUpdate.Rows[0][5].ToString();
                    tbSNILS.Text            = forUpdate.Rows[0][6].ToString();
                    tbSPOLICY.Text          = forUpdate.Rows[0][7].ToString();
                    tbNPOLICY.Text          = forUpdate.Rows[0][8].ToString();
                    cbTypeDoc.SelectedIndex = int.Parse(forUpdate.Rows[0][9].ToString());
                    tbSDOC.Text             = forUpdate.Rows[0][10].ToString();
                    tbNDOC.Text             = forUpdate.Rows[0][11].ToString();
                    dateDDOC.Value          = DateTime.Parse(forUpdate.Rows[0][12].ToString());
                    tbODOC.Text             = forUpdate.Rows[0][13].ToString();
                    tbSCERTIF.Text          = forUpdate.Rows[0][14].ToString();
                    tbNCERTIF.Text          = forUpdate.Rows[0][15].ToString();
                    dateDCERTIF.Value       = DateTime.Parse(forUpdate.Rows[0][16].ToString());
                    tbSLEAF.Text            = forUpdate.Rows[0][17].ToString();
                    tbNLEAF.Text            = forUpdate.Rows[0][18].ToString();
                    dateDLEAF.Value         = DateTime.Parse(forUpdate.Rows[0][19].ToString());
                    dateDREG.Value          = DateTime.Parse(forUpdate.Rows[0][21].ToString());
                    tbQTW.Text       = forUpdate.Rows[0][22].ToString();
                    cBMULP.Checked   = (forUpdate.Rows[0][23].ToString() == "1" ? true : false);
                    cBPREM.Checked   = (forUpdate.Rows[0][24].ToString() == "1" ? true : false);
                    PHELP_CB.Checked = (forUpdate.Rows[0][25].ToString() == "1" ? true : false);

                    if (forUpdate.Rows[0][20].ToString() == "1")
                    {
                        if (forUpdate.Rows[0][25].ToString() == "1")
                        {
                            lbCHK.ForeColor = Color.Black;
                            lbCHK.Text      = "4000,00";
                        }
                        else
                        {
                            lbCHK.ForeColor = Color.Black;
                            lbCHK.Text      = "3000,00";
                        }
                    }

                    this.Text = "Редактирование записи";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                logger.Debug("\n/--------------------------------------------------------------------/\n" + ex.StackTrace + "\n//----------------------------//\n" + ex.Message + "\n\n");
            }
        }
Exemplo n.º 10
0
        private void AddPatient_Load(object sender, EventArgs e)
        {
            try
            {
                cbTypeDoc.DataSource = docName;

                dgvCHILD.AutoGenerateColumns = false;
                dgvCHILD.DataSource          = Child;

                if (insert == true)
                {
                    woman = LoadClass.FuncINSRT(client_id);

                    tbLNAME.Text            = woman.Rows[0][0].ToString();
                    tbFNAME.Text            = woman.Rows[0][1].ToString();
                    tbMNAME.Text            = woman.Rows[0][2].ToString();
                    dateBDATE.Value         = DateTime.Parse(woman.Rows[0][3].ToString());
                    tbADDRESS.Text          = woman.Rows[0][4].ToString();
                    tbSNILS.Text            = woman.Rows[0][5].ToString();
                    tbSPOLICY.Text          = woman.Rows[0][6].ToString();
                    tbNPOLICY.Text          = woman.Rows[0][7].ToString();
                    cbTypeDoc.SelectedIndex = int.Parse(woman.Rows[0][8].ToString());
                    tbSDOC.Text             = woman.Rows[0][9].ToString();
                    tbNDOC.Text             = woman.Rows[0][10].ToString();
                    dateDDOC.Value          = DateTime.Parse(woman.Rows[0][11].ToString());
                    tbODOC.Text             = woman.Rows[0][12].ToString();
                    tbSCERTIF.Text          = woman.Rows[0][13].ToString();
                    tbNCERTIF.Text          = woman.Rows[0][14].ToString();
                    dateDCERTIF.Value       = DateTime.Parse(woman.Rows[0][15].ToString());
                    tbSLEAF.Text            = woman.Rows[0][16].ToString();
                    tbNLEAF.Text            = woman.Rows[0][17].ToString();
                    dateDLEAF.Value         = DateTime.Parse(woman.Rows[0][18].ToString());
                }
                else
                {
                    forTableUPD = InsertUpdateClass.FuncMotherUPD(client_id);

                    dateDREG.Value          = DateTime.Parse(forTableUPD.Rows[0][0].ToString());
                    tbDIAG.Text             = forTableUPD.Rows[0][1].ToString();
                    tbBQNT.Text             = forTableUPD.Rows[0][2].ToString();
                    tbLNAME.Text            = forTableUPD.Rows[0][3].ToString();
                    tbFNAME.Text            = forTableUPD.Rows[0][4].ToString();
                    tbMNAME.Text            = forTableUPD.Rows[0][5].ToString();
                    dateBDATE.Value         = DateTime.Parse(forTableUPD.Rows[0][6].ToString());
                    tbADDRESS.Text          = forTableUPD.Rows[0][7].ToString();
                    tbSNILS.Text            = forTableUPD.Rows[0][8].ToString();
                    tbSPOLICY.Text          = forTableUPD.Rows[0][9].ToString();
                    tbNPOLICY.Text          = forTableUPD.Rows[0][10].ToString();
                    cbTypeDoc.SelectedIndex = int.Parse(forTableUPD.Rows[0][11].ToString());
                    tbSDOC.Text             = forTableUPD.Rows[0][12].ToString();
                    tbNDOC.Text             = forTableUPD.Rows[0][13].ToString();
                    dateDDOC.Value          = DateTime.Parse(forTableUPD.Rows[0][14].ToString());
                    tbODOC.Text             = forTableUPD.Rows[0][15].ToString();
                    tbSCERTIF.Text          = forTableUPD.Rows[0][16].ToString();
                    tbNCERTIF.Text          = forTableUPD.Rows[0][17].ToString();
                    dateDCERTIF.Value       = DateTime.Parse(forTableUPD.Rows[0][18].ToString());
                    tbSLEAF.Text            = forTableUPD.Rows[0][19].ToString();
                    tbNLEAF.Text            = forTableUPD.Rows[0][20].ToString();
                    dateDLEAF.Value         = DateTime.Parse(forTableUPD.Rows[0][21].ToString());
                    tbNCARD.Text            = forTableUPD.Rows[0][22].ToString();
                    dateDCARD.Value         = DateTime.Parse(forTableUPD.Rows[0][23].ToString());

                    BQNT  = int.Parse(tbBQNT.Text);
                    Child = InsertUpdateClass.FuncChildUPD(client_id, tbSCERTIF.Text + " " + tbNCERTIF.Text);
                    dgvCHILD.DataSource = Child;

                    AddCNTChild = dgvCHILD.Rows.Count;
                    oldCertif   = $"{tbSCERTIF.Text + " " + tbNCERTIF.Text}";
                    this.Text   = "Редактирование записи";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                logger.Debug("\n/--------------------------------------------------------------------/\n" + ex.StackTrace + "\n//----------------------------//\n" + ex.Message + "\n\n");
            }
        }