public override ActionResult Index()
        {
            BLL.EvalGuid          blLEvalGrid = new BLL.EvalGuid();
            List <Model.EvalGuid> evalGridId  = blLEvalGrid.GetModelList("");

            ViewBag.EvalGridId = evalGridId;
            return(View());
        }
示例#2
0
        //获取方案分页
        public override ActionResult ProjectDetail()
        {
            int start  = 0; // 分页起始条目数
            int length = 0; // 分页每页分页数

            string sqlString = "";
            string level     = Request.Params["level"];
            string category  = Request.Params["category"];
            string search    = Request.Params["search"];

            sqlString += String.IsNullOrEmpty(level) ? "1 = 1" : ("BPLevel='" + level + "'");
            sqlString += " AND ";
            sqlString += String.IsNullOrEmpty(category) ? "1 = 1" : ("ProjectCode=" + category + "");
            sqlString += " AND ";
            sqlString += String.IsNullOrEmpty(search) ? "1 = 1" : ("ProjectContent Like ('%" + search + "%')");

            start  = Convert.ToInt32(Request.Params["start"]);
            length = Convert.ToInt32(Request.Params["length"]);

            List <HTNResp.Model.MedicineProject> list = bllMedicine.DataTableToList(bllMedicine.GetListByPage(sqlString, " ", start + 1, start + length).Tables[0]);

            int filterTotal = bllMedicine.GetRecordCount(sqlString);
            int total       = bllMedicine.GetRecordCount("");

            BLL.EvalGuid          bllEvalGrid  = new BLL.EvalGuid();
            List <Model.EvalGuid> evalGridList = bllEvalGrid.GetModelList("");

            Dictionary <int, string> evalDic = new Dictionary <int, string>();

            foreach (Model.EvalGuid evalGrid in evalGridList)
            {
                evalDic.Add(evalGrid.ID, evalGrid.GuidName);
            }

            return(this.Json(new
            {
                result = 1,
                data = new
                {
                    draw = Request.Params["draw"],
                    recordsTotal = total,
                    recordsFiltered = filterTotal,
                    data = list.Select(o => new
                    {
                        ID = o.ID,
                        BPLevel = o.BPLevel,
                        ProjectContent = o.ProjectContent,
                        ProjectCode = "类型" + o.ProjectCode,
                        EvalGuidId = evalDic[o.EvalGuidId.Value]
                    })
                }
            }));
        }
        public override ActionResult AjaxList()
        {
            int start  = 0; // 分页起始条目数
            int length = 0; // 分页每页分页数

            start  = Convert.ToInt32(Request.Params["start"]);
            length = Convert.ToInt32(Request.Params["length"]);

            // todo: 读取数据库 获取分页数据
            string strSql = "Status=1";

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            if (!string.IsNullOrEmpty(Request.Params["DecisionRule"]))
            {
                sb.Append(" and DecisionRule like '%" + Request.Params["DecisionRule"] + "%' ");
            }
            if (!string.IsNullOrEmpty(Request.Params["Contents"]))
            {
                sb.Append(" and Contents like '%" + Request.Params["Contents"] + "%' ");
            }
            if (!string.IsNullOrEmpty(Request.Params["Sex"]))
            {
                sb.Append(" and Sex='" + Request.Params["Sex"] + "' ");
            }
            if (!string.IsNullOrEmpty(Request.Params["EvalGuidId"]))
            {
                sb.Append(" and EvalGuidId='" + Request.Params["EvalGuidId"] + "'");
            }

            strSql += sb.ToString();

            List <HTNResp.Model.AdaptSymptom> list = bll.DataTableToList(bll.GetListByPage(strSql, "", start + 1, start + length).Tables[0]);
            int filterTotal = bll.GetRecordCount(strSql);
            int total       = bll.GetRecordCount("Status=1");

            BLL.EvalGuid          bllEvalGrid  = new BLL.EvalGuid();
            List <Model.EvalGuid> evalGridList = bllEvalGrid.GetModelList("");

            Dictionary <int, string> evalDic = new Dictionary <int, string>();

            foreach (Model.EvalGuid evalGrid in evalGridList)
            {
                evalDic.Add(evalGrid.ID, evalGrid.GuidName);
            }
            return(this.Json(new
            {
                result = 1,
                data = new
                {
                    draw = Request.Params["draw"],
                    recordsTotal = total,
                    recordsFiltered = filterTotal,
                    data = list.Select(o => new
                    {
                        ID = o.ID,
                        DecisionRule = o.DecisionRule,
                        Contents = o.Contents,
                        EvalGuidId = evalDic[o.EvalGuidId.Value]
                    })
                }
            }));
        }