protected void gdvRoles_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Editar") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = gdvRoles.Rows[index]; String idRol = gdvRoles.Rows[index].Cells[2].Text; lblHeader.InnerText = "Editar Rol"; updpnlModalHeader.Update(); txtIdRol.Value = idRol; txtRol.Value = Server.HtmlDecode(gdvRoles.Rows[index].Cells[3].Text); txtDescripcion.Value = Server.HtmlDecode(gdvRoles.Rows[index].Cells[4].Text); CargarCombos(); CargarPrivilegios(Convert.ToInt16(idRol)); updpnlGrid.Update(); lblIdRol.Visible = true; txtIdRol.Visible = true; lblPrivilegios.Visible = true; gdvPrivilegios.Visible = true; cmbPrivilegios.Visible = true; btnAgregarPrivilegio.Visible = true; updpnlModal.Update(); } else if (e.CommandName == "Borrar") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = gdvRoles.Rows[index]; String idRol = gdvRoles.Rows[index].Cells[2].Text; lblMensaje.Visible = false; Cls_Roles_BLL objBLL = new Cls_Roles_BLL(); Cls_Roles_DAL objDAL = new Cls_Roles_DAL(); objDAL.iId_Rol = Convert.ToInt32(idRol.Trim()); objBLL.Eliminar(ref objDAL); if (!string.IsNullOrEmpty(objDAL.sError)) { lblMensaje.Text = objDAL.sError; lblMensaje.Visible = true; lblMensaje.ForeColor = System.Drawing.Color.Red; } else { CargarRoles(); lblMensaje.Visible = true; lblMensaje.Text = "Registro eliminado correctamente"; lblMensaje.ForeColor = System.Drawing.Color.White; updpnlGrid.Update(); } } }
public bool eliminarRol(byte bIdRol, ref string sMsj_error) { Cls_Roles_BLL Obj_Rol_BLL = new Cls_Roles_BLL(); return(Obj_Rol_BLL.Eliminar(bIdRol, ref sMsj_error)); }