Пример #1
0
        public JsonResult Search()
        {
            // SelectWhere.selectwherestring(Request["sqlSet"]);
            int pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            int pageSize  = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            //string Where = Request["sqlSet"] == null ? "1=1" : SelectWhere.selectwherestring(Request["sqlSet"]);
            string Where = Request["sqlSet"] == null ? "1=1" : GetSql(Request["sqlSet"]);

            Where += " and (isDeleted=0)";
            ////字段排序
            String    sortField = Request["sort"];
            String    sortOrder = Request["order"];
            PageClass pc        = new PageClass();

            pc.sys_Fields    = "*";
            pc.sys_Key       = "Id";
            pc.sys_PageIndex = pageIndex;
            pc.sys_PageSize  = pageSize;
            pc.sys_Table     = "v_TS_ShopUserRole";
            pc.sys_Where     = Where;
            pc.sys_Order     = " " + sortField + " " + sortOrder;
            List <v_TS_ShopUserRole> list2 = OPBiz.GetPagingData <v_TS_ShopUserRole>(pc);

            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("rows", list2);
            dic.Add("total", pc.RCount);
            return(MyJson(dic, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult GetList()
        {
            int pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            int pageSize  = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            ////字段排序
            //String sortField = Request["sortField"];
            //String sortOrder = Request["sortOrder"];
            PageClass pc = new PageClass();

            pc.sys_Fields    = "*";
            pc.sys_Key       = "Id";
            pc.sys_PageIndex = pageIndex;
            pc.sys_PageSize  = pageSize;
            pc.sys_Table     = "V_UserRole";
            string DepartmentId = Request["DepartmentId"];

            if (string.IsNullOrEmpty(DepartmentId))
            {
                pc.sys_Where = "1=1";
            }
            else
            {
                pc.sys_Where = "DepartmentId='" + DepartmentId + "'";
            }
            //if (!UserData.UserInfo.RoleId.ToString().Equals("fb38f312-0078-4f44-9cda-1183c8042db8"))//不是系统管理员,限制一个医院
            //{
            //    pc.sys_Where += " and YH_HospitalId='" + UserData.UserInfo.YH_HospitalId + "'";
            //}


            pc.sys_Order = "Id";


            List <V_UserRole>           list2 = OPBiz.GetPagingData <V_UserRole>(pc);
            Dictionary <string, object> dic   = new Dictionary <string, object>();


            // var mql = RMS_UserSet.Id.NotEqual("");
            dic.Add("rows", list2);
            dic.Add("total", pc.RCount);

            return(Json(dic, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Search()
        {
            // SelectWhere.selectwherestring(Request["sqlSet"]);
            int pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            int pageSize  = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            //string Where = Request["sqlSet"] == null ? "1=1" : SelectWhere.selectwherestring(Request["sqlSet"]);
            string Where = Request["sqlSet"] == null ? "1=1" : GetSql(Request["sqlSet"]);

            Where += " and IsDeleted='false'";
            ////字段排序
            String    sortField = Request["sort"];
            String    sortOrder = Request["order"];
            PageClass pc        = new PageClass();

            pc.sys_Fields    = "*";
            pc.sys_Key       = "Id";
            pc.sys_PageIndex = pageIndex;
            pc.sys_PageSize  = pageSize;
            pc.sys_Table     = "TF_EntryAndExitRegistration";
            if (UserData.UserTypes == 1)
            {
                pc.sys_Where = Where;
            }
            else
            {
                pc.sys_Where = Where + " and CreateMan='" + UserData.UserName + "'";
            }

            pc.sys_Order = " " + sortField + " " + sortOrder;
            List <TF_EntryAndExitRegistration> list2 = OPBiz.GetPagingData <TF_EntryAndExitRegistration>(pc);
            Dictionary <string, object>        dic   = new Dictionary <string, object>();


            // var mql = TF_EntryAndExitRegistrationSet.Id.NotEqual("");
            dic.Add("rows", list2);
            dic.Add("total", pc.RCount);
            return(Json(dic, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Search()
        {
            // SelectWhere.selectwherestring(Request["sqlSet"]);
            int pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            int pageSize  = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            //string Where = Request["sqlSet"] == null ? "1=1" : SelectWhere.selectwherestring(Request["sqlSet"]);
            string Where = " 1=1 ";

            if (Request["sqlSet"] != null)
            {
                string sqlSet = Request["sqlSet"];
                if (sqlSet.Contains("CertificateCategory"))
                {
                    string[] data = sqlSet.Split('█');
                    if (!string.IsNullOrEmpty(sqlSet))
                    {
                        for (int i = 0; i < data.Length; i++)
                        {
                            int index    = data[i].IndexOf(":");
                            var nameData = data[i].Substring(0, index);

                            string[] name  = nameData.Split('_');
                            string   value = e3net.tools.FilterTools.FilterSpecial(data[i].Substring(index + 1));
                            if (name[0].Trim() == "CertificateCategory" && value == "1")      //证件类型(1--护照;2--港澳通行证;3--台湾通行证)
                            {
                                Where += " and " + GetOP("TotalHZ", "ne", "");                // " and TotalHZ>0";
                            }
                            else if (name[0].Trim() == "CertificateCategory" && value == "2") //证件类型(1--护照;2--港澳通行证;3--台湾通行证)
                            {
                                Where += " and " + GetOP("TotalGA", "ne", "");                // " and TotalGA>0";
                            }
                            else if (name[0].Trim() == "CertificateCategory" && value == "3") //证件类型(1--护照;2--港澳通行证;3--台湾通行证)
                            {
                                Where += " and " + GetOP("TotalTW", "ne", "");                // " and TotalTW>0";
                            }
                            else
                            {
                                Where += " and " + GetOP(name[0], name[1], value);
                            }
                        }
                    }
                }
                else
                {
                    Where += " and " + GetSql(Request["sqlSet"]);
                }
            }

            ////字段排序
            String    sortField = Request["sort"];
            String    sortOrder = Request["order"];
            PageClass pc        = new PageClass();

            pc.sys_Fields    = "*";
            pc.sys_Key       = "Id";
            pc.sys_PageIndex = pageIndex;
            pc.sys_PageSize  = pageSize;
            pc.sys_Table     = "View_CRJStatistics";
            //if (UserData.UserTypes == 1)
            //{
            pc.sys_Where = Where;
            //}
            //else
            //{
            //    pc.sys_Where = Where + " and CreateMan='" + UserData.UserName + "'";
            //}

            pc.sys_Order = " " + sortField + " " + sortOrder;
            List <TF_ChuRuJingStatistics> list2 = OPBiz.GetPagingData <TF_ChuRuJingStatistics>(pc);
            Dictionary <string, object>   dic   = new Dictionary <string, object>();


            // var mql = TF_EntryAndExitRegistrationSet.Id.NotEqual("");
            dic.Add("rows", list2);
            dic.Add("total", pc.RCount);
            return(Json(dic, JsonRequestBehavior.AllowGet));
        }