예제 #1
0
        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));
        }
예제 #2
0
        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));
            }
        }
예제 #3
0
 public void CreateDeletionRequest(DeletionRequestCreateDto model)
 {
     drRepository.Add(model.ToDeletionRequest());
     drRepository.Save();
 }