public string GetMyOrderHistory(Guid sessionID)// UC 3.7 { if (sessionID == null || sessionID.Equals(Guid.Empty)) { Logger.writeEvent("Invalid input while getting the user history"); return(Json.Create_json_response(false, new InvalidInputException())); } if (!newMarketFacade.IsloggedIn(sessionID)) { Logger.writeEvent("GetMyOrderHistory failed | not logged in"); return(Json.Create_json_response(false, new LoggedOutException())); } return(newMarketFacade.GetMyOrderHistory(sessionID)); }
public string GetUserOrderHistory(Guid sessionID, string username)// UC 6.4 { if (string.IsNullOrWhiteSpace(username) || sessionID == null || sessionID.Equals(Guid.Empty)) { Logger.writeEvent("Invalid input while getting the user " + username + " history"); return(Json.Create_json_response(false, new InvalidInputException())); } if (!newMarketFacade.IsloggedIn(sessionID)) { Logger.writeEvent("GetUserOrderHistory failed | not logged in"); return(Json.Create_json_response(false, new LoggedOutException())); } if (!newMarketFacade.IsRegisteredUser(username)) { Logger.writeEvent("GetUserOrderHistory failed | not a registered user"); return(Json.Create_json_response(false, new NotRegisterdException())); } if (!newMarketFacade.IsAdmin(sessionID)) { Logger.writeEvent("GetUserOrderHistory failed | Not admin"); return(Json.Create_json_response(false, new NotAdminException())); } return(newMarketFacade.GetUserOrderHistory(sessionID, username)); }