public void makeOwner() { Roles roles = ConnectionStubTemp.getMember(initiate).getStoreManagerRoles(store.id); ConnectionStubTemp.getMember(initiate).makeStoreOwner(candidate.username, roles, store.id); ConnectionStubTemp.deleteOwnershipRequest(this); }
/// <summary> /// /// </summary> /// <param name="username"></param> /// <param name="role"></param> /// <param name="StoreID"></param> /// <returns> the request nunmber if nessecary, else -1</returns> public int addStoreOwner(string username, Roles role, int StoreID) { Store store = GetStore(StoreID); int numberOfOwners = ConnectionStubTemp.getNumOfOwners(store); int requestId; if (numberOfOwners > 1) { requestId = ConnectionStubTemp.createOwnershipRequest(store, this, ConnectionStubTemp.getMember(username)); ConnectionStubTemp.Update(ConnectionStubTemp.getMember(username));//shira return(requestId); } else if (numberOfOwners <= 0) { throw new Exception("You dont own this store! should not happen!!"); } requestId = ConnectionStubTemp.createOwnershipRequest(store, this, ConnectionStubTemp.getMember(username)); if (ConnectionStubTemp.GetOwnershipRequest(requestId) != null) { ConnectionStubTemp.deleteOwnershipRequest(ConnectionStubTemp.GetOwnershipRequest(requestId)); } ConnectionStubTemp.Update(ConnectionStubTemp.getMember(username));//shira return(-1); }