Exemple #1
0
        public ActionResult Edit(int id)
        {
            var benefit     = _benefitService.GetById(id);
            var benefitForm = BenefitForm.FromBenefit(benefit);

            return(View(benefitForm));
        }
Exemple #2
0
        public ActionResult Detail(int id)
        {
            var benefit     = _benefitService.GetById(id);
            var benefitForm = BenefitForm.FromBenefit(benefit);

            ViewBag.IsApproved = benefit.StatusId == StatusEnum.Approved;
            return(View(benefitForm));
        }
Exemple #3
0
        public ActionResult Detail(int id)
        {
            var benefit     = _benefitService.GetById(id);
            var benefitForm = BenefitForm.FromBenefit(benefit);

            ViewBag.BenefitStatus = benefit.Status != null
                ? benefit.Status.Name
                : string.Empty;

            ViewBag.ReturnController = _currentUser.Shop != null
                ? "Shop"
                : "Admin";

            ViewBag.ShowApprovalButtons = User.IsInRole(RolesNames.Admin) && benefit.StatusId == StatusEnum.Pending;

            ViewBag.ShopName = benefit.Shop.Name;

            return(View(benefitForm));
        }