Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string method = Utils.GetQueryStringValue("method");

            if (!CheckGrant(TravelPermission.营销工具_同业名录))
            {
                Utils.ResponseNoPermit();
                return;
            }
            EyouSoft.Model.CompanyStructure.CompanyDetailInfo companyModel = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(SiteUserInfo.CompanyID);
            if (companyModel != null)
            {
                SiteUserComLev = companyModel.CompanyLev;
            }

            //是否开通收费MQ
            //if (!companyModel.StateMore.CompanyService.IsServiceAvailable(EyouSoft.Model.CompanyStructure.SysService.MQ))
            //{
            //    Server.Transfer("/SystemSet/ApplyMQ.aspx?iscustomer=yes&" + StringValidate.BuildUrlString(Request.QueryString, new string[] { }), false);
            //    return;
            //}
            if (method == "setMyCustomer")//设置为我的客户
            {
                if (!haveUpdate)
                {
                    Utils.ResponseMeg(false, "对不起,你没有改权限!");
                    return;
                }
                myCustomerBll = EyouSoft.BLL.CompanyStructure.MyCustomer.CreateInstance();
                SetMyCustomer();
                myCustomerBll = null;
                return;
            }

            //获取查询条件
            int    province    = Utils.GetInt(Utils.InputText(Server.UrlDecode(Request.QueryString["province"] ?? ""))); //省份ID
            int    city        = Utils.GetInt(Utils.InputText(Server.UrlDecode(Request.QueryString["city"] ?? "")));     //城市ID
            string companyName = Utils.InputText(Server.UrlDecode(Request.QueryString["companyname"] ?? ""));            //公司名
            string admin       = Utils.InputText(Server.UrlDecode(Request.QueryString["admin"] ?? ""));                  //负责人
            string brand       = Utils.InputText(Server.UrlDecode(Request.QueryString["brand"] ?? ""));                  //品牌

            EyouSoft.Model.CompanyStructure.QueryParamsCompany query = new EyouSoft.Model.CompanyStructure.QueryParamsCompany();
            query.CityId       = city;
            query.PorvinceId   = province;
            query.CompanyBrand = brand;
            query.CompanyName  = companyName;
            query.ContactName  = admin;
            //当前页码
            pageIndex = Utils.GetInt(Request.QueryString["Page"], 1);
            //获取我的客户
            cityBll        = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance();
            provinceBll    = EyouSoft.BLL.SystemStructure.SysProvince.CreateInstance();
            companyAreaBll = EyouSoft.BLL.CompanyStructure.CompanyArea.CreateInstance();
            IList <EyouSoft.Model.CompanyStructure.CompanyInfo> allCustomerList = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetListTravelAgency(query, pageSize, pageIndex, ref recordCount);

            if (allCustomerList != null && allCustomerList.Count > 0)
            {
                alc_rpt_customers.DataSource = allCustomerList;
                alc_rpt_customers.DataBind();
                BindPage(province, city, companyName, admin, brand);//设置分页
            }
            else
            {
                alc_rpt_customers.EmptyText  = "<tr><td style='text-align:center'>暂无客户信息</td></tr>";
                this.ExportPageInfo1.Visible = false;
            }
            //清理对象
            allCustomerList = null;
            cityBll         = null;
            provinceBll     = null;

            //恢复查询条件
            ac_pc.SetProvinceId     = province;
            ac_pc.SetCityId         = city;
            ac_txtAdmin.Value       = admin;
            ac_txtBrand.Value       = brand;
            ac_txtCompanyName.Value = companyName;
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!CheckGrant(TravelPermission.营销工具_同业名录))
            {
                Utils.ResponseNoPermit();
                return;
            }
            string method = Utils.GetQueryStringValue("method");

            EyouSoft.Model.CompanyStructure.CompanyDetailInfo companyModel = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(SiteUserInfo.CompanyID);
            if (companyModel != null)
            {
                SiteUserComLev = companyModel.CompanyLev;
            }
            myCustomerBll = EyouSoft.BLL.CompanyStructure.MyCustomer.CreateInstance();
            tourOrderBLL  = EyouSoft.BLL.TourStructure.TourOrder.CreateInstance();
            cityBll       = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance();
            provinceBll   = EyouSoft.BLL.SystemStructure.SysProvince.CreateInstance();
            if (method == "clearMyCustomers")
            {
                if (!haveUpdate)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "<script type='text/javascript'>alert('对不起,你没有该权限!');</script>");
                }
                else
                {
                    ClearMyCustomers();//解除合作关系
                }
            }
            //获取当前页
            pageIndex = Utils.GetInt(Request.QueryString["Page"], 1);
            //获取查询条件
            int    province    = Utils.GetInt(Utils.InputText(Server.UrlDecode(Request.QueryString["province"] ?? ""))); //省份ID
            int    city        = Utils.GetInt(Utils.InputText(Server.UrlDecode(Request.QueryString["city"] ?? "")));     //城市ID
            string companyName = Utils.InputText(Server.UrlDecode(Request.QueryString["companyname"] ?? ""));            //公司名
            string admin       = Utils.InputText(Server.UrlDecode(Request.QueryString["admin"] ?? ""));                  //负责人
            string brand       = Utils.InputText(Server.UrlDecode(Request.QueryString["brand"] ?? ""));                  //品牌
            string myCompanyId = SiteUserInfo.CompanyID;

            EyouSoft.Model.CompanyStructure.QueryParamsCompany query = new EyouSoft.Model.CompanyStructure.QueryParamsCompany();
            query.CityId       = city;
            query.PorvinceId   = province;
            query.CompanyBrand = brand;
            query.CompanyName  = companyName;
            query.ContactName  = admin;
            //绑定我的客户
            IList <EyouSoft.Model.CompanyStructure.MyCustomer> myCustomerList = myCustomerBll.GetList(myCompanyId, query, pageSize, pageIndex, ref recordCount);

            if (myCustomerList != null && myCustomerList.Count > 0)
            {
                alc_rpt_customers.DataSource = myCustomerList;
                alc_rpt_customers.DataBind();
                BindPage(province, city, companyName, admin, brand);
            }
            else
            {
                alc_rpt_customers.EmptyText  = "<tr><td style='text-align:center'>暂无客户信息</td></tr>";
                this.ExportPageInfo1.Visible = false;
            }

            //清除对象
            myCustomerList = null;
            myCustomerBll  = null;
            cityBll        = null;
            provinceBll    = null;
            tourOrderBLL   = null;
            //恢复查询条件
            mc_pc.SetProvinceId     = province;
            mc_pc.SetCityId         = city;
            mc_txtAdmin.Value       = admin;
            mc_txtBrand.Value       = brand;
            mc_txtCompanyName.Value = companyName;
        }