Beispiel #1
0
        public ActionResult AgregarRol(Rol model)
        {
            string name    = TempData["username"].ToString();
            string nameRol = TempData["rol"].ToString();
            int    codUser = Int32.Parse(TempData["codUser"].ToString());

            ViewBag.name         = name;
            ViewBag.rol          = nameRol;
            TempData["username"] = name;
            TempData["rol"]      = nameRol;
            TempData["codUser"]  = codUser;

            DAOUsuario dataU  = DAOUsuario.getInstance();
            string     today  = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss tt");
            string     accion = "Registro Rol " + model.Nombre;

            dataU.insertarAccion(codUser, 1, today, accion);

            DAORol data = DAORol.getInstance();

            data.insertarRol(model.Nombre);
            List <Rol> Roles = data.obtenerRol();

            return(View("~/Views/Rol/IndexRol.cshtml", Roles));
        }