예제 #1
0
 public ActionResult Edit([Bind(Include = "id,Name,Company_Size,Legal_Form")] Companies companies)
 {
     if (ModelState.IsValid)
     {
         db.Entry(companies).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(companies));
 }
 public ActionResult Edit([Bind(Include = "id,First_Name,Surname,Patronymic,Employment_Date,Position,Company")] Workers workers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Company = new SelectList(db.Companies, "id", "Name", workers.Company);
     return(View(workers));
 }