Пример #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;    //姓名
        }
Пример #3
0
        /// <summary>
        /// 搜索数据列表
        /// </summary>
        public IList <EyouSoft.Model.CompanyStructure.CustomerInfo> SearchCustomerList(int PageSize, int PageIndex, int CompanyID, int[] provinceIds, int[] cityIds, string CompanyName, string Contacter, string Saler, ref int RecordCount, ref int PageCount, string telephone)
        {
            EyouSoft.Model.CompanyStructure.MCustomerSeachInfo seachInfo = new EyouSoft.Model.CompanyStructure.MCustomerSeachInfo();

            seachInfo.ProvinceIds = provinceIds;
            seachInfo.CityIdList  = cityIds;
            seachInfo.ContactName = Contacter;

            if (!string.IsNullOrEmpty(Saler))
            {
                int sellerId = 0;
                int.TryParse(Saler, out sellerId);
                if (sellerId > 0)
                {
                    seachInfo.SellerIds = new int[] { sellerId };
                }
            }

            seachInfo.CustomerName     = CompanyName;
            seachInfo.ContactTelephone = telephone;


            return(this.GetCustomers(CompanyID, PageSize, PageIndex, ref RecordCount, seachInfo));
        }
Пример #4
0
        protected string Orderbyid = string.Empty; //排序编号

        protected void Page_Load(object sender, EventArgs e)
        {
            BindSellerlist();
            if (!IsPostBack)
            {
                //初始化绑定部门员工列表
                EyouSoft.BLL.CompanyStructure.CompanyUser           userBll  = new EyouSoft.BLL.CompanyStructure.CompanyUser();
                IList <EyouSoft.Model.CompanyStructure.CompanyUser> userList = userBll.GetCompanyUser(CurrentUserCompanyID);
                if (userList != null && userList.Count > 0)
                {
                    foreach (EyouSoft.Model.CompanyStructure.CompanyUser userItem in userList)
                    {
                        ddlSalePeople.Items.Add(new ListItem(userItem.PersonInfo.ContactName, userItem.ID.ToString()));
                    }
                }
                ddlSalePeople.Items.Insert(0, new ListItem("请选择", ""));
            }

            #region 判断权限
            if (!CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_栏目))
            {
                Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.客户关系管理_客户资料_栏目, true);
                return;
            }
            if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_停用帐号))
            {
                IsStop = true;
            }
            if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_删除客户))
            {
                IsDelete = true;
            }
            if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_修改客户))
            {
                IsUpdate = true;
            }
            if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_新增客户))
            {
                IsAdd = true;
            }
            if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_导入客户))
            {
                IsImportIn = true;
            }
            if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_导出客户))
            {
                IsImportOut = true;
            }
            #endregion

            i = Utils.GetInt(Utils.GetFormValue("ids"));

            EyouSoft.BLL.CompanyStructure.Customer custBll = new EyouSoft.BLL.CompanyStructure.Customer(); //客户bll
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1);                                //页码
            bool result = false;                                                                           //操作结果
            #region 当前操作
            string method = Utils.GetFormValue("method");
            if (method == "del")
            {
                //删除 获取客户信息所有的编号集合
                string   ids    = Utils.GetFormValue("ids");
                string[] idlist = ids.Split(',');
                if (idlist.Length > 0)
                {
                    for (int k = 0; k < idlist.Length - 1; k++)
                    {
                        result = custBll.DeleteCustomer(Utils.GetInt(idlist[k]));
                    }
                }
                Utils.ResponseMeg(result, result ? "删除成功!" : "删除失败!");
                return;
            }
            if (method == "stop")
            {   //停用
                string ids = Utils.GetFormValue("ids");
                result = custBll.StopIt(Utils.GetInt(ids));
                Utils.ResponseMeg(result, result ? "已停用!" : "停用失败!");
                return;
            }
            if (method == "start")
            {   //启用
                string ids = Utils.GetFormValue("ids");
                result = custBll.StartId(Utils.GetInt(ids));
                Utils.ResponseMeg(result, result ? "已启用!" : "启用失败!");
                return;
            }
            #endregion

            #region 查询参数
            string contacter   = Utils.InputText(Request.QueryString["contacter"] == null ? "" : Server.UrlDecode(Request.QueryString["contacter"])); //联系人
            int[]  provinceIds = Utils.GetIntArray(Utils.GetQueryStringValue("province"), ",");                                                       //省份
            int[]  cityIds     = Utils.GetIntArray(Utils.GetQueryStringValue("city"), ",");                                                           //城市
            string saler       = Utils.InputText(Request.QueryString["saler"] == null ? "" : Server.UrlDecode(Request.QueryString["saler"]));         //责任销售
            string companyName = Utils.InputText(Request.QueryString["saler"] == null ? "" : Server.UrlDecode(Request.QueryString["companyName"]));   //单位名称
            string telephone   = Utils.GetQueryStringValue("telephone");
            #endregion

            int pageCount = 1;                                                //页数
            IList <EyouSoft.Model.CompanyStructure.CustomerInfo> list = null; //客户资料集合

            #region 导出客户Excel
            //导出Excel
            if (Utils.GetQueryStringValue("method") == "downexcel")
            {
                string strPageSize = Utils.GetQueryStringValue("recordcount");
                pageSize = Utils.GetInt(strPageSize == "0" ? "1" : strPageSize);//导出游客时获取全部的查询数据
                list     = custBll.SearchCustomerList(pageSize, pageIndex, CurrentUserCompanyID, provinceIds, cityIds, companyName, contacter, saler, ref recordCount, ref pageCount, telephone);
                DownLoadExcel(list);
                return;
            }
            #endregion

            #region 绑定客户列表
            //客户资料排序实体
            EyouSoft.Model.CompanyStructure.MCustomerSeachInfo Seachinfo = new EyouSoft.Model.CompanyStructure.MCustomerSeachInfo();

            //排序方式
            int order = Utils.GetInt(Utils.GetQueryStringValue("order"));
            if (order == 0)
            {
                //绑定客户列表
                list = custBll.SearchCustomerList(pageSize, pageIndex, CurrentUserCompanyID, provinceIds, cityIds, companyName, contacter, saler, ref recordCount, ref pageCount, telephone);
                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;
                }
            }
            else
            {
                #region 标题排序
                switch (order)
                {
                case 1:
                    Orderbyid = "1";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.客户名称;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 2:
                    Orderbyid = "2";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.客户名称;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 3:
                    Orderbyid = "3";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.主要联系人名称;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 4:
                    Orderbyid = "4";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.主要联系人名称;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 5:
                    Orderbyid = "5";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.主要联系人电话;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 6:
                    Orderbyid = "6";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.主要联系人电话;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 7:
                    Orderbyid = "7";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.主要联系人手机;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 8:
                    Orderbyid = "8";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.主要联系人手机;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 9:
                    Orderbyid = "9";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.主要联系人传真;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 10:
                    Orderbyid = "10";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.主要联系人传真;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 11:
                    Orderbyid = "11";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.责任销售;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 12:
                    Orderbyid = "12";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.责任销售;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 13:
                    Orderbyid = "13";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.交易次数;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 14:
                    Orderbyid = "14";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.交易次数;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 17:
                    Orderbyid = "17";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.结算方式;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 18:
                    Orderbyid = "18";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.结算方式;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 19:
                    Orderbyid = "19";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.省份;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 20:
                    Orderbyid = "20";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.省份;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 21:
                    Orderbyid = "21";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.地址;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.ASC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;

                case 22:
                    Orderbyid = "22";
                    Seachinfo.OrderByField = EyouSoft.Model.EnumType.CompanyStructure.CustomerOrderByField.地址;
                    Seachinfo.OrderByType  = EyouSoft.Model.EnumType.CompanyStructure.OrderByType.DESC;
                    list = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomers(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount, Seachinfo);
                    break;
                }
                #endregion
                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;
                }
            }
            #endregion

            //恢复查询关键字
            txtCompanyName.Value             = companyName; //公司名
            txtContact.Value                 = contacter;   //联系人
            this.ddlSalePeople.SelectedValue = saler;       //责任销售人
        }
Пример #5
0
        /// <summary>
        /// 按指定条件获取客户资料信息集合
        /// </summary>
        /// <param name="companyId">公司(专线)编号</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="pageIndex">当前页索引</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="seachInfo">查询条件业务实体</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.CompanyStructure.CustomerInfo> GetCustomers(int companyId, int pageSize, int pageIndex, ref int recordCount, EyouSoft.Model.CompanyStructure.MCustomerSeachInfo seachInfo)
        {
            if (companyId < 1)
            {
                return(null);
            }

            return(Dal.GetCustomers(companyId, pageSize, pageIndex, ref recordCount, seachInfo));
        }