public void init() { CleanDB cDB = new CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); ss = storeServices.getInstance(); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); us.login(zahi, "zahi", "123456"); int storeid = ss.createStore("abowim", zahi); store = StoreManagement.getInstance().getStore(storeid); int c = ss.addProductInStore("cola", 3.2, 10, zahi, storeid, "Drinks"); cola = ProductManager.getInstance().getProductInStore(c); }
public void init() { CleanDB cDB = new CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); ss = storeServices.getInstance(); ses = sellServices.getInstance(); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); us.login(zahi, "zahi", "123456"); admin = us.startSession(); us.register(admin, "admin", "123456"); us.login(admin, "admin", "123456"); }
public void init() { CleanDB cDB = new CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); ss = storeServices.getInstance(); admin = us.startSession(); us.register(admin, "admin", "123456"); us.login(admin, "admin", "123456"); admin1 = us.startSession(); us.register(admin1, "admin1", "123456"); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); us.login(zahi, "zahi", "123456"); itamar = us.startSession(); us.register(itamar, "itamar", "123456"); us.login(itamar, "itamar", "123456"); int storeid = ss.createStore("MariaNettaInc", itamar); store = StoreManagement.getInstance().getStore(storeid); niv = us.startSession(); us.register(niv, "niv", "123456"); us.login(niv, "niv", "123456"); ss.addStoreManager(store.getStoreId(), "niv", itamar); int c = ss.addProductInStore("cola", 3.2, 10, itamar, storeid, "Drinks"); int s = ss.addProductInStore("sprite", 5.3, 20, itamar, storeid, "Drinks"); cola = ProductManager.getInstance().getProductInStore(c); sprite = ProductManager.getInstance().getProductInStore(s); saleId = ss.addSaleToStore(itamar, store.getStoreId(), cola.getProductInStoreId(), 1, 1, "20.5.2018"); raffleSale = ss.addSaleToStore(itamar, store.getStoreId(), cola.getProductInStoreId(), 3, 1, "20.5.2018"); }
public void init() { CleanDB cDB = new CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); ss = storeServices.getInstance(); sellS = sellServices.getInstance(); admin = us.startSession(); us.register(admin, "admin", "123456"); us.login(admin, "admin", "123456"); admin1 = us.startSession(); us.register(admin1, "admin1", "123456"); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); itamar = us.startSession(); us.register(itamar, "itamar", "123456"); us.login(itamar, "itamar", "123456"); int storeId = ss.createStore("Maria&Netta Inc.", itamar); store = StoreManagement.getInstance().getStore(storeId); niv = us.startSession(); us.register(niv, "niv", "123456"); us.login(niv, "niv", "123456"); ss.addStoreManager(storeId, "niv", itamar); int colaId = ss.addProductInStore("cola", 3.2, 10, itamar, storeId, "Drinks"); cola = ProductManager.getInstance().getProductInStore(colaId); int spriteId = ss.addProductInStore("sprite", 5.2, 100, itamar, storeId, "Drinks"); sprite = ProductManager.getInstance().getProductInStore(spriteId); ss.addSaleToStore(itamar, storeId, cola.getProductInStoreId(), 1, 10, DateTime.Now.AddMonths(10).ToString()); }
public void init() { CleanDB cDB = new CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); StorePremissionsArchive.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); us.login(zahi, "zahi", "123456"); aviad = us.startSession(); us.register(aviad, "aviad", "123456"); us.login(aviad, "aviad", "123456"); shay = us.startSession(); us.register(shay, "shay", "123456"); us.login(shay, "shay", "123456"); itamar = new User("itamar", "123456"); niv = us.startSession(); us.register(niv, "niv", "123456"); ss = storeServices.getInstance(); store = StoreManagement.getInstance().getStore(ss.createStore("abowim", zahi)); ss.addStoreManager(store.getStoreId(), "aviad", zahi); niv.logOut(); //ADD ALL PERMISSIONS ss.addManagerPermission("addProductInStore", store.getStoreId(), "aviad", zahi); ss.addManagerPermission("editProductInStore", store.getStoreId(), "aviad", zahi); ss.addManagerPermission("removeProductFromStore", store.getStoreId(), "aviad", zahi); ss.addManagerPermission("addStoreManager", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("removeStoreManager", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("addManagerPermission", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("removeManagerPermission", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("addSaleToStore", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("removeSaleFromStore", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("editSale", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("addDiscount", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("removeDiscount", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("addNewCoupon", store.getStoreId(), aviad.getUserName(), zahi); ss.addManagerPermission("removeCoupon", store.getStoreId(), aviad.getUserName(), zahi); }
public void init() { CleanDB cDB = new CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); }
public void init() { CleanDB cDB = new CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); ss = storeServices.getInstance(); ses = sellServices.getInstance(); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); us.login(zahi, "zahi", "123456"); itamar = us.startSession(); us.register(itamar, "itamar", "123456"); us.login(itamar, "itamar", "123456"); int storeid = ss.createStore("abowim", zahi); store = StoreManagement.getInstance().getStore(storeid); int colaId = ss.addProductInStore("cola", 10, 100, zahi, storeid, "Drinks"); cola = ProductManager.getInstance().getProductInStore(colaId); ss.addSaleToStore(zahi, store.getStoreId(), cola.getProductInStoreId(), 1, 20, "20/8/2018"); LinkedList <Sale> SL = ss.viewSalesByStore(store.getStoreId()); foreach (Sale sale in SL) { if (sale.ProductInStoreId == cola.getProductInStoreId()) { colaSale = sale; } } }
static void Main(string[] args) { CleanDB cDB = new CleanDB(); cDB.insertData(); /* * string sql = " SELECT * FROM Users "; * MySqlConnection con = new MySqlConnection(Production_DB); * MySqlCommand cmd = new MySqlCommand(sql, con); * * con.Open(); * * MySqlDataReader reader = cmd.ExecuteReader(); * * while (reader.Read()) * { * Console.WriteLine(reader.GetString("Username")); * } * Console.ReadLine();*/ }
public void init() { CleanDB cDB = new CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); ss = storeServices.getInstance(); admin = us.startSession(); us.register(admin, "admin", "123456"); us.login(admin, "admin", "123456"); admin1 = us.startSession(); us.register(admin1, "admin1", "123456"); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); zahi.login("zahi", "123456"); itamar = us.startSession(); us.register(itamar, "itamar", "123456"); itamar.login("itamar", "123456"); store = StoreManagement.getInstance().getStore(itamar.createStore("Maria&Netta Inc.")); niv = us.startSession(); us.register(niv, "niv", "123456"); niv.login("niv", "123456"); ss.addStoreManager(store.getStoreId(), "niv", itamar); }
protected void SetUp() { CleanDB cleaner = new CleanDB(); cleaner.EmptyDB(); }