Пример #1
0
        public ActionResult Create(CreateMeasurementViewModel viewModel)
        {
            var request = viewModel.MapTo<CreateMeasurementRequest>();
            var response = _measurementService.Create(request);
            TempData["IsSuccess"] = response.IsSuccess;
            TempData["Message"] = response.Message;
            if (response.IsSuccess)
            {
                return RedirectToAction("Index");
            }

            return View("Create", viewModel);
        }
Пример #2
0
 public ActionResult Create()
 {
     var viewModel = new CreateMeasurementViewModel();
     viewModel.IsActive = true;
     return View(viewModel);
 }