Exemplo n.º 1
0
        public IActionResult Add()
        {
            var formulaDal = new FormulaDal();
            var model      = new ZkGetOrderAddModel()
            {
                FormulaList = formulaDal.Query(),
            };

            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult Add(ZkGetOrderAddModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new { state = "error", data = "提交信息验证失败" }));
            }

            try
            {
                var dal = new ZkGetOrderDal();
                var p   = mapper.Map <ZkGetOrderDefinition>(model);
                p.FormulaCode = "";
                p.IsPublic    = false;
                dal.Add(p);
                return(Json(new { state = "ok", data = 1 }));
            }
            catch (Exception ex)
            {
                return(Json(new { state = "error", data = ex.Message }));
            }
        }