Exemplo n.º 1
0
        public DataTable ListBind(System.Web.HttpRequest Request, string dwbm, string gh, string zzzt, string strWhere, ref int count)
        {
            string page      = Request.Form["page"];
            string rows      = Request.Form["pagesize"];
            string zzztTo    = Request.Form["zzzt"];
            string ajmc      = Request.Form["ajmc"];
            string ajlb      = Request.Form["ajlb"];
            string lar       = Request.Form["lar"];
            string ajbh      = Request.Form["ajbh"];
            string wsbh      = Request.Form["wsbh"];
            string timebegin = Request.Form["timebegin"];
            string timeend   = Request.Form["timeend"];

            //扫描人和时间
            string smr     = Request.Form["zzr"];
            string smsj_bg = Request.Form["zztimebegin"];
            string smsj_en = Request.Form["zztimeend"];


            //排序
            //string sortname = Request["sortname"];
            //string sortorder = Request["sortorder"];
            //if (string.IsNullOrEmpty(sortname))
            //{
            //    sortname = "CJSJ DESC";
            //    sortorder = "";
            //}
            //if (sortname == "AJ_DWMC" || sortname == "CBDW_MC")
            //    sortname = "CBDW_BM";
            //if (sortname == "SFZZ")
            //    sortname = "ISREGARD";
            string sortname = " CJSJ DESC ";

            int pageNumber = int.Parse(page);
            int pageSize   = int.Parse(rows);

            string where = strWhere;

            List <object> values = new List <object>();

            if (!string.IsNullOrEmpty(ajmc))
            {
                where += " and AJMC like :AJMC";
                values.Add("%" + ajmc + "%");
            }
            if (!string.IsNullOrEmpty(lar))
            {
                where += " and CBR like :CBR";
                values.Add("%" + lar + "%");
            }
            if (!string.IsNullOrEmpty(ajbh))
            {
                where += " and AJBH like :AJBH";
                values.Add("%" + ajbh + "%");
            }
            if (!string.IsNullOrEmpty(wsbh))
            {
                where += " and WSBH like :WSBH";
                values.Add("%" + wsbh + "%");
            }

            if (!string.IsNullOrEmpty(zzztTo) && zzztTo != "-1")
            {
                where += " and ZZZT = :ZZZT";
                values.Add(zzztTo);
            }
            else if (!string.IsNullOrEmpty(zzzt))
            {
                string   zt    = "";
                string[] zzzts = zzzt.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < zzzts.Length; i++)
                {
                    zt += zzzts[i];
                    if (i < zzzts.Length - 1)
                    {
                        zt += ",";
                    }
                }
                where += " and ZZZT in (" + zt + ")";
                //values.Add(zt);
            }
            if (!string.IsNullOrEmpty(timebegin))
            {
                where += " and SLRQ >= :SLRQ";
                values.Add(Convert.ToDateTime(timebegin));
            }
            if (!string.IsNullOrEmpty(timeend))
            {
                where += " and SLRQ < :SLRQ1";
                values.Add(Convert.ToDateTime(timeend).AddDays(1));
            }

            if (!string.IsNullOrEmpty(smr))
            {
                where += " and JZSCRXM like :JZSCRXM";
                values.Add("%" + smr + "%");
            }
            if (!string.IsNullOrEmpty(smsj_bg))
            {
                where += " and CJSJ >= :CJSJ";
                values.Add(Convert.ToDateTime(smsj_bg));
            }
            if (!string.IsNullOrEmpty(smsj_en))
            {
                where += " and CJSJ <= :CJSJ1";
                values.Add(Convert.ToDateTime(smsj_en).AddDays(1));
            }


            //if (!string.IsNullOrEmpty(base.UserInfo.DWBM))
            //{
            //    where += " and CBDW_BM = :CBDWBM";
            //    values[6] = base.UserInfo.DWBM;
            //}
            where += " and SFSC='N'";

            where += " and trim(CBDW_BM) in(select distinct trim(QXBM) from xt_dm_qx a join XT_QX_RYJSFP b on trim(a.jsbm) = b.jsbm and trim(a.bmbm)=b.bmbm and trim(a.dwbm)=b.dwbm and gh=:GH1 and b.dwbm=:DWBM1 and a.qxlx=0)";
            values.Add(gh);
            values.Add(dwbm);

            // StringBuilder strWhere = new StringBuilder();
            if (string.IsNullOrEmpty(ajlb))
            {
                where += "  and trim(AJLB_BM) in ( select distinct trim(QXBM) from xt_dm_qx a join XT_QX_RYJSFP b on trim(a.jsbm) = b.jsbm and trim(a.bmbm)=b.bmbm and trim(a.dwbm)=b.dwbm and gh=:GH2 and b.dwbm=:DWBM2 and a.qxlx=1) ";
                values.Add(gh);
                values.Add(dwbm);
            }
            else
            {
                where += " and trim(AJLB_BM) in (:AJLB_BM ) ";
                string[] ajlbs     = ajlb.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                string   ajlbsParm = "";
                for (int i = 0; i < ajlbs.Length; i++)
                {
                    ajlbsParm += ajlbs[i];
                    if (i < ajlbs.Length - 1)
                    {
                        ajlbsParm += ",";
                    }
                }
                values.Add(ajlbsParm);
            }

            TYYW_GG_AJJBXX bll = new TYYW_GG_AJJBXX(Request);

            DataSet ds = bll.GetListByPageUnite(where, sortname, (pageSize * pageNumber) - pageSize + 1, (pageSize * pageNumber), values.ToArray());

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                count = bll.GetRecordCountUnite(where, values.ToArray());
                return(dt);
                //OperateLog.AddLog(OperateLog.LogType.案件卷宗制作Web, "案件数据查询", UserInfo, UserRole, this.Request);
                //return "{\"Total\":" + count + ",\"Rows\":" + JsonHelper.JsonString(dt) + "}";
            }
            return(null);
            //OperateLog.AddLog(OperateLog.LogType.案件卷宗制作Web, "案件数据查询未找到案件", UserInfo, UserRole, this.Request);
            //return ReturnString.JsonToString(Prompt.error, "未找到案件信息", null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取本地案件基本信息
        /// </summary>
        /// <param name="Request"></param>
        /// <param name="dwbm"></param>
        /// <param name="gh"></param>
        /// <returns></returns>
        public DataTable ListBind(System.Web.HttpRequest Request, string dwbm, string gh, string qxzt, string bmbm, string no, ref int count)
        {
            string page      = Request["page"];
            string rows      = Request["pagesize"];
            string key       = Request["key"];
            string wsbh      = Request["wsbh"];
            string casename  = Request["casename"];
            string dutyman   = Request["dutyman"];
            string relevance = Request["relevance"];
            string timebegin = Request["timebegin"];
            string timeend   = Request["timeend"];
            //单位编码和案件类别
            string caseUnit = Request["caseUnit"];
            string caseAjlb = Request["caseajlb"];
            //排序
            string sortname  = Request["sortname"];
            string sortorder = Request["sortorder"];

            string smr     = Request.Form["smr"];
            string smsj_bg = Request.Form["smsj_bg"];
            string smsj_en = Request.Form["smsj_en"];
            string xyr     = Request.Form["xyr"];

            if (string.IsNullOrEmpty(sortname))
            {
                sortname  = "GGCJSJ DESC";
                sortorder = "";
            }
            if (sortname == "AJ_DWMC" || sortname == "CBDW_MC")
            {
                sortname = "CBDW_BM";
            }
            if (sortname == "SFZZ")
            {
                sortname = "ISREGARD";
            }
            sortname += " " + sortorder;

            int pageNumber = int.Parse(page);
            int pageSize   = int.Parse(rows);

            string where = string.Empty;

            List <object> values = new List <object>();

            if (!string.IsNullOrEmpty(key))
            {
                where += " and AJBH like :AJBH";
                values.Add("%" + key + "%");
            }
            if (!string.IsNullOrEmpty(wsbh))
            {
                where += " and WSBH like :WSBH";
                values.Add("%" + wsbh + "%");
            }
            if (!string.IsNullOrEmpty(casename))
            {
                where += " and AJMC like :AJMC";
                values.Add("%" + casename + "%");
            }
            if (!string.IsNullOrEmpty(dutyman))
            {
                where += " and CBR like :CBR";
                values.Add("%" + dutyman + "%");
            }
            if (!string.IsNullOrEmpty(relevance) && relevance != "-2")
            {
                where += " and ZZZT in (" + relevance + ")";
                //values.Add(relevance);
            }
            if (!string.IsNullOrEmpty(timebegin))
            {
                where += " and SLRQ >= :SLRQ";
                values.Add(Convert.ToDateTime(timebegin));
            }
            if (!string.IsNullOrEmpty(timeend))
            {
                where += " and SLRQ <= :SLRQ1";
                values.Add(Convert.ToDateTime(timeend).AddDays(1));
            }

            if (!string.IsNullOrEmpty(smr))
            {
                where += " and JZSCRXM like :JZSCRXM";
                values.Add("%" + smr + "%");
            }
            if (!string.IsNullOrEmpty(smsj_bg))
            {
                where += " and CJSJ >= :CJSJ";
                values.Add(Convert.ToDateTime(smsj_bg));
            }
            if (!string.IsNullOrEmpty(smsj_en))
            {
                where += " and CJSJ <= :CJSJ1";
                values.Add(Convert.ToDateTime(smsj_en).AddDays(1));
            }
            if (!string.IsNullOrEmpty(xyr))
            {
                where += " and XYR like :XYR";
                values.Add("%" + xyr + "%");
            }
            //if (!string.IsNullOrEmpty(base.UserInfo.DWBM))
            //{
            //    where += " and CBDW_BM = :CBDWBM";
            //    values[6] = base.UserInfo.DWBM;
            //}
            where += " and SFSC='N'";
            if (string.IsNullOrEmpty(caseUnit))
            {
                where += " and trim(CBDW_BM) in(select distinct trim(QXBM) from xt_dm_qx a join XT_QX_RYJSFP b on trim(a.jsbm) = b.jsbm and trim(a.bmbm)=b.bmbm and trim(a.dwbm)=b.dwbm and gh=:GH1 and b.dwbm=:DWBM1 and a.qxlx=0)";
                values.Add(gh);
                values.Add(dwbm);
            }
            else
            {
                string[] dwbms    = caseUnit.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                string   dwbmParm = "";
                for (int i = 0; i < dwbms.Length; i++)
                {
                    dwbmParm += "'" + dwbms[i] + "'";
                    if (i < dwbms.Length - 1)
                    {
                        dwbmParm += ",";
                    }
                }
                where += " and trim(CBDW_BM) in (" + dwbmParm + ") ";
                //  values.Add(dwbmParm);
            }
            // StringBuilder strWhere = new StringBuilder();
            if (string.IsNullOrEmpty(caseAjlb))
            {
                where += "  and trim(AJLB_BM) in ( select distinct trim(QXBM) from xt_dm_qx a join XT_QX_RYJSFP b on trim(a.jsbm) = b.jsbm and trim(a.bmbm)=b.bmbm and trim(a.dwbm)=b.dwbm and gh=:GH2 and b.dwbm=:DWBM2 and a.qxlx=1) ";
                values.Add(gh);
                values.Add(dwbm);
            }
            else
            {
                string[] ajlbs     = caseAjlb.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                string   ajlbsParm = "";
                for (int i = 0; i < ajlbs.Length; i++)
                {
                    ajlbsParm += "'" + ajlbs[i] + "'";
                    if (i < ajlbs.Length - 1)
                    {
                        ajlbsParm += ",";
                    }
                }
                where += " and trim(AJLB_BM) in (" + ajlbsParm + ") ";
                //values.Add(ajlbsParm);
            }

            //根据角色权限状态判断获取数据
            if (!string.IsNullOrEmpty(qxzt))
            {
                if (qxzt == "G")
                {
                    where += " and JZSCRGH='" + gh + "'";
                }
                else if (qxzt == "B")
                {
                    XT_QX_RYJSFP ryjsBll = new XT_QX_RYJSFP(Request);
                    DataSet      dsryjs  = ryjsBll.GetListChildrenBmAll(" and BMBM =:BMBM and SFSC='N'", new object[] { bmbm });
                    if (dsryjs != null && dsryjs.Tables.Count > 0 && dsryjs.Tables[0].Rows.Count > 0)
                    {
                        where += " and JZSCRGH in (";
                        int num = 0;
                        foreach (DataRow dr in dsryjs.Tables[0].Rows)
                        {
                            where += "'" + dr["GH"] + "'";
                            if (num < dsryjs.Tables[0].Rows.Count - 1)
                            {
                                where += ",";
                            }
                            num++;
                        }
                        where += ") ";
                    }
                }
            }



            TYYW_GG_AJJBXX bll = new TYYW_GG_AJJBXX(Request);

            DataSet ds = bll.GetListByPageUnite(where, sortname, (pageSize * pageNumber) - pageSize + 1, (pageSize * pageNumber), values.ToArray());

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                count = bll.GetRecordCountUnite(where, values.ToArray());
                return(dt);
                //OperateLog.AddLog(OperateLog.LogType.案件卷宗制作Web, "案件数据查询", UserInfo, UserRole, this.Request);
                //return "{\"Total\":" + count + ",\"Rows\":" + JsonHelper.JsonString(dt) + "}";
            }
            return(null);
            //OperateLog.AddLog(OperateLog.LogType.案件卷宗制作Web, "案件数据查询未找到案件", UserInfo, UserRole, this.Request);
            //return ReturnString.JsonToString(Prompt.error, "未找到案件信息", null);
        }