Пример #1
0
 public ActionResult AllowAccess(MerchantAllowAccessBindingModel bm)
 {
     if (!ModelState.IsValid || !this.service.AllowMerchantAccess(bm))
     {
         this.AddNotification("Failed to allow access!", NotificationType.ERROR);
         return(this.RedirectToAction("AllPendingMerchants"));
     }
     this.AddNotification("Merchant access allowed!", NotificationType.SUCCESS);
     return(this.RedirectToAction("AllPendingMerchants"));
 }
        public bool AllowMerchantAccess(MerchantAllowAccessBindingModel bm)
        {
            var merchant = this.db.Merchants.Find(m => m.Id == bm.Id);

            if (merchant == null)
            {
                return(false);
            }

            merchant.IsReal = true;
            this.db.SaveChanges();
            return(true);
        }