public ActionResult CreateESCategory(SaveESCategoryViewModel viewModel) { var request = viewModel.MapTo<SaveESCategoryRequest>(); var response = _planningBlueprintService.SaveESCategory(request); TempData["IsSuccess"] = response.IsSuccess; TempData["Message"] = response.Message; return RedirectToAction("ESCategory"); }
public ActionResult CreateESCategory() { var viewModel = new SaveESCategoryViewModel(); viewModel.Types = Enum.GetValues(typeof(EnvirontmentType)).Cast<EnvirontmentType>() .Select(x => new SelectListItem { Text = x.ToString(), Value = ((int)x).ToString() }).ToList(); return View(viewModel); }