예제 #1
0
        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);
        }
예제 #2
0
 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);
 }