Ejemplo n.º 1
0
 public ActionResult Create(OperationViewModel viewModel)
 {
     var request = viewModel.MapTo<SaveOperationRequest>();
     var response = _operationConfigService.SaveOperation(request);
     TempData["IsSuccess"] = response.IsSuccess;
     TempData["Message"] = response.Message;
     if (response.IsSuccess)
     {
         return RedirectToAction("Index");
     }
     return View("Create", viewModel);
 }
Ejemplo n.º 2
0
 public ActionResult Create()
 {
     var viewModel = new OperationViewModel();
     viewModel.KeyOperationGroups = _operationConfigService.GetOperationGroups().OperationGroups
                                                           .Select(
                                                               x =>
                                                               new SelectListItem
                                                                   {
                                                                       Value = x.Id.ToString(),
                                                                       Text = x.Name
                                                                   }).ToList();
     viewModel.Kpis.Insert(0, new OperationViewModel.Kpi());
     viewModel.IsActive = true;
     return View(viewModel);
 }