Esempio n. 1
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.dgvListMembers.SelectedRows.Count != 0)
         {
             string          memberId        = this.dgvListMembers.SelectedRows[0].Cells["colMemberId"].Value.ToString();
             frmUpdateMember frmUpdateMember = new frmUpdateMember();
             frmUpdateMember.ThemMoi = false;
             getData getDB = new getData(frmUpdateMember.WriteData);
             getDB(memberId);
             frmUpdateMember.ShowDialog();
             //LoadData_ToGridView();
             btnSearch_Click(sender, e);
         }
         else
         {
             CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("CRM369"),
                                                              Common.clsLanguages.GetResource("CRM11"),
                                                              Common.Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                              Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
         }
     }
     catch (Exception)
     {
         CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("CRM292"),
                                                          Common.clsLanguages.GetResource("CRM12"),
                                                          Common.Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                          Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
         return;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Event raise when user click button add new
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddNew_Click(object sender, EventArgs e)
 {
     try
     {
         frmUpdateMember frm = new frmUpdateMember();
         frm.ThemMoi = true;
         frm.ShowDialog();
         //LoadData_ToGridView();
         btnSearch_Click(sender, e);
     }
     catch (Exception)
     {
         string code = System.Runtime.InteropServices.Marshal.GetExceptionCode().ToString();
         if (code == "-532462766")
         {
             CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("CRM292"),
                                                              Common.clsLanguages.GetResource("CRM11"),
                                                              Common.Config.CUSTOM_MESSAGEBOX_ICON.Information,
                                                              Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
         }
         return;
     }
 }