public ActionResult Create(Software software) { if (ModelState.IsValid) { db.Softwares.Add(software); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.VendorID = new SelectList(db.Vendors, "VendorID", "VendorName", software.VendorID); ViewBag.SoftwareLicenseID = new SelectList(db.SoftwareLicenses, "SoftwareLicenseID", "SoftwareLicenseID", software.SoftwareLicenseID); return View(software); }
public ActionResult Edit(Software software) { if (ModelState.IsValid) { db.Entry(software).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.VendorID = new SelectList(db.Vendors, "VendorID", "VendorName", software.VendorID); ViewBag.SoftwareLicenseID = new SelectList(db.SoftwareLicenses, "SoftwareLicenseID", "SoftwareLicenseID", software.SoftwareLicenseID); return View(software); }