Example #1
0
        public ActionResult Update(UpdateConversionViewModel viewModel)
        {
            var request = viewModel.MapTo<UpdateConversionRequest>();
            var response = _conversionService.Update(request);
            TempData["IsSuccess"] = response.IsSuccess;
            TempData["Message"] = response.Message;
            if (response.IsSuccess)
            {
                return RedirectToAction("Index");
            }

            return View("Update", viewModel);
        }
Example #2
0
        public UpdateConversionViewModel UpdateViewModel(UpdateConversionViewModel viewModel)
        {
            viewModel.MeasurementList = _measurementService.GetMeasurements(
                new Services.Requests.Measurement.GetMeasurementsRequest {
                    Take = -1,
                    SortingDictionary = new Dictionary<string, SortOrder> { { "Name", SortOrder.Ascending } }
                }).Measurements.Select(x => new SelectListItem
                {
                    Text = x.Name,
                    Value = x.Id.ToString()
                }).ToList();

            return viewModel;
        }
Example #3
0
        public UpdateConversionViewModel UpdateViewModel(UpdateConversionViewModel viewModel)
        {
            viewModel.MeasurementList = _measurementService.GetMeasurements(
                new Services.Requests.Measurement.GetMeasurementsRequest { Skip = 0, Take = 0 }).Measurements.Select(x => new SelectListItem
                {
                    Text = x.Name,
                    Value = x.Id.ToString()
                }).ToList();

            return viewModel;
        }