예제 #1
0
        public ActionResult Create(ServerSoftware serversoftware)
        {
            if (ModelState.IsValid)
            {
                db.ServerSoftwares.Add(serversoftware);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.ServerID = new SelectList(db.Servers, "ServerID", "ServerName", serversoftware.ServerID);
            ViewBag.SoftwareID = new SelectList(db.Softwares, "SoftwareID", "SotwareName", serversoftware.SoftwareID);
            return View(serversoftware);
        }
예제 #2
0
 public ActionResult Edit(ServerSoftware serversoftware)
 {
     if (ModelState.IsValid)
     {
         db.Entry(serversoftware).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.ServerID = new SelectList(db.Servers, "ServerID", "ServerName", serversoftware.ServerID);
     ViewBag.SoftwareID = new SelectList(db.Softwares, "SoftwareID", "SotwareName", serversoftware.SoftwareID);
     return View(serversoftware);
 }