Exemplo n.º 1
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="WorkFlowID"></param>
        /// <param name="pageInde"></param>
        private void BindGrid(int pageIndex)
        {
            BLL.T_WorkFlow_BLL   wfBLL = new T_WorkFlow_BLL();
            Model.T_WorkFlow_MDL wfMDL = wfBLL.GetModel(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(txtGcmc.Text))
            {
                sqlWhere += " AND gcmc like '%" + txtGcmc.Text + "%'";
            }
            if (!String.IsNullOrEmpty(txtGcbm.Text))
            {
                sqlWhere += " AND gcbm like '%" + txtGcbm.Text + "%'";
            }
            DataTable dt = null;

            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"]);
            }

            if (PublicModel.isSuperAdmin())
            {
                dt = flowDefineBLL.GetLHSignatureListPaging(workFlowID.ToString(), false, "", "", sqlWhere, pageSize, pageIndex, out itemCount);
            }
            else
            {
                dt = flowDefineBLL.GetLHSignatureListPaging(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;
            AspNetPager.CurrentPageIndex = pageIndex;

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