Beispiel #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         var addUser = new frmAddUser(this, 0, _userInfo);
         addUser.MdiParent = this.ParentForm;
         addUser.Show();
     }
     catch (Exception ex)
     {
         logger.Error(ex.ToString());
         if (GlobalInfo.IsDebug)
         {
             MessageBox.Show(ex.ToString());
         }
     }
 }
Beispiel #2
0
 private void grvUser_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex >= 0 && grvUser.SelectedRows.Count == 1) // Only select one row
         {
             var addUser = new frmAddUser(this, 1, Convert.ToInt32(grvUser.SelectedRows[0].Cells[ConstantInfo.TBL_USER_USERID].Value), _userInfo);
             addUser.MdiParent = this.ParentForm;
             addUser.Show();
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.ToString());
         if (GlobalInfo.IsDebug)
         {
             MessageBox.Show(ex.ToString());
         }
     }
 }
Beispiel #3
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (grvUser.SelectedRows.Count != 0)
         {
             frmAddUser addUser = new frmAddUser(this, 1, Convert.ToInt32(grvUser.SelectedRows[0].Cells[ConstantInfo.TBL_USER_USERID].Value), _userInfo);
             addUser.MdiParent = this.ParentForm;
             addUser.Show();
         }
         else
         {
             MessageBox.Show("Bạn cần chọn 1 người dùng");
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.ToString());
         if (GlobalInfo.IsDebug)
         {
             MessageBox.Show(ex.ToString());
         }
     }
 }