protected void btnGuardar_Click(object sender, EventArgs e) { try { lblMensaje.Visible = false; Cls_Roles_BLL objBLL = new Cls_Roles_BLL(); Cls_Roles_DAL objDAL = new Cls_Roles_DAL(); objDAL.sRol = txtRol.Value.ToString().Trim(); objDAL.sDescripcion = txtDescripcion.Value.ToString().Trim(); if (txtIdRol.Visible == false) { objDAL.cAccion = 'I'; objBLL.Insertar(ref objDAL); } else { objDAL.iId_Rol = Convert.ToInt32(txtIdRol.Value.ToString().Trim()); objDAL.cAccion = 'U'; objBLL.Editar(ref objDAL); } if (!string.IsNullOrEmpty(objDAL.sError)) { lblMensaje.Text = objDAL.sError; lblMensaje.Visible = true; lblMensaje.ForeColor = System.Drawing.Color.Red; } else { if (objDAL.cAccion == 'U') { ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowPopup", "alert('Registro editado correctamente');", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowPopup", "alert('Registro agregado correctamente');", true); } CargarRoles(); } updpnlGrid.Update(); LimpiarCampos(); } catch (Exception ex) { lblMensaje.Visible = true; lblMensaje.Text = ex.Message.ToString(); } }
public string insertarRol(string sDescripcion, ref string sMsj_error) { Cls_Roles_BLL Obj_Rol_BLL = new Cls_Roles_BLL(); return(Obj_Rol_BLL.Insertar(sDescripcion, ref sMsj_error)); }