Esempio n. 1
0
 public ActionResult Create(AssumptionConfigViewModel viewModel)
 {
     var request = viewModel.MapTo<SaveAssumptionConfigRequest>();
     var response = _assumptionConfigService.SaveAssumptionConfig(request);
     TempData["IsSuccess"] = response.IsSuccess;
     TempData["Message"] = response.Message;
     if (response.IsSuccess)
     {
         return RedirectToAction("Index");
     }
     return View("Create", viewModel);
 }
Esempio n. 2
0
        public ActionResult Create()
        {
            var viewModel = new AssumptionConfigViewModel();
            var Selectlist = _assumptionConfigService.GetAssumptionConfigCategories();

            viewModel.Measurements = Selectlist.MeasurementsSelectList.Select
                (x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList();
            viewModel.Measurements.Insert(0, new SelectListItem { Value = "0", Text = "No Measurement" });
            viewModel.Categories = Selectlist.AssumptionConfigCategoriesResponse.Select
                (x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList();
            viewModel.IsActive = true;

            return View(viewModel);
        }