public async Task <IActionResult> AddProduct() { try { ProductCatListViewModel response = await this._productCatService.GetAllProductCategory(); if (response != null) { return(View(response)); } return(View()); } catch (Exception) { throw; } }
public async Task <IActionResult> EditProduct(long Id) { try { ProductCatListViewModel response = await this._productCatService.GetAllProductCategory(); ProductViewModel data = await this._productService.GetProductById(Id); if (data != null) { data.productCatViewModels = response.productCatViewModels; return(View(data)); } return(RedirectToAction("Index")); } catch (Exception) { throw; } }
public async Task <IActionResult> Index() { try { DashboardListViewModel response = new DashboardListViewModel(); ProductCatListViewModel abc = await this._productCatService.GetAllProductCategory(); ProductListViewModel xyz = await this._productService.GetAllProduct(); response.productCatViewModels = abc.productCatViewModels; response.productViewModels = xyz.productViewModels; if (response.productCatViewModels.Count > 0 || response.productViewModels.Count > 0) { return(View(response)); } return(View()); } catch (Exception) { throw; } }