public ActionResult Create(Vendors vendors) { if (ModelState.IsValid) { db.Vendors.Add(vendors); db.SaveChanges(); return RedirectToAction("Index"); } return View(vendors); }
public ActionResult Edit(Vendors vendors) { if (ModelState.IsValid) { db.Entry(vendors).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(vendors); }
// // GET: /Vendors/Create01 public ActionResult Create01() { int nCustomerId = 0; Vendors vendor = new Vendors(); vendor.BussinesSice = DateTime.Now; vendor.VendorNo = GetNextVendorNo(); vendor.Status = false; db.Vendors.Add(vendor); db.SaveChanges(); nCustomerId = vendor.Id; TempData["AddCustomer"] = "AddCustomer"; return RedirectToAction("Edit", new { id = nCustomerId }); }
// // GET: /Vendors/Create public PartialViewResult Create() { Vendors vendors = new Vendors(); vendors.BussinesSice = DateTime.Now; vendors.VendorNo = "0"; return PartialView(vendors); }