Ejemplo n.º 1
0
        public ActionResult Edit(CalculatorConstantViewModel viewModel)
        {
            if (Request.IsAjaxRequest())
            {
                var req = new SaveCalculatorConstantRequest();
                req.Id = viewModel.Id;
                req.Value = viewModel.Value;
                req.IsAjaxRequest = true;
                var response = _calculatorConstantService.SaveCalculatorConstant(req);
                return Json(response);

            }
            else
            {
                var req = viewModel.MapTo<SaveCalculatorConstantRequest>();
                _calculatorConstantService.SaveCalculatorConstant(req);
                return RedirectToAction("Index");
            }
        }
Ejemplo n.º 2
0
 public ActionResult Create(CalculatorConstantViewModel viewModel)
 {
     var req = viewModel.MapTo<SaveCalculatorConstantRequest>();
     _calculatorConstantService.SaveCalculatorConstant(req);
     return RedirectToAction("Index");
 }