protected void m_grid_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { int id = e.RowIndex; m_grid.EditIndex = id; int delId = (int)m_grid.DataKeys[e.RowIndex].Value; if (delId != 0) { if (option != 1) { cls_Catalog_PositionRoles cPRoles = new cls_Catalog_PositionRoles(); cPRoles.Id = delId; int status_Delete = cPRoles.Delete(); if (status_Delete == 1) { ltlAnnouncement.Text = "Xóa thành công nhiệm vụ CV!"; } if (status_Delete <= 0) { ltlAnnouncement.Text = "Không xóa được nhiệm vụ CV đã chọn."; } } else { dtPosRoles.Rows[id].Delete(); dtPosRoles.AcceptChanges(); bindData(-1); } } } catch (Exception ex) { if(option != 1) ltlAnnouncement.Text = "Lỗi trong quá trình xóa nhiệm vụ CV: " + ex.ToString(); } bindData(-1); }