public ActionResult Create() { var viewModel = new CreatePillarViewModel(); viewModel.Icons = Directory.EnumerateFiles(Server.MapPath(PathConstant.PillarPath)).ToList(); viewModel.IsActive = true; return View(viewModel); }
public ActionResult Create(CreatePillarViewModel viewModel) { var request = viewModel.MapTo<CreatePillarRequest>(); var response = _pillarService.Create(request); TempData["IsSuccess"] = response.IsSuccess; TempData["Message"] = response.Message; if (response.IsSuccess) { return RedirectToAction("Index"); } return View("Create", viewModel); }
public ActionResult Create() { var viewModel = new CreatePillarViewModel(); return View(viewModel); }