private void btnUpdate_Click(object sender, EventArgs e)
 {
   DataGridViewRow dr = grvGroup.SelectedRows[0];
   int selectedGroupID = (Int32)dr.Cells[1].Value;
   var addGroup = new frmAddGroup(Utilities.Enums.Mode.Edit, selectedGroupID, _userInfo);
   addGroup.Show(this.Owner);
 }
Esempio n. 2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         var addGroup = new frmAddGroup(Mode.Create, 0);
         addGroup.MdiParent = this.ParentForm;
         addGroup.Show();
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.ToString());
     }
 }
Esempio n. 3
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (grvUser.SelectedRows.Count != 0)
         {
             frmAddGroup editGroup = new frmAddGroup(Mode.Edit, Convert.ToInt32(grvUser.SelectedRows[0].Cells["GroupID"].Value));
             editGroup.MdiParent = this.ParentForm;
             editGroup.Show();
         }
         else
         {
             MessageBox.Show("Bạn cần chọn 1 nhóm cần cập nhật.");
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.ToString());
     }
 }
 private void btnAdd_Click(object sender, EventArgs e)
 {
     var addGroup = new frmAddGroup(Utilities.Enums.Mode.Create , 0, _userInfo);
     addGroup.Show(this.Owner);
 }
 private void grvGroup_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
   if (_userInfo.UserPermission.Contains(ConstantInfo.PERMISSON_CAP_NHAT_NHOM_NGUOI_DUNG))
   {
     try
     {
       if (e.RowIndex >= 0 && grvGroup.SelectedRows.Count == 1) // Only select one row
       {
         var dr = grvGroup.SelectedRows[0];
         var selectedGroupID = (Int32)dr.Cells[1].Value;
         var addGroup = new frmAddGroup(Utilities.Enums.Mode.Edit, selectedGroupID, _userInfo);
         addGroup.Show(this.Owner);
       }
     }
     catch (Exception ex)
     {
       logger.Error(ex.ToString());
       if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString());
     }
   }
 }