Пример #1
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        void Bind()
        {
            #region 设置公司ID产生省份城市列表
            ucProvince1.CompanyId  = CurrentUserCompanyID;
            ucProvince1.IsFav      = true;
            ucProvince1.ProvinceId = Utils.GetInt(Utils.GetQueryStringValue("pid"));
            ucCity1.CompanyId      = CurrentUserCompanyID;
            ucCity1.ProvinceId     = Utils.GetInt(Utils.GetQueryStringValue("pid"));
            ucCity1.IsFav          = true;
            ucCity1.CityId         = Utils.GetInt(Utils.GetQueryStringValue("cid"));

            txtCompanyName.Value = Server.HtmlDecode(Utils.GetQueryStringValue("comName"));
            txtContact.Value     = Server.HtmlDecode(Utils.GetQueryStringValue("contactName"));
            txt_tel.Value        = Utils.GetQueryStringValue("phone");
            #endregion
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1);

            EyouSoft.Model.CompanyStructure.MCustomerSeachInfo searchModel = new EyouSoft.Model.CompanyStructure.MCustomerSeachInfo();
            if (Utils.GetInt(Utils.GetQueryStringValue("pid")) > 0)
            {
                searchModel.ProvinceId = Utils.GetInt(Utils.GetQueryStringValue("pid"));
            }
            if (Utils.GetInt(Utils.GetQueryStringValue("cid")) > 0)
            {
                searchModel.CityId = Utils.GetInt(Utils.GetQueryStringValue("cid"));
            }
            searchModel.ContactName      = Server.HtmlDecode(Utils.GetQueryStringValue("contactName"));
            searchModel.CustomerName     = Server.HtmlDecode(Utils.GetQueryStringValue("comName"));
            searchModel.ContactTelephone = Utils.GetQueryStringValue("phone");


            //int cityid = ucCity1.CityId;
            //int provinceId = ucProvince1.ProvinceId;
            //if (cityid > 0)
            //    searchModel.CityId = cityid;
            //if (provinceId > 0)
            //    searchModel.ProvinceId = provinceId;
            //searchModel.ContactName = contacter;
            //searchModel.CustomerName = companyName;
            //searchModel.ContactTelephone = txt_tel.Value;
            //绑定客户列表
            EyouSoft.BLL.CompanyStructure.Customer custBll            = new EyouSoft.BLL.CompanyStructure.Customer();
            IList <EyouSoft.Model.CompanyStructure.CustomerInfo> list = custBll.GetCustomers(CurrentUserCompanyID, pageSize, pageIndex, ref recordCount, searchModel);
            if (list != null && list.Count > 0)
            {
                rptCustomer.DataSource = list;
                rptCustomer.DataBind();
                BindExportPage();
            }
            else
            {
                rptCustomer.EmptyText   = "<tr><td colspan='10' align='center'>对不起,暂无客户资料信息!</td></tr>";
                ExportPageInfo1.Visible = false;
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //判断权限
            if (!CheckGrant(global::Common.Enum.TravelPermission.短信中心_短信中心_栏目))
            {
                Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.短信中心_短信中心_栏目, true);
                return;
            }
            #region 绑定客户列表
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1);
            itemIndex = (pageIndex - 1) * pageSize + 1;
            //获取查询条件
            string userName    = Utils.GetQueryStringValue("username");    //姓名
            string mobile      = Utils.GetQueryStringValue("mobile");      //手机号
            string companyname = Utils.GetQueryStringValue("companyname"); //单位名称

            EyouSoft.BLL.SMSStructure.CustomerList custBll = new EyouSoft.BLL.SMSStructure.CustomerList();
            //绑定客户列表

            #endregion


            #region 导出客户Excel
            //导出Excel
            EyouSoft.BLL.CompanyStructure.Customer customerBll = new EyouSoft.BLL.CompanyStructure.Customer();//客户bll
            //查询条件实体
            EyouSoft.Model.CompanyStructure.MCustomerSeachInfo searchModel = new EyouSoft.Model.CompanyStructure.MCustomerSeachInfo();
            searchModel.ContactName  = userName;
            searchModel.Mobile       = mobile;
            searchModel.CustomerName = companyname;
            IList <EyouSoft.Model.CompanyStructure.CustomerInfo> list = customerBll.GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, searchModel);

            if (list != null && list.Count > 0)
            {
                rptCustomer.DataSource = list;
                rptCustomer.DataBind();
                BindExportPage();
            }
            else
            {
                rptCustomer.EmptyText   = "<tr><td colspan='7' align='center'>对不起,暂无客户信息!</td></tr>";
                ExportPageInfo1.Visible = false;
            }
            #endregion

            //恢复查询条件
            txtCompanyName.Value = companyname; //单位名称
            txtMobile.Value      = mobile;      //手机号
            txtUserName.Value    = userName;    //姓名
        }