示例#1
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="WorkFlowID"></param>
        /// <param name="pageInde"></param>
        private void BindGrid(int pageIndex)
        {
            T_WorkFlow_BLL wfBLL = new T_WorkFlow_BLL();
            T_WorkFlow_MDL wfMDL = wfBLL.GetModel(workFlowID);

            workFlowCode = wfMDL.WorkFlowCode;

            string sqlWhere = string.Empty;

            if (Common.ConvertEx.ToBool(Common.Session.GetSession("SuperAdmin")) == true)                                                                               //管理员管理员获取所有工程
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Session["AREA_CODE"].ToString() + "%'";                                                                            //加区域了。
            }
            else if (Common.ConvertEx.ToBool(Common.Session.GetSession("SuperAdmin")) == false && Common.Session.GetSession("IsCompany") == false.ToString().ToLower()) //档案馆用户看自己的
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Session["OLD_AREA_CODE"].ToString() + "%'";                                                                        //加区域了。
            }

            if (!String.IsNullOrEmpty(gcmc.Text))
            {
                sqlWhere += " AND gcmc like '%" + gcmc.Text + "%'";
            }
            if (!String.IsNullOrEmpty(gcbm.Text))
            {
                sqlWhere += " AND gcbm like '%" + gcbm.Text + "%'";
            }

            DataTable dt = null;

            if (Common.Session.GetSession("SuperAdmin").ToLower() == "true")
            {
                dt = flowDefineBLL.GetListPaging(workFlowID.ToString(), false, "", "", sqlWhere, pageSize, pageIndex, out itemCount);
            }
            else
            {
                dt = flowDefineBLL.GetListPaging(workFlowID.ToString(), Common.Session.GetSessionBool("IsCompany"),
                                                 Common.Session.GetSession("RoleID"), Common.Session.GetSession("UserID"), sqlWhere, pageSize, pageIndex, out itemCount);
            }

            AspNetPager.AlwaysShow = true;
            AspNetPager.PageSize   = pageSize;

            AspNetPager.RecordCount = itemCount;

            gvData.DataSource = dt;
            gvData.DataBind();
        }
示例#2
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="pageIndex"></param>
        private void BindGrid(int pageIndex)
        {
            BLL.T_WorkFlow_BLL   wfBLL = new T_WorkFlow_BLL();
            Model.T_WorkFlow_MDL wfMDL = wfBLL.GetModel(ConvertEx.ToInt(workFlowID));
            workFlowCode = wfMDL.WorkFlowCode;

            string sqlWhere = string.Empty;

            if (PublicModel.isSuperAdmin())       //管理员管理员获取所有工程
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("AREA_CODE") + "%'";
            }
            else if (PublicModel.isArchiveUser()) //档案馆用户看自己的
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("OLD_AREA_CODE") + "%'";
            }

            if (!String.IsNullOrEmpty(gcmc.Text))
            {
                sqlWhere += " AND gcmc like '%" + gcmc.Text + "%'";
            }
            if (!String.IsNullOrEmpty(gcbm.Text))
            {
                sqlWhere += " AND gcbm like '%" + gcbm.Text + "%'";
            }

            if (ViewState["CurrentPageIndex"] == null && Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")) > 0)
            {
                pageIndex = Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex"));
                ViewState["CurrentPageIndex"] = pageIndex;
            }
            else
            {
                pageIndex = ConvertEx.ToInt(ViewState["CurrentPageIndex"]);
            }

            bool isChargeUser = false;

            if ((SystemSet._DEFAULT_RECV_WORKFLOWID + ",").IndexOf(workFlowID + ",") > -1)
            {
                isChargeUser = true;
            }

            DataTable dt = null;

            if (PublicModel.isSuperAdmin())
            {
                dt = flowDefineBLL.GetListPaging(workFlowID, false, "", "", sqlWhere, pageSize, pageIndex, out itemCount);
            }
            else
            {
                dt = flowDefineBLL.GetListPaging(workFlowID, Common.Session.GetSessionBool("IsCompany"),
                                                 "", Common.Session.GetSession("UserID"), sqlWhere, pageSize, pageIndex, out itemCount, isChargeUser);
            }

            AspNetPager.AlwaysShow = true;
            AspNetPager.PageSize   = pageSize;

            AspNetPager.RecordCount      = itemCount;
            AspNetPager.CurrentPageIndex = pageIndex;

            rpData.DataSource = dt;
            rpData.DataBind();
        }