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 = "新建失败" })); } }
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 = "请求条目不存在" })); } }
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 = "修改失败" })); } }