public ActionResult Create(ProjectSoftware projectsoftware) { if (ModelState.IsValid) { db.ProjectSoftwares.Add(projectsoftware); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.SoftwareID = new SelectList(db.Softwares, "SoftwareID", "SoftwareName", projectsoftware.SoftwareID); ViewBag.ProjectId = new SelectList(db.Projects, "ProjectID", "ProjectName", projectsoftware.ProjectId); return View(projectsoftware); }
public ActionResult Edit(ProjectSoftware projectsoftware) { if (ModelState.IsValid) { db.Entry(projectsoftware).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.SoftwareID = new SelectList(db.Softwares, "SoftwareID", "SoftwareName", projectsoftware.SoftwareID); ViewBag.ProjectId = new SelectList(db.Projects, "ProjectID", "ProjectName", projectsoftware.ProjectId); return View(projectsoftware); }