public ActionResult Add(ScreperProductViewModel model) { var NewScreper = new ScreperURL(); NewScreper.Name = model.ScreperName; NewScreper.SUrl = model.ScreperURL; NewScreper.ProductID = model.ProductID; ScreperService.Instance.AddScreper(NewScreper); return(RedirectToAction("ProductTable", "Product")); }
public ActionResult Add(int ProductID) { ScreperProductViewModel model = new ScreperProductViewModel(); var product = ProductsService.Instance.GetOnlyProduct(ProductID); model.ProductID = product.ID; model.Name = product.Name; model.Description = product.Description; model.Price = product.Price; //model.CategoryID = product.Category != null ? product.Category.ID : 0; model.ImageURL = product.ImageURl; // model.AvailableCategories = CategoriesService.Instance.GetAllCategories(); return(PartialView(model)); }