public string AddStoreOwner(int storeId, string userToAdd) { if (!loggedIn) { return(notLoggedInError()); } int ret; bool result = false; try { ret = UserService.AddStoreOwner(user, storeId, userToAdd); if (ret == -1) { result = true; } return(resultJson(result)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public bool AddStoreOwner(int storeId, string userToAdd) { if (!loggedIn) { notLoggedInException(); } int ownerShipRequestID = UserService.AddStoreOwner(user, storeId, userToAdd); if (ownerShipRequestID == -1) { //this means there was only one user that was an owner so he approved himself the request, //no need to de anything except for updating the memebr on succses return(true); } else { //in this case: //needs to save the request id and that the client side will be able to show //the rigth request to the relevant user, and he will use the //ApproveOwnershipRequest or DisApproveOwnershipRequest } return(true); }