コード例 #1
0
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var obj = RolDAL.ConsultarRol(id.Value);

            if (obj == null)
            {
                return(HttpNotFound());
            }
            else
            {
                return(View(obj));
            }
        }
コード例 #2
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var rol = RolDAL.ConsultarRol(id.Value);

            ViewBag.idsPerfilesRol = RolDAL.ListadoRolPerfil(id.Value);
            SelectList perfiles = new SelectList(PerfilesDAL.ListadoPerfil(), "Value", "Text");

            ViewBag.idsPerfiles = perfiles;

            if (rol == null)
            {
                return(HttpNotFound());
            }
            return(View(rol));
        }