public ActionResult DenyAccess(MerchantDenyAccessBindingModel bm) { if (!ModelState.IsValid || !this.service.DenyMerchantAccess(bm)) { this.AddNotification("Failed to deny merchant access!", NotificationType.ERROR); return(this.RedirectToAction("AllMerchants")); } this.AddNotification("Denied merchant access!", NotificationType.SUCCESS); return(this.RedirectToAction("AllMerchants")); }
public bool DenyMerchantAccess(MerchantDenyAccessBindingModel bm) { var merchant = this.db.Merchants.Find(m => m.AppUser.Email == bm.Email); if (merchant == null) { return(false); } merchant.IsReal = false; this.db.SaveChanges(); return(true); }