public bool ChangeProductInfo(int storeId, int productId, string name, string desc, double price, string category, int amount) { if (!loggedIn) { notLoggedInException(); } return(StoreService.ChangeProductInfo(user, storeId, productId, name, desc, price, category, amount)); }
public bool RemoveProductFromStore(int storeId, int productId) { if (!loggedIn) { notLoggedInException(); } return(StoreService.RemoveProductFromStore(user, storeId, productId)); }
public int AddProductToStore(int storeId, string name, string desc, double price, string category) { if (!loggedIn) { notLoggedInException(); } return(StoreService.AddProductToStore(user, storeId, name, desc, price, category)); }
public bool AddProductToStock(int storeId, int productId, int amount) { if (!loggedIn) { notLoggedInException(); } return(StoreService.AddProductToStock(user, storeId, productId, amount)); }
public bool closeStore(int storeID) { if (!loggedIn) { notLoggedInException(); } return(StoreService.CloseStore(user, storeID)); }
public int AddStore(string storeName) { if (!loggedIn) { notLoggedInException(); } return(StoreService.AddStore(user, storeName)); }
public List <Product> getAllProductsForStore(int storeId) { Store storeAns = StoreService.GetStore(storeId); if (storeAns == null) { return(new List <Product>()); } else { return(storeAns.getAllProducst()); } }
public string GetStore(int storeId) { Store storeAnse = StoreService.GetStore(storeId); if (storeAnse == null) { throw new Exception("store not found"); } else { return(JsonHandler.SerializeObject(storeAnse)); } }
public string GetProductInfo(int productId) { Product ret; try { ret = StoreService.GetProductInfo(productId); return(objDynamicJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string SearchProducts(string name, string category, string keyword, double startPrice, double endPrice, int productRank, int storeRank) { List <Product> ret; try { ret = StoreService.SearchProducts(name, category, keyword, startPrice, endPrice, productRank, storeRank); return(objDynamicJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string GetStore(int storeId) { Store ret; try { ret = StoreService.GetStore(storeId); return(objDynamicJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string GetAllOwners(int storeId) { List <Member> ret; try { ret = StoreService.getAllManagers(storeId); return(objDynamicJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string GetAllStores() { List <Store> ret; try { ret = StoreService.GetAllStores(); return(objDynamicJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string AddProductToStock(int storeId, int productId, int amount) { if (!loggedIn) { return(notLoggedInError()); } bool ret; try { ret = StoreService.AddProductToStock(user, storeId, productId, amount); return(resultJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string closeStore(int storeID) { if (!loggedIn) { return(notLoggedInError()); } bool ret; try { ret = StoreService.CloseStore(user, storeID); return(resultJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string RemoveProductFromStore(int storeId, int productId) { if (!loggedIn) { return(notLoggedInError()); } bool ret; try { ret = StoreService.RemoveProductFromStore(user, storeId, productId); return(resultJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string ChangeProductInfo(int storeId, int productId, string name, string desc, double price, string category, int amount) { if (!loggedIn) { return(notLoggedInError()); } bool ret; try { ret = StoreService.ChangeProductInfo(user, storeId, productId, name, desc, price, category, amount); return(resultJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string AddProductToStore(int storeId, string name, string desc, double price, string category) { if (!loggedIn) { return(notLoggedInError()); } int ret; try { ret = StoreService.AddProductToStore(user, storeId, name, desc, price, category); return(intJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public string AddStore(string storeName) { if (!loggedIn) { return(notLoggedInError()); } int ret; try { ret = StoreService.AddStore(user, storeName); return(intJson(ret)); } catch (Exception e) { return(generateMessageFormatJason(e.Message)); } }
public static void openStore(string[] fullcommand) { if (fullcommand.Length == 3) { string username = fullcommand[1]; string storeName = fullcommand[2]; try { User user = getUser(username, users[username]); StoreService.AddStore(user, storeName); Logger.Log("event", logLevel.INFO, $"Init system: user {username} open the store {storeName}"); } catch (Exception e) { Logger.Log("error", logLevel.ERROR, $"Init system: open store {e.Data}"); } } else { Logger.Log("error", logLevel.ERROR, "Init system: open store bad input"); } }
public string GetAllStores() { //Store s2 = StoreService.GetStore(2); //foreach (Stock st in s2.Stocks) //{ // int i = st.id; //} /* * List<Store> ls = StoreService.GetAllStores(); * //jonathan: i just wrote this for debug * foreach (Store s in ls) * { * foreach (Stock st in s.Stocks) * { * int i = st.id; * } * } */ List <Store> ls = StoreService.GetAllStores(); return(JsonHandler.SerializeObject(ls)); }
public string GetProductInfo(int productId) { return(JsonHandler.SerializeObject(StoreService.GetProductInfo(productId))); }
public List <Product> SearchProducts(string name, string category, string keyword, double startPrice, double endPrice, int productRank, int storeRank) { return(StoreService.SearchProducts(name, category, keyword, startPrice, endPrice, productRank, storeRank)); }
//TODO wolf delete? public List <Member> GetAllOwners(int storeId) { return(StoreService.getAllManagers(storeId)); }