Beispiel #1
0
 public ActionResult Create(OperationalDataViewModel viewModel)
 {
     var request = viewModel.MapTo<SaveOperationalDataRequest>();
     var response = _operationDataService.SaveOperationalData(request);
     TempData["IsSuccess"] = response.IsSuccess;
     TempData["Message"] = response.Message;
     if (response.IsSuccess)
     {
         return RedirectToAction("Index");
     }
     return View("Create", viewModel);
 }
Beispiel #2
0
        public ActionResult Create()
        {
            var viewModel = new OperationalDataViewModel();
            var selectList = _operationDataService.GetOperationalSelectList();
            viewModel.KeyOperations = selectList.Operations.Select
                (x => new SelectListItem { Value = x.Id.ToString(), Text = x.Name }).ToList();

            viewModel.KPIS = selectList.KPIS.Select
                (x => new SelectListItem { Value = x.Id.ToString(), Text = x.Name }).ToList();

            return View(viewModel);
        }