コード例 #1
0
ファイル: SellerController.cs プロジェクト: shachafn/wsep192
 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));
 }