コード例 #1
0
        private void InitLocalAgencyList()
        {
            int    intRecordCount = 0;
            string CompanyName    = Server.UrlDecode(Utils.GetQueryStringValue("CompanyName"));
            string ContactName    = Server.UrlDecode(Utils.GetQueryStringValue("ContactName"));

            CurrencyPage = Utils.GetInt(Utils.InputText(Request.QueryString["Page"]), 1);
            EyouSoft.IBLL.CompanyStructure.ICompanyInfo        bll   = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance();
            EyouSoft.Model.CompanyStructure.QueryParamsCompany query = new EyouSoft.Model.CompanyStructure.QueryParamsCompany();
            query.CityId      = RequestCityID;
            query.CompanyName = CompanyName;
            query.ContactName = ContactName;
            query.PorvinceId  = ProvinceID;
            IList <EyouSoft.Model.CompanyStructure.CompanyInfo> list = bll.GetListLocalAgency(query, intPageSize, CurrencyPage, ref intRecordCount);

            if (intRecordCount > 0)
            {
                string[] CompanyIDList = new string[list.Count];
                CompanyIDList = (from c in list where true select c.ID).ToArray();
                AttachList    = EyouSoft.BLL.CompanyStructure.CompanyAttachInfo.CreateInstance().GetList(CompanyIDList);

                this.rptLocalAgencyList.DataSource = list;
                this.rptLocalAgencyList.DataBind();

                if (EyouSoft.Common.URLREWRITE.UrlReWriteUtils.IsReWriteUrl(Request))
                {
                    this.ExporPageInfoSelect1.Placeholder  = "#PageIndex#";
                    this.ExporPageInfoSelect1.IsUrlRewrite = true;
                    string strTemp = EyouSoft.Common.URLREWRITE.UrlReWriteUtils.GetUrlForPage(Request);
                    if (strTemp.Split('_').Count() == 3)
                    {
                        this.ExporPageInfoSelect1.PageLinkURL = strTemp.Split('_')[0] + "_" + strTemp.Split('_')[1] + "_0" + "_" + CityId + "_#PageIndex#";
                    }
                    else
                    {
                        this.ExporPageInfoSelect1.PageLinkURL = strTemp + "_#PageIndex#";
                    }
                    //this.ExporPageInfoSelect1.PageLinkURL = EyouSoft.Common.URLREWRITE.UrlReWriteUtils.GetUrlForPage(Request) + "_#PageIndex#";
                }
                else
                {
                    this.ExporPageInfoSelect1.PageLinkURL = Request.ServerVariables["SCRIPT_NAME"].ToString() + "?";
                    this.ExporPageInfoSelect1.UrlParams   = Request.QueryString;
                }

                this.ExporPageInfoSelect1.intPageSize    = intPageSize;
                this.ExporPageInfoSelect1.CurrencyPage   = CurrencyPage;
                this.ExporPageInfoSelect1.intRecordCount = intRecordCount;
                //this.ExporPageInfoSelect1.PageLinkURL = Request.ServerVariables["SCRIPT_NAME"] + "?CityID=" + CityId + "&";
                //this.ExporPageInfoSelect1.UrlParams = Request.QueryString;
            }
            else
            {
                this.ExporPageInfoSelect1.Visible = false;
                this.pnlNoData.Visible            = true;
            }

            this.txtCompanyName.Value = CompanyName;
            this.txtContactName.Value = ContactName;

            list = null;
            bll  = null;
        }