public ActionResult Detalle(string id = null) { ManagerUser mang = new ManagerUser(); dto_login dto_login = new dto_login(); dto_login.listadoDto_login = new List<dto_login>(); dto_login.ListRoles = new List<Roles>(); var log = new dto_login { cod_agente = string.Empty, pass = string.Empty, correo = string.Empty }; var ret = mang.ConsultaUsuarios(log); var ret1 = mang.GetUserRoles(); var ret2 = mang.GetUserAgencias(); if (ret.Any()) { dto_login.listadoDto_login = ret; dto_login.ListRoles = ret1; dto_login.ListaAgencias = ret2; } return Json(dto_login.listadoDto_login, JsonRequestBehavior.AllowGet); }
//public ActionResult CargaRoles() //{ // ManagerUser mang = new ManagerUser(); // List<Roles> Roles = new List<Roles>(); // var ret = mang.GetUserRoles(); // if (ret.Any()) // { // Roles = ret; // } // return Json(Roles, JsonRequestBehavior.AllowGet); //} // // GET: /User/Create public ActionResult Create() { ManagerUser mang = new ManagerUser(); dto_login dto_login = new dto_login(); dto_login.ListRoles = new List<Roles>(); dto_login.ListaAgencias = new List<UserAgencias>(); Limpiar(); var ret = mang.GetUserRoles(); var ret2 = mang.GetUserAgencias(); if (ret.Any()) { dto_login.ListRoles = ret; dto_login.ListaAgencias = ret2; } return View(dto_login); }
public ActionResult Create(dto_login dto_login) { if (ModelState.IsValid) { ManagerUser mang = new ManagerUser(); dto_login.ListRoles = new List<Roles>(); dto_login.pass = TwoFunTwoMe_DataAccess.Utility.Encrypt(dto_login.pass); mang.Registrar(dto_login); dto_login = Limpiar(); var ret = mang.GetUserRoles(); if (ret.Any()) { dto_login.ListRoles = ret; } } return View(dto_login); }
// // GET: /SUBMENU/Edit/5 public ActionResult Edit(int id = 0) { ManagerUser mang = new ManagerUser(); clsSUBMENU _SubMenu = new clsSUBMENU(); _SubMenu.listadoSubMenu = new List <clsSUBMENU>(); _SubMenu.listadoMainMenu = new List <clsMAINMENU>(); _SubMenu.ListRoles = new List <Roles>(); var logSubMenu = new clsSUBMENU { ID = id, SUBMENU = string.Empty, CONTROLLER = string.Empty, MAINMENUID = 0, ROLEID = 0, ACTION = string.Empty, ACCION = "CONSULTAR" }; var logMainMenu = new clsMAINMENU { ID = 0, MAINMENU = string.Empty, ACCION = "CONSULTAR" }; var ret = mang.MantenimientoSUBMENU(logSubMenu); var ret1 = mang.MantenimientoMAINMENU(logMainMenu); var ret2 = mang.GetUserRoles(); if (ret.Any() && ret1.Any() && ret2.Any()) { _SubMenu.listadoSubMenu = ret; _SubMenu.listadoMainMenu = ret1; _SubMenu.ListRoles = ret2; } return(Json(_SubMenu, JsonRequestBehavior.AllowGet)); }
// // GET: /SUBMENU/Create public ActionResult Create() { ManagerUser mang = new ManagerUser(); clsSUBMENU _SubMenu = new clsSUBMENU(); _SubMenu.listadoMainMenu = new List <clsMAINMENU>(); _SubMenu.ListRoles = new List <Roles>(); var logMainMenu = new clsMAINMENU { ID = 0, MAINMENU = string.Empty, ACCION = "CONSULTAR" }; var ret1 = mang.MantenimientoMAINMENU(logMainMenu); var ret2 = mang.GetUserRoles(); if (ret1.Any() && ret2.Any()) { _SubMenu.listadoMainMenu = ret1; _SubMenu.ListRoles = ret2; } return(View(_SubMenu)); }