public int RegistrarRol([FromBody] Rol objRol) { clsRol objClsRol; Abm.RolV objValidarRol; try { objClsRol = new clsRol(); objValidarRol = new Abm.RolV(); objValidarRol = objClsRol.ValidarRol(objRol.rol_nombre); if (objValidarRol == null) { objClsRol = new clsRol(); return(objClsRol.RegistrarRol(objRol)); } else { return(0); } } catch (Exception) { throw; } finally { objClsRol = null; objValidarRol = null; } }
public ActionResult Editar(int Id) { try { clsUsuario usuario = new clsUsuario(); clsRol listaRoles = new clsRol(); ViewBag.ListaTiposRoles = listaRoles.ConsultarRoles(); var dato = usuario.ConsultarUsuario(Id); Usuario modelo = new Usuario(); modelo.Id = dato[0].ID; modelo.Cedula = dato[0].Cedula; modelo.Nombre = dato[0].Nombre; modelo.Apellido1 = dato[0].Apellido1; modelo.Apellido2 = dato[0].Apellido2; modelo.Telefono = dato[0].Telefono; modelo.FecNacimiento = dato[0].FecNacimiento; modelo.Email = Seguridad.Desencriptar(dato[0].Email); modelo.Pass = dato[0].Pass; modelo.IdRol = dato[0].IdRol; return(View(modelo)); } catch { return(RedirectToAction("Error")); } }
public ActionResult Crear() { try { clsRol listaRoles = new clsRol(); ViewBag.ListaTiposRoles = listaRoles.ConsultarRoles(); return(View()); } catch { return(RedirectToAction("Error")); } }
public int ActualizarRol([FromBody] Rol objRol) { clsRol objClsRol; try { objClsRol = new clsRol(); return(objClsRol.ActualizarRol(objRol)); } catch (Exception) { throw; } finally { objClsRol = null; } }
public string SelectRol() { clsRol objClsRol; try { objClsRol = new clsRol(); return(JsonConvert.SerializeObject(objClsRol.ListarRol())); } catch (Exception ex) { return(ex.ToString()); } finally { objClsRol = null; } }
public frmRol(clsConexion cone, clsEntidadUsuario pEntidadUsuario, clsEntidadVista vista) { materialSkinManager = MaterialSkinManager.Instance; materialSkinManager.AddFormToManage(this); materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; materialSkinManager.ColorScheme = new ColorScheme(Primary.DeepOrange700, Primary.DeepOrange900, Primary.DeepOrange500, Accent.DeepOrange200, TextShade.WHITE); this.conexion = cone; this.pEntidadUsuario = pEntidadUsuario; this.pEntidadRol = new clsEntidadRol(); this.pEntidadVista = vista; this.clRol = new clsRol(); this.clVistas = new clsVistas(); InitializeComponent(); }
public frmLista(clsConexion conexion, string tipo) { materialSkinManager = MaterialSkinManager.Instance; materialSkinManager.AddFormToManage(this); materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; materialSkinManager.ColorScheme = new ColorScheme(Primary.DeepOrange700, Primary.DeepOrange900, Primary.DeepOrange500, Accent.DeepOrange200, TextShade.WHITE); this.conexion = conexion; pEntidadProducto = new clsEntidadProducto(); pEntidadUsuario = new clsEntidadUsuario(); clProducto = new clsProducto(); clUsuarios = new clsUsuario(); clRol = new clsRol(); clVistas = new clsVistas(); this.tipo = tipo; InitializeComponent(); }
public CascadingDropDownNameValue[] getRol_New(string knownCategoryValues) { { clsRol oCls = new clsRol(); DataTable dt; StringBuilder strHTML = new StringBuilder(); List <CascadingDropDownNameValue> values = new List <CascadingDropDownNameValue>(); string Id = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)["Id"]; dt = oCls.GetAll(Id); if (dt == null) { return(values.ToArray()); } else { if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { values.Add(new CascadingDropDownNameValue { name = row[1].ToString(), value = row[0].ToString() }); } return(values.ToArray()); } else { return(values.ToArray()); } } } }
public bool actualizarRol(clsRol objRol) { return(objDatosRol.modificarRol(objRol.id_rol, objRol.nombre_rol, objRol.descripcion_rol)); }
public bool insertarRol(clsRol objRol) { return(objDatosRol.insertarRol(objRol.nombre_rol, objRol.descripcion_rol)); }