示例#1
0
 /*
  * Change data
  */
 private void bttnChange_Click(object sender, EventArgs e)
 {
     try {
         if (tabMenu.SelectedTab == pageClients)
         {
             frmAddClient FAC = new frmAddClient(dataTableClients.SelectedRows[0].Cells[0].Value.ToString(), UserID);
             FAC.tbPassport.Text         = dataTableClients.SelectedRows[0].Cells[0].Value.ToString();
             FAC.tbFN.Text               = dataTableClients.SelectedRows[0].Cells[1].Value.ToString();
             FAC.datePickerBirthday.Text = dataTableClients.SelectedRows[0].Cells[2].Value.ToString();
             FAC.tbSNILS.Text            = dataTableClients.SelectedRows[0].Cells[3].Value.ToString();
             FAC.tbNumbPhone.Text        = dataTableClients.SelectedRows[0].Cells[4].Value.ToString();
             FAC.tbAdress.Text           = dataTableClients.SelectedRows[0].Cells[5].Value.ToString();
             FAC.tbEMail.Text            = dataTableClients.SelectedRows[0].Cells[6].Value.ToString();
             FAC.ShowDialog();
             if (FAC.DialogResult == DialogResult.OK)
             {
                 bttnRefresh_Click(sender, e);
             }
         }
         else if (tabMenu.SelectedTab == pageRequests)
         {
             frmAddRequest FAR = new frmAddRequest(dataTableRequests.SelectedRows[0].Cells[0].Value.ToString(), UserID);
             FAR.cbNameAnalysis.Text    = dataTableRequests.SelectedRows[0].Cells[1].Value.ToString();
             FAR.datePickerRequest.Text = dataTableRequests.SelectedRows[0].Cells[4].Value.ToString();
             FAR.tbResult.Text          = dataTableRequests.SelectedRows[0].Cells[5].Value.ToString();
             FAR.bttnOK.Text            = "Подтвердить";
             FAR.labelPanelReq.Text     = "Подтвердить результат анализа";
             FAR.labelPanelReq.Left     = (ClientSize.Width - FAR.labelPanelReq.Width) / 2;
             FAR.ShowDialog();
             if (FAR.DialogResult == DialogResult.OK)
             {
                 bttnRefresh_Click(sender, e);
             }
         }
         else if (tabMenu.SelectedTab == pageServices)
         {
             frmAddServices FAS = new frmAddServices(dataTableServices.SelectedRows[0].Cells[0].Value.ToString());
             FAS.tbName.Text           = dataTableServices.SelectedRows[0].Cells[0].Value.ToString();
             FAS.tbPrice.Text          = dataTableServices.SelectedRows[0].Cells[1].Value.ToString();
             FAS.tbTerm.Text           = dataTableServices.SelectedRows[0].Cells[2].Value.ToString();
             FAS.tbRecommendation.Text = dataTableServices.SelectedRows[0].Cells[3].Value.ToString();
             FAS.bttnOK.Text           = "Изменить";
             FAS.labelPanelAdm.Text    = "Изменить данные услуги";
             FAS.labelPanelAdm.Left    = (ClientSize.Width - FAS.labelPanelAdm.Width) / 2;
             FAS.ShowDialog();
             if (FAS.DialogResult == DialogResult.OK)
             {
                 bttnRefresh_Click(sender, e);
             }
         }
     }
     catch {
         ErrorChangeData errorCD = new ErrorChangeData();
         errorCD.Show();
     }
 }
示例#2
0
 /*
  * Add data
  */
 private void bttnAdd_Click(object sender, EventArgs e)
 {
     if (tabMenu.SelectedTab == pageClients)
     {
         try {
             frmAddRequest FAR = new frmAddRequest(dataTableClients.SelectedRows[0].Cells[0].Value.ToString(), UserID);
             FAR.bttnOK.Text        = "Добавить";
             FAR.labelPanelReq.Text = "Добавить заявку";
             FAR.labelPanelReq.Left = (ClientSize.Width - FAR.labelPanelReq.Width) / 2;
             FAR.ShowDialog();
             if (FAR.DialogResult == DialogResult.OK)
             {
                 bttnRefresh_Click(sender, e);
             }
         }
         catch {
             ErrorClient EC = new ErrorClient();
             EC.Show();
         }
     }
     else if (tabMenu.SelectedTab == pageRequests)
     {
         frmAddClient FAC = new frmAddClient(UserID, null);
         FAC.ShowDialog();
         if (FAC.DialogResult == DialogResult.OK)
         {
             bttnRefresh_Click(sender, e);
         }
     }
     else if (tabMenu.SelectedTab == pageServices)
     {
         frmAddServices FAS = new frmAddServices(null);
         FAS.ShowDialog();
         if (FAS.DialogResult == DialogResult.OK)
         {
             bttnRefresh_Click(sender, e);
         }
     }
 }