public ActionResult Create(SalesProductServiceCatelog salesproductservicecatelog) { if (ModelState.IsValid) { salesproductservicecatelogRepository.InsertOrUpdate(salesproductservicecatelog); salesproductservicecatelogRepository.Save(); return RedirectToAction("Index"); } else { ViewBag.PossibleSalesProductServiceCategories = salesproductservicecategoryRepository.All; return View(salesproductservicecatelog); } }
public void InsertOrUpdate(SalesProductServiceCatelog salesproductservicecatelog) { if (salesproductservicecatelog.SalesProductServiceCatelogID == default(int)) { // New entity context.SalesProductServiceCatelog.Add(salesproductservicecatelog); } else { // Existing entity context.Entry(salesproductservicecatelog).State = EntityState.Modified; } }
public ActionResult Create() { SalesProductServiceCatelog salesproductservicecatelog = new SalesProductServiceCatelog(); ViewBag.PossibleSalesProductServiceCategories = salesproductservicecategoryRepository.All; return View(salesproductservicecatelog); }
public ViewResult Search(SalesProductServiceCatelog searchSalesProductServiceCatelog) { if(searchSalesProductServiceCatelog!=null) { } return View("Index",salesproductservicecatelogRepository.AllIncluding(salesproductservicecatelog => salesproductservicecatelog.SalesProductServiceCategory)); }