Beispiel #1
0
        public ActionResult DetailCreate(Model.SubMedicineProject model)
        {
            string pId = (string)Session["pid"];
            int    pid = Convert.ToInt32(pId);

            model.ProjectId = pid;
            bllSubMedicine.Add(model);
            string sqlString = " ProjectId=" + pid;
            //select * from SubMedicineProject where ProjectId=projectId;
            //get detail
            List <Model.SubMedicineProject> subMedicineList = bllSubMedicine.GetModelList(sqlString);

            string content = "";

            foreach (Model.SubMedicineProject t in subMedicineList)
            {
                content += t.CommonName + t.Dose + "," + t.Usage + " ";
            }
            content = content.Trim().Replace(' ', '+');

            //get project
            Model.MedicineProject usingProjectModel = bllMedicine.GetModel(pid);
            usingProjectModel.ProjectContent = content;
            bllMedicine.Update(usingProjectModel);
            return(this.Json(new { result = 1, data = "" }));
        }
Beispiel #2
0
        public ActionResult DetailDelete(int id)
        {
            Model.SubMedicineProject temp = bllSubMedicine.GetModel(id);
            bool r = bllSubMedicine.Delete(id);

            string pId       = temp.ProjectId.Value.ToString();
            string sqlString = " ProjectId=" + pId;


            List <Model.SubMedicineProject> subMedicineList = bllSubMedicine.GetModelList(sqlString);

            string content = "";

            foreach (Model.SubMedicineProject t in subMedicineList)
            {
                content += t.CommonName + t.Dose + "," + t.Usage + " ";
            }
            content = content.Trim().Replace(' ', '+');
            //get project
            Model.MedicineProject usingProjectModel = bllMedicine.GetModel(Convert.ToInt32(pId));
            usingProjectModel.ProjectContent = content;
            bllMedicine.Update(usingProjectModel);

            return(this.Json(new { result = r?1:0, data = "" }));
        }
Beispiel #3
0
        public ActionResult ProjectCreate(Model.MedicineProject model)
        {
            bool result = false;

            if (model.ProjectContent == null)
            {
                model.ProjectContent = "暂未填写";
            }
            if (new BLL.EvalGuid().Exists(model.EvalGuidId.Value))
            {
                bllMedicine.Add(model);
                result = true;
            }

            return(this.Json(new { result = result?1:0, data = "" }));
        }
Beispiel #4
0
        public ActionResult DetailEdit(int id, int status, Model.SubMedicineProject model)
        {
            int i = id;

            if (status == 1)
            {
                Model.SubMedicineProject m = bllSubMedicine.GetModel(id);
                if (m == null)
                {
                    return(this.Json(new { result = 0, data = "" }));
                }
                else
                {
                    return(this.Json(new { result = 1, data = m }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                bool r = bllSubMedicine.Update(model);
                int  projectId;
                if (model.ProjectId.HasValue)
                {
                    projectId = model.ProjectId.Value;
                    string sqlString = " ProjectId=" + projectId;
                    //select * from SubMedicineProject where ProjectId=projectId;
                    //get detail
                    List <Model.SubMedicineProject> subMedicineList = bllSubMedicine.GetModelList(sqlString);

                    string content = "";
                    foreach (Model.SubMedicineProject t in subMedicineList)
                    {
                        content += t.CommonName + t.Dose + "," + t.Usage + " ";
                    }
                    content = content.Trim().Replace(' ', '+');
                    //get project
                    Model.MedicineProject usingProjectModel = bllMedicine.GetModel(projectId);
                    usingProjectModel.ProjectContent = content;
                    bllMedicine.Update(usingProjectModel);
                }

                return(this.Json(new { result = r?1:0, data = "" }));
            }
        }
Beispiel #5
0
        public ActionResult ProjectEdit(int id, int status, Model.MedicineProject model)
        {
            if (status == 1)
            {
                Model.MedicineProject m = bllMedicine.GetModel(id);
                if (m == null)
                {
                    return(this.Json(new { result = 0, data = "" }));
                }
                else
                {
                    return(this.Json(new { result = 1, data = m }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                bool r = bllMedicine.Update(model);

                return(this.Json(new { result = r?1:0, data = "" }));
            }
        }