public bool addItem(Vendor_Detail newVendor) { using (objVendor) { objVendor.Vendor_Details.InsertOnSubmit(newVendor); objVendor.SubmitChanges(); return true; } }
public ActionResult Create(Vendor_Detail newVendor, FormCollection collection) { try { // TODO: Add insert logic here newVendor.vendor_address = collection["vendor_address"]; vendorObj.addItem(newVendor); return RedirectToAction("Create"); } catch { return View(); } }