public ActionResult GetRoles(string partial_view) { Rol = new RolesManager(); var result = Rol.Get(0); #region PreparandoArchivoDescarga string fileName = "RoleInfo.csv"; //Areglando lista. var dataReport = (from a in result select new { Id_Rol = a.Id_Rol.ToString(), Nombre_Rol = a.Nombre_Rol, Descripccion = a.Descripccion, Activo = a.Activo.ToString() } ).ToList(); Create_Excel_Reports(fileName, dataReport); #endregion if (string.IsNullOrEmpty(partial_view)) { return(View(result)); } return(PartialView(partial_view, result)); }
public ActionResult GetSingleRole(int Id_Rol, string partial_view) { Rol = new RolesManager(); Mod = new ModuloManager(); var result = Rol.Get(Id_Rol); var result_view = new Roles(); if (result != null && result.Count > 0) { result_view = result[0]; result_view.ListRol = Mod.Get(Id_Rol); } else { result_view.ListRol = Mod.Get(0); } return(PartialView(partial_view, result_view)); }
protected IEnumerable <SelectListItem> GetDrpRol() { List <SelectListItem> ls = new List <SelectListItem>(); try { RolesManager _man = new RolesManager(); var result = _man.Get(0); foreach (var temp in result) { ls.Add(new SelectListItem() { Text = temp.Nombre_Rol.ToString(), Value = temp.Id_Rol.ToString() }); } } catch (Exception ex) { ViewBag.Error = ex.Message.ToString(); } return(ls); }