public ViewResult Transfert(TransfertNewRequestModel model, FormCollection formCollection) { try { if (ModelState.IsValid) { Request request = model; //TO DO : Email guestResponse to ther part organizer var selected = model; WebMailHelper.SendEmailCreation(request); SaveToDb(selected); return View("Confirmation", request); } else { //there is a validation error - redisplay the form return View(model); } } catch (DbEntityValidationException ex) { AddModelError(ex); return View(model); } }
public ActionResult Transfert() { ViewBag.DepartmentList = listDepartment(); ViewBag.Message = "Nouvelle demande"; var model = new TransfertNewRequestModel { kind = RequestKindEnum.Transfert, StartDate = DateTime.Now.AddDays(15) }; return View(model); }