Ejemplo n.º 1
0
        public ActionResult Create(Model.SubtMedicineDetail model)
        {
            bool result = false;

            //model.ID = 1;
            HTNResp.BLL.Program  bllProgram  = new BLL.Program();
            HTNResp.BLL.EvalGuid bllEvalGuid = new BLL.EvalGuid();
            if (!String.IsNullOrEmpty(model.Name))
            {
                HTNResp.BLL.SubtMedicineDetail bll = new HTNResp.BLL.SubtMedicineDetail();
                HTNResp.BLL.PermissionTable    per = new BLL.PermissionTable();
                var state = bll.Add(model);

                if (state != 0)
                {
                    result = true;
                }
            }
            if (result)
            {
                return(this.Json(new { result = 1, data = "" }));
            }
            else
            {
                return(this.Json(new { result = 0, msg = "新建失败" }));
            }
        }
Ejemplo n.º 2
0
        public override ActionResult Info(int id)
        {
            bool result = false;

            Model.SubtMedicineDetail model = bll.GetModel(id);
            if (model != null)
            {
                result = true;
            }
            if (result)
            {
                return(this.Json(new { result = 1, data = model }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(this.Json(new { result = 0, msg = "请求条目不存在" }));
            }
        }
Ejemplo n.º 3
0
        public ActionResult Update(Model.SubtMedicineDetail model)
        {
            bool result = false;

            HTNResp.BLL.Program         bllProgram = new BLL.Program();
            HTNResp.BLL.PermissionTable per        = new BLL.PermissionTable();
            if (!String.IsNullOrEmpty(model.Name))
            {
                result = bll.Update(model);
                if (result)
                {
                    result = true;
                }
            }
            if (result)
            {
                return(this.Json(new { result = 1, data = "" }));
            }
            else
            {
                return(this.Json(new { result = 0, msg = "修改失败" }));
            }
        }