Example #1
0
        public IActionResult Update(string zkGetOrderId)
        {
            var dal        = new ZkGetOrderDal();
            var formulaDal = new FormulaDal();
            var p          = dal.Find(zkGetOrderId);
            var model      = mapper.Map <ZkGetOrderUpdateModel>(p);

            model.FormulaList = formulaDal.Query();
            return(View(model));
        }
Example #2
0
        public IActionResult Update(ZkGetOrderUpdateModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new { state = "error", data = "提交信息验证失败" }));
            }

            try
            {
                var dal = new ZkGetOrderDal();
                var p   = dal.Find(model.ZkGetOrderId);
                mapper.Map(model, p);
                dal.Update(p);
                return(Json(new { state = "ok", data = 1 }));
            }
            catch (Exception ex)
            {
                return(Json(new { state = "error", data = ex.Message }));
            }
        }