Пример #1
0
        protected void BindCompany()
        {
            EyouSoft.IBLL.CompanyStructure.ICompanyInfo companyBll = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance();
            int areaId = Utils.GetInt(Request.QueryString["areaid"], 0);

            if (areaId != 0)
            {
                //获取查询条件
                QueryParamsCompanyBase query = new QueryParamsCompanyBase();
                query.AreaId = areaId;
                query.CityId = SiteUserInfo.CityId;
                //获取批发商数据
                IList <EyouSoft.Model.CompanyStructure.CompanyInfo> companyList = companyBll.GetListRouteAgency(query, pageSize, pageIndex, ref recordCount);
                if (companyList.Count > 0)
                {
                    alcl_rpt_companyList1.DataSource = companyList;
                    alcl_rpt_companyList1.DataBind();
                    BindPage(areaId);//设置分页
                }
                else
                {
                    alcl_rpt_companyList1.EmptyText = "暂无批发商信息";
                    this.ExportPageInfo1.Visible    = false;
                }
                companyList = null;
            }
        }
Пример #2
0
        /// <summary>
        /// 初始化批发商列表
        /// </summary>
        private void InitCompanys()
        {
            this.InitFavors();

            int pageSize    = 20;
            int pageIndex   = Utils.GetInt(Request.QueryString["Page"], 1);
            int recordCount = 0;

            EyouSoft.Model.CompanyStructure.QueryParamsCompanyBase query = new EyouSoft.Model.CompanyStructure.QueryParamsCompanyBase();

            query.AreaId      = Utils.GetInt(Request.QueryString["AreaId"], 0);
            query.CompanyName = Utils.InputText(Request.QueryString["CompanyName"]);
            query.CityId      = SiteUserInfo.CityId;

            EyouSoft.IBLL.CompanyStructure.ICompanyInfo bll = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance();
            var items = bll.GetListRouteAgency(query, pageSize, pageIndex, ref recordCount);
            var obj   = new { html = string.Empty, pageSize = pageSize, pageIndex = pageIndex, recordCount = recordCount };

            if (items != null && items.Count > 0)
            {
                StringBuilder html = new StringBuilder();
                html.Append(@"<table width=""210"" border=""0"" cellpadding=""0"" align=""center"" cellspacing=""1"" bgcolor=""#eeeeee"" > ");

                foreach (EyouSoft.Model.CompanyStructure.CompanyInfo tmp in items)
                {
                    html.Append("<tr>");
                    html.Append(this.GetstrCompany(tmp.ID, tmp.CompanyName, tmp.ContactInfo.ContactName, tmp.ContactInfo.Tel, tmp.ContactInfo.Mobile));
                    html.Append("</tr>");
                }

                html.Append("</table>");

                obj = new { html = html.ToString(), pageSize = pageSize, pageIndex = pageIndex, recordCount = recordCount };
            }

            bll = null;

            Response.Clear();
            Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(obj));
            Response.End();
        }