Esempio n. 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);
        }
Esempio n. 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);
 }