Exemplo n.º 1
0
        // GET: Users/Create
        public ActionResult Create()
        {
            if (Request.IsAuthenticated)
            {
                Users User = new Users();

                var Roles = from r in RolesBL.Roles()
                            where r.ActiveFlag == true
                            select r;

                User.RolesList = Roles.ToList();

                return(View(User));
            }
            else
            {
                return(this.RedirectToAction("Login", "Account"));
            }
        }
Exemplo n.º 2
0
 // GET: Roles
 public ActionResult Index()
 {
     if (Request.IsAuthenticated)
     {
         return(View(RolesBL.Roles().ToList()));
     }
     else
     {
         return(this.RedirectToAction("Login", "Account"));
     }
 }
        // GET: AppDirectory
        public ActionResult Index(int RoleID)
        {
            if (Request.IsAuthenticated)
            {
                var Profile = AppDirBL.AppProfilebyRole(RoleID);

                var roleName = from r in RoleBL.Roles()
                               where r.RoleID == RoleID
                               select r.RoleName;

                ViewBag.RoleName = roleName.FirstOrDefault();
                ViewBag.RoleID   = RoleID;

                return(View(Profile));
            }
            else
            {
                return(this.RedirectToAction("Login", "Account"));
            }
        }