public ActionResult Create(VendorReference vendorreference,int vendorId) { if (ModelState.IsValid) { vendorreferenceRepository.InsertOrUpdate(vendorreference); vendorreferenceRepository.Save(); return RedirectToAction("Index",new { vendorId=vendorId }); } else { return View(vendorreference); } }
public ViewResult Search(VendorReference searchVendorReference,int vendorId) { if(searchVendorReference!=null) { } return View("Index",vendorreferenceRepository.AllIncluding(vendorId,vendorreference => vendorreference.Vendor)); }
public ActionResult Create(int vendorId) { VendorReference vendorreference = new VendorReference(); vendorreference.VendorID = vendorId; return View(vendorreference); }
public void InsertOrUpdate(VendorReference vendorreference) { if (vendorreference.VendorReferenceID == default(int)) { // New entity context.VendorReference.Add(vendorreference); } else { // Existing entity context.Entry(vendorreference).State = EntityState.Modified; } }