Exemplo n.º 1
0
        /// <summary>
        /// 获的所有的销售城市
        /// </summary>
        protected void GetAllSaleCity()
        {
            StringBuilder strAllCity = new StringBuilder();

            IList <EyouSoft.Model.SystemStructure.SysProvince> ProvinceList = EyouSoft.BLL.SystemStructure.SysProvince.CreateInstance().GetProvinceList();

            if (ProvinceList != null && ProvinceList.Count > 0)
            {
                EyouSoft.IBLL.SystemStructure.ISysCity Citybll = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance();
                foreach (EyouSoft.Model.SystemStructure.SysProvince Province in ProvinceList)
                {
                    IList <EyouSoft.Model.SystemStructure.SysCity> Citylist;
                    string isAll = Utils.GetQueryStringValue("isall");
                    if (isAll == "yes")
                    {
                        Citylist = Citybll.GetSysCityList(Province.ProvinceId, null);
                    }
                    else
                    {
                        Citylist = Citybll.GetSaleCity(null, new int[] { Province.ProvinceId });
                    }
                    if (Citylist != null && Citylist.Count > 0)
                    {
                        strAllCity.Append("<tr bgcolor=\"#DBF7FD\" >");
                        strAllCity.Append("<td align=\"center\">");
                        strAllCity.AppendFormat("<input  type=\"checkbox\" name='ckProvince' id=\"ckAllCity_{1}\" onclick=\"OtherAllSaleCity.ckAllProvinceCity(this);\"/><label for=\"ckAllCity_{1}\" style=\"cursor:pointer\">{0}</label>:", Province.ProvinceName, Province.ProvinceId);

                        strAllCity.Append("</td>");
                        strAllCity.Append("<td align=\"left\" bgcolor=\"#FFFFFF\">");
                        string allCity = "";
                        int    Count   = 0;
                        foreach (EyouSoft.Model.SystemStructure.SysCity City in Citylist)
                        {
                            allCity += string.Format("<input id=\"thisCity_{0}\"  type=\"checkbox\"  value=\"{0}\" name=\"checkbox_Area\" /><label for=\"thisCity_{0}\" style=\"cursor:pointer\">{1}</label> ", City.CityId, City.CityName);
                            Count++;
                            if (Count != 0 && Count % 8 == 0)
                            {
                                allCity += "<br/>";
                            }
                        }
                        strAllCity.Append(allCity);
                        strAllCity.Append("</td>");
                        strAllCity.Append("</tr>");
                    }
                    Citylist = null;
                }
                Citybll = null;
            }
            ProvinceList = null;

            strAllCityList = strAllCity.ToString();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获得所有的省份,销售城市,初始化数据
        /// </summary>
        private void InitData()
        {
            string str1         = "";
            string str2         = "";
            int    AllByteCount = 50;
            string strDefault   = "";
            IList <EyouSoft.Model.SystemStructure.SysProvince> ProvinceList = EyouSoft.BLL.SystemStructure.SysProvince.CreateInstance().GetProvinceList();

            if (ProvinceList != null && ProvinceList.Count > 0)
            {
                EyouSoft.IBLL.SystemStructure.ISysCity Citybll = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance();
                foreach (EyouSoft.Model.SystemStructure.SysProvince Province in ProvinceList)
                {
                    IList <EyouSoft.Model.SystemStructure.SysCity> Citylist = Citybll.GetSaleCity(null, new int[] { Province.ProvinceId });

                    if (Citylist != null && Citylist.Count > 0)
                    {
                        if (Province.AreaId == EyouSoft.Model.SystemStructure.ProvinceAreaType.直辖市)//表明直辖市
                        {
                            str1 += string.Format("<a id='p_{1}' href='javascript:void(0)' onclick='ChangeProvinceName(this,{0})' {3}><strong>{2}</strong></a><span style='letter-spacing: -3px'> | </span>", Citylist[0].CityId, Province.ProvinceId, Province.ProvinceName, Province.ProvinceId == ProvinceId ? "style='color:Red'" : "");
                        }
                        else
                        {
                            string name = string.Format("{0}  |  ", Province.ProvinceName);
                            if (Utils.GetByteLength(strDefault + name) > AllByteCount)
                            {
                                str2      += "<br />";
                                strDefault = name;
                            }
                            else
                            {
                                strDefault += name;
                            }
                            str2 += string.Format("<a id='p_{1}' href='javascript:void(0)' onclick='ChangeProvinceName(this,{0})' {3}>{2}</a><span style='letter-spacing: -3px'>&nbsp;|&nbsp;</span>", Citylist[0].CityId, Province.ProvinceId, Province.ProvinceName, Province.ProvinceId == ProvinceId ? "style='color:Red'" : "");
                        }
                        foreach (EyouSoft.Model.SystemStructure.SysCity cityModel in Citylist)
                        {
                            //获得当前省份下的销售城市信息
                            strSiteName += string.Format("<label pid='{3}'><a id='c_{0}' href='javascript:void(0)' onclick='ChangeSiteName(this,{0})' {2}>{1}</a><span style='letter-spacing: -3px'>&nbsp;|&nbsp;</span></label>", cityModel.CityId, cityModel.CityName, cityModel.CityId == CityId ? "style='color:Red'" : "", cityModel.ProvinceId);
                        }
                        Citylist = null;
                    }
                }
                //strSiteName = strSiteName.Length > 0 ? strSiteName.Substring(0, strSiteName.LastIndexOf("|")) : "";
            }
            ProvinceArray = new string[] { str1.Length > 0 ? str1.Substring(0, str1.LastIndexOf("|")) : "", str2.Length > 0 ? str2.Substring(0, str2.LastIndexOf("|")) : "" };
        }