示例#1
0
        public ActionResult Update(Model.EvaluationContent model)
        {
            bool result = false;

            HTNResp.BLL.EvalGuid bllEvalGuid = new BLL.EvalGuid();
            if (model.EvalGuidId.Value != null && bllEvalGuid.Exists(model.EvalGuidId.Value))
            {
                HTNResp.BLL.Program bllProgram = new BLL.Program();
                if (!String.IsNullOrEmpty(model.DecisionRule) && String.IsNullOrEmpty(bllProgram.testContent(model.DecisionRule)))
                {
                    result = bll.Update(model);
                }
            }
            if (result)
            {
                return(this.Json(new { result = 1, data = "" }));
            }
            else
            {
                return(this.Json(new { result = 0, msg = "修改失败" }));
            }
        }
        public ActionResult Create(Model.PrevensionProject model)
        {
            bool result = false;

            model.Status = 1;
            HTNResp.BLL.Program  bllProgram  = new BLL.Program();
            HTNResp.BLL.EvalGuid bllEvalGuid = new BLL.EvalGuid();
            if (!String.IsNullOrEmpty(model.DecisionRule) && String.IsNullOrEmpty(bllProgram.testContent(model.DecisionRule)) && model.EvalGuidId.Value != null && bllEvalGuid.Exists(model.EvalGuidId.Value))
            {
                if (bll.Add(model) != 0)
                {
                    result = true;
                }
            }
            if (result)
            {
                return(this.Json(new { result = 1, data = "" }));
            }
            else
            {
                return(this.Json(new { result = 0, msg = "新建失败" }));
            }
        }