Пример #1
0
        public ActionResult Create(CrbCheck crbcheck)
        {
            if (ModelState.IsValid)
            {
                db.CrbChecks.Add(crbcheck);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.VolunteerId = new SelectList(db.Volunteers, "VolunteerId", "FirstName", crbcheck.VolunteerId);
            return View(crbcheck);
        }
Пример #2
0
 public ActionResult Edit(CrbCheck crbcheck)
 {
     if (ModelState.IsValid)
     {
         db.Entry(crbcheck).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.VolunteerId = new SelectList(db.Volunteers, "VolunteerId", "FirstName", crbcheck.VolunteerId);
     return View(crbcheck);
 }