예제 #1
0
 public ActionResult Edit(Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.JobId = new SelectList(db.Jobs, "Id", "Title", users.JobId);
     return View(users);
 }
예제 #2
0
        public ActionResult Create(Users users)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(users);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.JobId = new SelectList(db.Jobs, "Id", "Title", users.JobId);
            return View(users);
        }