예제 #1
0
        public override Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
        {
            if (User != null && User.Identity.IsAuthenticated)
            {
                _itemRepo.SetLoggedInUserId(GetUserId());
                _itemRepo.SetLoggedInUserName(GetUserUserName());
                _itemRepo.SetIsAdmin(GetIsUserAdmin());

                _unitRepo.SetLoggedInUserId(GetUserId());
                _unitRepo.SetLoggedInUserName(GetUserUserName());
                _unitRepo.SetIsAdmin(GetIsUserAdmin());

                _itemGroupRepo.SetLoggedInUserId(GetUserId());
                _itemGroupRepo.SetLoggedInUserName(GetUserUserName());
                _itemGroupRepo.SetIsAdmin(GetIsUserAdmin());

                _itemUnitRepo.SetLoggedInUserId(GetUserId());
                _itemUnitRepo.SetLoggedInUserName(GetUserUserName());
                _itemUnitRepo.SetIsAdmin(GetIsUserAdmin());

                _priceRepo.SetLoggedInUserId(GetUserId());
                _priceRepo.SetLoggedInUserName(GetUserUserName());
                _priceRepo.SetIsAdmin(GetIsUserAdmin());

                _itemUnitPriceRepo.SetLoggedInUserId(GetUserId());
                _itemUnitPriceRepo.SetLoggedInUserName(GetUserUserName());
                _itemUnitPriceRepo.SetIsAdmin(GetIsUserAdmin());

                _storeItemUnitRepo.SetLoggedInUserId(GetUserId());
                _storeItemUnitRepo.SetLoggedInUserName(GetUserUserName());
                _storeItemUnitRepo.SetIsAdmin(GetIsUserAdmin());
                _storeItemUnitRepo.SetPeriodId(_periodManager.GetPeriod());
            }
            return(base.OnActionExecutionAsync(context, next));
        }