public async Task <IActionResult> ManageProducts() { ManageProductsViewModel model = new ManageProductsViewModel(); model.Products = await productRepo.GetAllProductWithCategory(); return(View(model)); }
public IActionResult Products() { //var products = _productsRepository.Get().ToList(); var manageProductsVM = new ManageProductsViewModel() { ProductsList = _productsRepository.Get().ToList(), ProductData = new Product() }; return(View(manageProductsVM)); }
public IActionResult ManageProducts(ProductFilterInputModel input) { var model = new ManageProductsViewModel() { Page = input.Page, Products = this.productService.GetAllProducts <ProductsViewModel>(input), PagesCount = (int)Math.Ceiling(this.productService.GetAllProductsCount(input) / (double)GlobalConstants.PageSize), Filters = input, }; return(this.View(model)); }
public ActionResult AddProducts(ManageProductsViewModel manageProductsViewModel) { if (manageProductsViewModel == null) { return(View("~/Views/Common/NotFound.cshtml", new NotFoundViewModel() { ElementName = "Products" })); } if (ModelState.IsValid) { if (ModelState.Values.Any(x => x.Errors.Count >= 1)) { return(View("AddMany", manageProductsViewModel)); } } else { ModelState.AddModelError(string.Empty, "Please upload an Excel file with product information."); return(View("AddMany", manageProductsViewModel)); } return(RedirectToAction("index")); }
/// <summary> /// Opens the Product Inventory View /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnProductInventory_Click(object sender, RoutedEventArgs e) { DataContext = new ManageProductsViewModel(); }