public ActionResult Create(VendorAddressCategory vendoraddresscategory) { if (ModelState.IsValid) { vendoraddresscategoryRepository.InsertOrUpdate(vendoraddresscategory); vendoraddresscategoryRepository.Save(); return RedirectToAction("Index"); } else { return View(vendoraddresscategory); } }
public void InsertOrUpdate(VendorAddressCategory vendoraddresscategory) { if (vendoraddresscategory.VendorAddressCategoryID == default(int)) { // New entity context.VendorAddressCategory.Add(vendoraddresscategory); } else { // Existing entity context.Entry(vendoraddresscategory).State = EntityState.Modified; } }
public ActionResult Create() { VendorAddressCategory vendoraddresscategory = new VendorAddressCategory(); return View(vendoraddresscategory); }
public ViewResult Search(VendorAddressCategory searchVendorAddressCategory) { if(searchVendorAddressCategory!=null) { } return View("Index",vendoraddresscategoryRepository.All); }