示例#1
0
 public IActionResult DeleteOwner(string OwnerId, string ShopId)
 {
     try
     {
         _serviceFacade.CascadeRemoveShopOwner(new Guid(HttpContext.Session.Id), new Guid(ShopId), new Guid(OwnerId));
         return(RedirectToAction("Manage", "Seller", new { ShopId }));
     }
     catch (GeneralServerError)
     {
         var redirect = this.Url.Action("Index", "Seller");
         var message  = new UserMessage(redirect, "An error has occured. Please refresh and try again.");
         return(View("UserMessage", message));
     }
     catch (NoPrivilegesException)
     {
         var redirect = this.Url.Action("Index", "Seller");
         var message  = new UserMessage(redirect, "You haven't sufficient priviliges. Cannot complete the request.");
         return(View("UserMessage", message));
     }
     catch (DatabaseConnectionTimeoutException)
     {
         var redirect = this.Url.Action("Index", "Seller");
         var message  = new UserMessage(redirect, "An error has occured. Please refresh and try again. (Database connection lost).");
         return(View("UserMessage", message));
     }
 }
示例#2
0
 public bool CascadeRemoveShopOwner(Guid userGuid, Guid shopGuid, Guid ownerToRemoveGuid)
 {
     return(_serviceFacade.CascadeRemoveShopOwner(userGuid, shopGuid, ownerToRemoveGuid));
 }