Example #1
0
        public void ProcessRequest(HttpContext context)
        {
            HttpRequest rp = context.Request;

            context.Response.ContentType = "text/plain";
            RoleInfoManager manager = new RoleInfoManager();
            int             currentPage = int.Parse(rp["pagenum"]);
            int             pageSize = int.Parse(rp["pagesize"]);
            int             count = 0, recordCount = 0;
            DataTable       dt     = manager.GetPersonByRoleID(currentPage + 1, pageSize, null, rp["RoleID"], true, ref count, ref recordCount);
            string          result = JsonConvert.Convert2Json(dt);

            context.Response.Write("{ \"totalRecords\":\"" + recordCount + "\",\"rows\":" + result + "}");
            context.Response.End();
        }
Example #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            NoticeInfoManager manager = new NoticeInfoManager();
            int pageNum     = int.Parse(context.Request.QueryString.Get("pagenum"));
            int pagesize    = int.Parse(context.Request.QueryString.Get("pagesize"));
            int recordCount = 0;

            WhereClip where = null;
            DataTable dt = manager.GetDataTable(pageNum + 1, pagesize, where, " CODE ", ref pagesize, ref recordCount);
            //manager.GetDataTable();
            string result = JsonConvert.Convert2Json(dt);

            context.Response.Write("{\"total\":\"" + recordCount.ToString() + "\",\"rows\":" + result + "}");
            context.Response.End();
        }
Example #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            ShebeiInfoManager manager = new ShebeiInfoManager();
            int pageNum     = int.Parse(context.Request.QueryString.Get("pagenum"));
            int pagesize    = int.Parse(context.Request.QueryString.Get("pagesize"));
            int recordCount = 0;

            WhereClip where = new WhereClip();
            if (!string.IsNullOrEmpty(context.Request["status"]))
            {
                where = ShebeiInfo._.State == context.Request["status"];
            }
            string filter = context.Request["filtervalue0"];

            //获取当前用户的部们
            if (context.Session["AllDepart"] != null)
            {
                List <AdministrativeRegions> list = context.Session["AllDepart"] as List <AdministrativeRegions>;
                if (list != null && list.Count > 0)
                {
                    string[] dparr = new string[list.Count];
                    for (int i = 0; i < list.Count; i++)
                    {
                        dparr[i] = list[i].ID.ToString();
                    }

                    where = where && ShebeiInfo._.SocrceDepart.In(dparr);
                }
            }

            if (!string.IsNullOrEmpty(filter))
            {
                filter = filter.Trim();

                where = where && (ShebeiInfo._.Code.Contains(filter) || ShebeiInfo._.Name.Contains(filter) || ShebeiInfo._.Address.Contains(filter));
            }
            DataTable dt = manager.GetDataTable(pageNum + 1, pagesize, where, ref pagesize, ref recordCount);
            //manager.GetDataTable();
            string result = JsonConvert.Convert2Json(dt);

            context.Response.Write("{\"total\":\"" + recordCount.ToString() + "\",\"rows\":" + result + "}");
            context.Response.End();
        }
Example #4
0
        public void ProcessRequest(HttpContext context)
        {
            HttpRequest rp = context.Request;

            context.Response.ContentType = "text/plain";
            AdministrativeRegionsManager manager = new AdministrativeRegionsManager();
            int    currentPage = int.Parse(rp["pagenum"]);
            int    pageSize    = int.Parse(rp["pagesize"]);
            string fiter       = rp["filtervalue0"];

            WhereClip where = null;
            if (!string.IsNullOrEmpty(fiter))
            {
                fiter = fiter.Trim();
                where = (PersonInfo._.UserName.Contains(fiter) || PersonInfo._.RealName.Contains(fiter));
            }
            int       count = 0, recordCount = 0;
            DataTable dt     = manager.GetPersonByDepartID(currentPage + 1, pageSize, where, rp["DepartID"], false, ref count, ref recordCount);
            string    result = JsonConvert.Convert2Json(dt);

            context.Response.Write("{ \"totalRecords\":\"" + recordCount + "\",\"rows\":" + result + "}");
            context.Response.End();
        }
Example #5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            HttpRequest     rp          = context.Request;
            WorkInfoManager manager     = new WorkInfoManager();
            int             currentPage = int.Parse(rp["pagenum"]);
            int             pageSize    = int.Parse(rp["pagesize"]);

            int    count = 0, recordCount = 0;
            string workstatus = rp["Workstatus"];

            WhereClip where = new WhereClip();
            if (context.Session["AllDepart"] != null)
            {
                List <AdministrativeRegions> list = context.Session["AllDepart"] as List <AdministrativeRegions>;
                if (list != null && list.Count > 0)
                {
                    string[] dparr = new string[list.Count];
                    for (int i = 0; i < list.Count; i++)
                    {
                        dparr[i] = list[i].ID.ToString();
                    }
                    if (WhereClip.IsNullOrEmpty(where))
                    {
                        where = ShebeiInfo._.SocrceDepart.In(dparr);
                    }
                    else
                    {
                        where = where && ShebeiInfo._.SocrceDepart.In(dparr);
                    }
                }
            }
            if (!string.IsNullOrEmpty(workstatus))
            {
                where.And(WorkInfo._.Status == workstatus);
            }


            if (!string.IsNullOrEmpty(context.Request["begindate"]))
            {
                string begin = context.Request["begindate"];
                if (!string.IsNullOrEmpty(begin))
                {
                    where = where && WorkInfo._.CreateDate >= begin;
                }
            }
            if (!string.IsNullOrEmpty(context.Request["enddate"]))
            {
                string enddate = context.Request["enddate"];
                if (!string.IsNullOrEmpty(enddate))
                {
                    where = where && WorkInfo._.CreateDate <= enddate;
                }
            }
            if (!string.IsNullOrEmpty(context.Request["username"]))
            {
                where = where && WorkInfo._.CurrentUser.Contains(context.Request["username"]);
            }

            if (!string.IsNullOrEmpty(context.Request["sbcode"]))
            {
                where = where && ShebeiInfo._.Code.Contains(context.Request["sbcode"]);
            }

            if (!string.IsNullOrEmpty(context.Request["sbname"]))
            {
                where = where && ShebeiInfo._.Name.Contains(context.Request["sbname"]);
            }
            OrderByClip or = WorkInfo._.CreateDate.Desc;

            if (!string.IsNullOrEmpty(context.Request["sortdatafield"]))
            {
                if (!string.IsNullOrEmpty(context.Request["sortorder"]) && context.Request["sortorder"] == "desc")
                {
                    or = new OrderByClip(context.Request["sortdatafield"] + " desc");
                }
                else
                {
                    or = new OrderByClip(context.Request["sortdatafield"]);
                }
            }
            DataTable dt     = manager.GetDataTable(currentPage + 1, pageSize, where, or, ref count, ref recordCount);
            string    result = JsonConvert.Convert2Json(dt);

            context.Response.Write("{ \"totalRecords\":\"" + recordCount + "\",\"rows\":" + result + "}");
            context.Response.End();
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            HttpRequest     rp          = context.Request;
            WorkInfoManager manager     = new WorkInfoManager();
            int             currentPage = int.Parse(rp["pagenum"]);
            int             pageSize    = int.Parse(rp["pagesize"]);

            int    count = 0, recordCount = 0;
            string workstatus = rp["Workstatus"];

            WhereClip where = null;
            where           = WorkInfo._.CreateDate.Like("%%");
            if (!string.IsNullOrEmpty(workstatus))
            {
                where.And(WorkInfo._.Status == workstatus);
            }


            if (!string.IsNullOrEmpty(context.Request["RQ"]))
            {
                string[] datestr = context.Request["RQ"].ToString().Split('@');
                string   begin   = datestr[0];
                if (!string.IsNullOrEmpty(begin))
                {
                    where.And(WorkInfo._.CreateDate >= begin);
                }
                string end = datestr[1];
                if (!string.IsNullOrEmpty(end))
                {
                    where.And(WorkInfo._.CreateDate <= end);
                }
            }
            if (!string.IsNullOrEmpty(context.Request["USERNAME"]))
            {
                where.And(WorkInfo._.CreaterName.Like("%" + context.Request["USERNAME"].ToString() + "%"));
            }

            if (!string.IsNullOrEmpty(context.Request["SBNAME"]))
            {
                where.And(ShebeiInfo._.Name.Like("%" + context.Request["SBNAME"].ToString() + "%"));
            }
            if (!string.IsNullOrEmpty(context.Request["SBZT"]))
            {
                where.And(WorkInfo._.Status.Like("%" + context.Request["SBZT"].ToString() + "%"));
            }
            if (!string.IsNullOrEmpty(context.Request["GZXX"]))
            {
                where.And(WorkInfo._.GuZhangXx.Like("%" + context.Request["GZXX"].ToString() + "%"));
            }
            if (context.Session["AllDepart"] != null)
            {
                List <AdministrativeRegions> list = context.Session["AllDepart"] as List <AdministrativeRegions>;
                if (list != null && list.Count > 0)
                {
                    string[] dparr = new string[list.Count];
                    for (int i = 0; i < list.Count; i++)
                    {
                        dparr[i] = list[i].ID.ToString();
                    }
                    if (WhereClip.IsNullOrEmpty(where))
                    {
                        where = ShebeiInfo._.SocrceDepart.In(dparr);
                    }
                    else
                    {
                        where = where && ShebeiInfo._.SocrceDepart.In(dparr);
                    }
                }
            }
            OrderByClip or = WorkInfo._.CreateDate.Desc;

            if (!string.IsNullOrEmpty(context.Request["sortdatafield"]))
            {
                if (!string.IsNullOrEmpty(context.Request["sortorder"]) && context.Request["sortorder"] == "desc")
                {
                    or = new OrderByClip(context.Request["sortdatafield"] + " desc");
                }
                else
                {
                    or = new OrderByClip(context.Request["sortdatafield"]);
                }
            }
            if (!string.IsNullOrEmpty(context.Request["index"]))
            {
                pageSize = 4;
            }
            DataTable dt     = manager.GetDataTable(currentPage + 1, pageSize, where, or, ref count, ref recordCount);
            string    result = JsonConvert.Convert2Json(dt);

            context.Response.Write("{ \"totalRecords\":\"" + recordCount + "\",\"rows\":" + result + "}");
            context.Response.End();
        }
Example #7
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            if (context.Session["UserID"] != null)
            {
                string     userid = context.Session["UserID"].ToString();
                PersonInfo p      = new PersonInfoManager().GetItemById(new Guid(userid));
                if (!p.MarryStatus.HasValue || p.MarryStatus.Value != 3)
                {
                    context.Response.Write("{\"total\":\"0\",\"rows\": 没有考勤数据}");
                    context.Response.End();
                    return;
                }
            }



            YuanGongKaoQinManager manager = new YuanGongKaoQinManager();
            int pageNum     = int.Parse(context.Request.QueryString.Get("pagenum"));
            int pagesize    = int.Parse(context.Request.QueryString.Get("pagesize"));
            int recordCount = 0;

            WhereClip where = new WhereClip();
            if (!string.IsNullOrEmpty(context.Request["USER"]))
            {
                where = YuanGongKaoQin._.UserName.Contains(context.Request["USER"]);
            }

            if (!string.IsNullOrEmpty(context.Request["begindate"]))
            {
                string begin = context.Request["begindate"];
                if (!string.IsNullOrEmpty(begin))
                {
                    where = where && YuanGongKaoQin._.KQRQ >= begin;
                }
            }
            if (!string.IsNullOrEmpty(context.Request["enddate"]))
            {
                string enddate = context.Request["enddate"];
                if (!string.IsNullOrEmpty(enddate))
                {
                    where = where && YuanGongKaoQin._.KQRQ <= enddate;
                }
            }
            if (!string.IsNullOrEmpty(context.Request["swstatus"]))
            {
                where = YuanGongKaoQin._.SWStatus == context.Request["swstatus"];
            }

            if (!string.IsNullOrEmpty(context.Request["status"]))
            {
                where = YuanGongKaoQin._.Status == context.Request["status"];
            }


            if (!string.IsNullOrEmpty(context.Request["KQRQ"]))
            {
                string[] datestr = context.Request["KQRQ"].ToString().Split('@');
                string   begin   = datestr[0];
                if (!string.IsNullOrEmpty(begin))
                {
                    where.And(YuanGongKaoQin._.KQRQ >= begin);
                }
                string end = datestr[1];
                if (!string.IsNullOrEmpty(end))
                {
                    where.And(YuanGongKaoQin._.KQRQ <= end);
                }
            }
            string or = "UserName";

            if (!string.IsNullOrEmpty(context.Request["sortdatafield"]))
            {
                if (!string.IsNullOrEmpty(context.Request["sortorder"]) && context.Request["sortorder"] == "desc")
                {
                    or = context.Request["sortdatafield"] + " desc";
                }
                else
                {
                    or = context.Request["sortdatafield"];
                }
            }
            DataTable dt = manager.GetDataTable(pageNum + 1, pagesize, where, or, ref pagesize, ref recordCount);
            //manager.GetDataTable();
            string result = JsonConvert.Convert2Json(dt);

            context.Response.Write("{\"total\":\"" + recordCount.ToString() + "\",\"rows\":" + result + "}");
            context.Response.End();
        }
Example #8
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            ShebeiInfoManager manager = new ShebeiInfoManager();
            int pageNum  = int.Parse(context.Request.QueryString.Get("pagenum"));
            int pagesize = int.Parse(context.Request.QueryString.Get("pagesize"));

            int recordCount = 0;

            WhereClip where = new WhereClip();
            if (!string.IsNullOrEmpty(context.Request.QueryString["nb"]))
            {
                if (context.Request.QueryString["nb"] == "1")
                {
                    where = where && ShebeiInfo._.IsNeiWai == true;
                }
                else if (context.Request.QueryString["nb"] == "0")
                {
                    where = where && ShebeiInfo._.IsNeiWai == false;
                }
            }
            if (!string.IsNullOrEmpty(context.Request["sbzt"]))
            {
                where = where && ShebeiInfo._.State == context.Request["sbzt"];
            }
            if (!string.IsNullOrEmpty(context.Request["sbcode"]))
            {
                where = where && ShebeiInfo._.Code.Contains(context.Request["sbcode"]);
            }
            if (!string.IsNullOrEmpty(context.Request["sbname"]))
            {
                where = where && ShebeiInfo._.Name.Contains(context.Request["sbname"]);
            }
            if (context.Session["AllDepart"] != null)
            {
                List <AdministrativeRegions> list = context.Session["AllDepart"] as List <AdministrativeRegions>;
                if (list != null && list.Count > 0)
                {
                    string[] dparr = new string[list.Count];
                    for (int i = 0; i < list.Count; i++)
                    {
                        dparr[i] = list[i].ID.ToString();
                    }
                    if (WhereClip.IsNullOrEmpty(where))
                    {
                        where = ShebeiInfo._.SocrceDepart.In(dparr);
                    }
                    else
                    {
                        where = where && ShebeiInfo._.SocrceDepart.In(dparr);
                    }
                }
            }
            string or = " state, CODE ";

            if (!string.IsNullOrEmpty(context.Request["sortdatafield"]))
            {
                if (!string.IsNullOrEmpty(context.Request["sortorder"]) && context.Request["sortorder"] == "desc")
                {
                    or = context.Request["sortdatafield"] + " desc";
                }
                else
                {
                    or = context.Request["sortdatafield"];
                }
            }

            DataTable dt = manager.GetDataTableWithImg(pageNum + 1, pagesize, where, or, ref pagesize, ref recordCount);
            //manager.GetDataTable();
            string result = JsonConvert.Convert2Json(dt);

            context.Response.Write("{\"totalRecords\":\"" + recordCount.ToString() + "\",\"rows\":" + result + "}");
            context.Response.End();
        }