public ActionResult Create() { DeletionRequestCreateDto drViewModel = new DeletionRequestCreateDto(); //ViewBag.Nationalities = new SelectList(GetNationalities(), "Value", "Text"); //ViewBag.DeletionReasons = new SelectList(DeletionReasonService.Instance.GetReasons(null), "Id", "Title"); return(View(drViewModel)); }
public ActionResult Create(DeletionRequestCreateDto model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } if (ModelState.IsValid) { DeletionRequestService.Instance.CreateDeletionRequest(model); //ViewBag.DeletionReasons = new SelectList(DeletionReasonService.Instance.GetReasons(null), "Id", "Title"); return(RedirectToAction("Index")); } else { //ViewBag.Nationalities = new SelectList(GetNationalities(), "Value", "Text"); return(View(model)); } }
public void CreateDeletionRequest(DeletionRequestCreateDto model) { drRepository.Add(model.ToDeletionRequest()); drRepository.Save(); }