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); }