Пример #1
0
 public ActionResult TraineeForm(Trainee model)
 {
     if (ModelState.IsValid)
     {
         return RedirectToAction("Statistics");
     }
     return View();
 }
Пример #2
0
        public ActionResult Create(Trainee trainee)
        {
            if (ModelState.IsValid)
            {
                db.Trainees.Add(trainee);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(trainee);
        }
Пример #3
0
 public ActionResult Edit(Trainee trainee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(trainee).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(trainee);
 }