private void InitiateOrder(int systemId, string userName, string userAddress, string userCreditCard) { var userService = EnterController.GetUserSession(systemId); orderService = MarketYard.Instance.GetOrderService(ref userService); answer = orderService.GiveDetails(userName, userAddress, userCreditCard); }
public IActionResult RemovePolicy(int systemId, string state, string type, string subject) { var adminService = MarketYard.Instance.GetSystemAdminService(EnterController.GetUserSession(systemId)); var answer = adminService.RemovePolicy(type, subject); return(RedirectToAction("PurchasePolicyPage", new { systemId, state, message = answer.Answer, valid = answer.Status == Success })); }
public IActionResult EditProductPage(int systemId, string state, string message, string store, string product) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.GetProductInfo(product); return(View(new ProductInfoModel(systemId, state, message, store, product, answer.ReportList[0]))); }
public IActionResult RemovePolicy(int systemId, string state, string store, string type, string subject, string optProd) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.RemovePolicy(type, subject, optProd); return(RedirectToAction("StorePurchasePolicyPage", new { systemId, state, message = answer.Answer, valid = answer.Status == Success, store })); }
public IActionResult EditCategoryDiscountPage(int systemId, string state, string message, string store) { var userService = EnterController.GetUserSession(systemId); var storeShoppingService = MarketYard.Instance.GetStoreShoppingService(ref userService); string[] categories = storeShoppingService.GetAllDiscountCategoriesInStore(store).ReportList; return(View(new CategoryStorelistModel(systemId, state, message, store, categories))); }
public IActionResult SearchProductView(int systemId, string state, string message) { var userService = EnterController.GetUserSession(systemId); var storeShoppingService = MarketYard.Instance.GetStoreShoppingService(ref userService); string[] categories = storeShoppingService.GetAllCategoryNames().ReportList; return(View(new CategoryListModel(systemId, state, message, categories))); }
public IActionResult HandlingCategoryView(int systemId, string state, string message, bool valid) { var adminService = MarketYard.Instance.GetSystemAdminService(EnterController.GetUserSession(systemId)); MarketAnswer answer = adminService.ViewAllCategories(); categoryList = answer.ReportList; return(View(new CategoryListModel(systemId, state, message, answer.ReportList, valid))); }
public IActionResult RemoveCartItem(int systemId, string state, string store, string product, double unitPrice) { var userService = EnterController.GetUserSession(systemId); var answer = userService.RemoveFromCart(store, product, unitPrice); var message = answer.Status == 0 ? null : answer.Answer; return(RedirectToAction("CartManagement", new { systemId, state, message })); }
public IActionResult RemovingProductCategoryPage(int systemId, string state, string message, string store, string product, bool valid) { ViewBag.valid = valid; var userService = EnterController.GetUserSession(systemId); var storeShoppingService = MarketYard.Instance.GetStoreShoppingService(ref userService); string[] categories = storeShoppingService.GetAllCategoryNames().ReportList; return(View(new ProductInStoreCategoriesModel(systemId, state, message, store, product, categories))); }
public IActionResult AddQuanitityToProduct(int systemId, string state, string store, string product, int quantity) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.AddQuanitityToProduct(product, quantity); return(answer.Status == Success? RedirectToAction("ManageProducts", new { systemId, state, message = answer.Answer, store }) : RedirectToAction("StoreControl", new { systemId, state, message = answer.Answer })); }
public IActionResult EditProduct(int systemId, string state, string store, string product, string productNewName, string basePrice, string description) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.EditProduct(product, productNewName, basePrice, description); return(answer.Status == Success? RedirectToAction("ManageProducts", new { systemId, state, message = answer.Answer, store }) : RedirectToAction("EditProductPage", new { systemId, state, message = answer.Answer, store, product })); }
public IActionResult RemoveCategory(int systemId, string state, string category) { var adminService = MarketYard.Instance.GetSystemAdminService(EnterController.GetUserSession(systemId)); var answer = adminService.RemoveCategory(category); if (answer.Status == Success) { return(RedirectToAction("HandlingCategoryView", new { systemId, state, message = answer.Answer, valid = true })); } return(RedirectToAction("HandlingCategoryView", new { systemId, state, message = answer.Answer, valid = false })); }
public IActionResult RemoveCategoryDiscount(int systemId, string state, string store, string categoryName) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.RemoveCategoryDiscount(categoryName); if (answer.Status != Success) { return(RedirectToAction("RemoveCategoryDiscountPage", new { systemId, state, message = answer.Answer, store, valid = false })); } return(RedirectToAction("CategoryDiscountMenu", new { systemId, state, message = answer.Answer, store, valid = true })); }
public IActionResult RemoveCategoryProduct(int systemId, string state, string store, string product, string category) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.RemoveProductFromCategory(category, product); if (answer.Status == Success) { return(RedirectToAction("RemovingProductCategoryPage", new { systemId, state, message = answer.Answer, store, product, valid = true })); } return(RedirectToAction("RemovingProductCategoryPage", new { systemId, state, message = answer.Answer, store, product, valid = false })); }
public IActionResult SearchProduct(int systemId, string state, string value, double minPrice, double maxPrice, string category) { var userService = EnterController.GetUserSession(systemId); var storeShoppingService = MarketYard.Instance.GetStoreShoppingService(ref userService); var answer = storeShoppingService.SearchProduct(value, minPrice, maxPrice, category); if (answer.Status == 0) { return(RedirectToAction("ProductsView", new { systemId, state, results = answer.ReportList })); } return(RedirectToAction("SearchProductView", new { systemId, state, message = answer.Answer, results = answer.ReportList })); }
public IActionResult RemoveDiscount(int systemId, string state, string store, string product) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.RemoveDiscountFromProduct(product); if (answer.Status != Success) { return(RedirectToAction("DeclareDiscountPolicy", new { systemId, state, message = answer.Answer, store, product, valid = false })); } return(RedirectToAction("DeclareDiscountPolicy", new { systemId, state, message = answer.Answer, store, product, valid = true })); }
public IActionResult RemoveProduct(int systemId, string state, string store, string product) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.RemoveProduct(product); if (answer.Status == Success) { return(RedirectToAction("ManageProducts", new { systemId, state, store })); } return(RedirectToAction("StoreControl", new { systemId, state, message = answer.Answer })); }
public IActionResult ToRemoveUser(int systemId, string state, string toDeleteName) { var adminService = MarketYard.Instance.GetSystemAdminService(EnterController.GetUserSession(systemId)); var answer = adminService.RemoveUser(toDeleteName); return(RedirectToAction("RemoveUserView", new { systemId, state, message = answer.Answer, valid = answer.Status == Success })); }
public IActionResult ViewErrors(int systemId, string state) { var adminService = MarketYard.Instance.GetSystemAdminService(EnterController.GetUserSession(systemId)); var answer = adminService.ViewError(); if (answer.Status == Success) { return(View(new ErrorLogModel(systemId, state, answer.ReportList))); } return(RedirectToAction("MainLobby", "Home", new { systemId, state, message = answer.Answer })); }
public IActionResult ManageProducts(int systemId, string state, string message, string store) { var userService = EnterController.GetUserSession(systemId); var storeShoppingService = MarketYard.Instance.GetStoreShoppingService(ref userService); var answer = storeShoppingService.ViewStoreStockAll(store); if (answer.Status == Success) { return(View(new StorePorductListModel(systemId, state, message, store, answer.ReportList))); } return(RedirectToAction("StoreControl", new { systemId, state, message = answer.Answer })); }
public IActionResult ViewPromotionHistory(int systemId, string state, string store) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.ViewPromotionHistory(); if (answer.Status == Success) { return(View(new PromotionHistoryModel(systemId, state, store, answer.ReportList))); } return(RedirectToAction("StoreControl", new { systemId, state, message = answer.Answer })); }
public IActionResult ViewStoreStock(int systemId, string state, string store, bool valid, string message) { var userService = EnterController.GetUserSession(systemId); var storeShoppingService = MarketYard.Instance.GetStoreShoppingService(ref userService); var answer = storeShoppingService.ViewStoreStock(store); ViewBag.valid = valid; if (answer.Status == 0) { return(View(new StorePorductListModel(systemId, state, message, store, answer.ReportList))); } return(RedirectToAction("BrowseMarket", new { systemId, state, answer.Answer })); }
public IActionResult SubmitSignUp(int systemId, string usernameEntry, string addressEntry, string passwordEntry, string creditCardEntry) { var userService = EnterController.GetUserSession(systemId); var answer = userService.SignUp(usernameEntry, addressEntry, passwordEntry, creditCardEntry); if (answer.Status == Success) { return(RedirectToAction("MainLobby", new { systemId, state = "Registered", message = answer.Answer })); } return(RedirectToAction("SignUp", new { systemId, state = "Guest", message = answer.Answer })); }
public IActionResult OpenStore(int systemId, string state, string storeName, string storeAddress) { var userService = EnterController.GetUserSession(systemId); var storeShoppingService = MarketYard.Instance.GetStoreShoppingService(ref userService); var answer = storeShoppingService.OpenStore(storeName, storeAddress); if (answer.Status == Success) { return(RedirectToAction("StoreControl", new { systemId, state, message = answer.Answer, valid = true })); } return(RedirectToAction("OpenStoreView", new { systemId, state, message = answer.Answer })); }
public IActionResult ChartsView(int systemId, string state) { var adminService = MarketYard.Instance.GetSystemAdminService(EnterController.GetUserSession(systemId)); var answer = adminService.GetEntranceDetails(); string message = null; if (answer.Status != Success) { message = answer.Answer; } return(View(new UserModel(systemId, state, message))); }
public IActionResult ViewStoreInfo(int systemId, string state, string store) { var userService = EnterController.GetUserSession(systemId); var storeShoppingService = MarketYard.Instance.GetStoreShoppingService(ref userService); var answer = storeShoppingService.ViewStoreInfo(store); if (answer.Status != 0) { return(RedirectToAction("BrowseMarket", new { systemId, state, answer.Answer })); } var storeInfo = "Name : " + answer.ReportList[0] + " Address : " + answer.ReportList[1]; return(View(new StoreDetailsModel(systemId, state, answer.Answer, storeInfo))); }
public IActionResult ManageStore(int systemId, string state, string store, string option) { var userService = EnterController.GetUserSession(systemId); var answer = userService.GetStoreManagerPolicies(store); string[] userPolicies = answer.ReportList; if (userPolicies.Contains(option) || userPolicies.Contains("StoreOwner")) { return(RedirectToAction(SetPermissionNameToActionName(option), new { systemId, state, store })); } return(RedirectToAction("ManageStoreOptions", new { systemId, state, message = "The user doesn't have the permission to operate this action!", store })); }
public IActionResult AddNewLottery(int systemId, string state, string store, string product, double price, string description, DateTime startDate, DateTime endDate) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.AddNewLottery(product, price, description, startDate, endDate); if (answer.Status == 0) { return(RedirectToAction("ManageProducts", new { systemId, state, message = answer.Answer, store })); } return(RedirectToAction("AddNewLotteryPage", new { systemId, state, message = answer.Answer, store })); }
public IActionResult EditDiscount(int systemId, string state, string store, string product, string discountCode, bool isHidden, string startDate, string endDate, string discountAmount, bool isPercentage) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.EditDiscount(product, null, isHidden, startDate, endDate, discountAmount, isPercentage); if (answer.Status == Success) { return(RedirectToAction("DeclareDiscountPolicy", new { systemId, state, message = answer.Answer, store, valid = true })); } return(RedirectToAction("EditDiscountPage", new { systemId, state, message = answer.Answer, store, product })); }
public IActionResult AddCategoryDiscount(int systemId, string state, string store, string categoryName, DateTime startDate, DateTime endDate, int discountAmount) { var userService = EnterController.GetUserSession(systemId); var storeManagementService = MarketYard.Instance.GetStoreManagementService(userService, store); var answer = storeManagementService.AddCategoryDiscount(categoryName, startDate, endDate, discountAmount); if (answer.Status == Success) { return(RedirectToAction("CategoryDiscountMenu", new { systemId, state, message = answer.Answer, store, valid = true })); } return(RedirectToAction("AddCategoryDiscountPage", new { systemId, state, message = answer.Answer, store })); }