Пример #1
0
 public IActionResult AddOwner(string OwnerName, string ShopId)
 {
     try
     {
         Guid OwnerId = _serviceFacade.GetUserGuid(OwnerName); //need to adress the empty guid thingy
         _serviceFacade.AddShopOwner(new Guid(HttpContext.Session.Id), new Guid(ShopId), OwnerId);
         return(RedirectToAction("Manage", "Seller", new { ShopId }));
     }
     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 (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 (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 AddShopOwner(Guid userGuid, Guid shopGuid, Guid newShopOwnerGuid)
 {
     return(_serviceFacade.AddShopOwner(userGuid, shopGuid, newShopOwnerGuid));
 }