Exemple #1
0
 public IActionResult AddEdit(int productId, int importId)
 {
     if (productId <= 0)
     {
         return(RedirectToAction("Listing", "Product"));
     }
     if (productId > 0)
     {
         var pro = _productService.GetFullProductById(productId);
         if (pro != null)
         {
             var model = new ProductImport();
             model.ProductId = productId;
             ViewBag.Product = pro;
             if (importId > 0)
             {
                 model = _importService.Get(importId);
             }
             else
             {
                 model.ImportDate = DateTime.Now;
             }
             return(View(model));
         }
     }
     return(RedirectToAction("Listing", "Product"));
 }