//
        // GET: /Home/
        // GET: /Home/Index
        public ActionResult Index()
        {
            List <UserMenuDTO> menuItems = userMenuService.GetAll().ToList();
            string             s         = menuItems[0].User.Email;

            return(View("Index"));
        }
Example #2
0
        public int CreateDefaultAccess(int UserAccountId, IUserMenuService _userMenuService, IUserAccountService _userAccountService)
        {
            var userMenus = _userMenuService.GetAll();
            int count     = 0;

            foreach (var userMenu in userMenus)
            {
                UserAccess userAccess = new UserAccess()
                {
                    UserAccountId = UserAccountId,
                    UserMenuId    = userMenu.Id,
                };
                UserAccount userAccount = _userAccountService.GetObjectById(UserAccountId);
                if (userAccount.IsAdmin)
                {
                    userAccess.AllowConfirm        = true;
                    userAccess.AllowCreate         = true;
                    userAccess.AllowDelete         = true;
                    userAccess.AllowEdit           = true;
                    userAccess.AllowPaid           = true;
                    userAccess.AllowPrint          = true;
                    userAccess.AllowReconcile      = true;
                    userAccess.AllowUnconfirm      = true;
                    userAccess.AllowUndelete       = true;
                    userAccess.AllowUnpaid         = true;
                    userAccess.AllowUnreconcile    = true;
                    userAccess.AllowView           = true;
                    userAccess.AllowSpecialPricing = true;
                }
                CreateObject(userAccess, _userAccountService, _userMenuService);
                if (!userAccess.Errors.Any())
                {
                    count++;
                }
            }
            return(count);
        }