Exemple #1
0
        private void TreeBind(int _channel_id)
        {
            BLL.category bll       = new BLL.category();
            int          partentID = 0;

            if (channel_id == 10)
            {
                partentID = 329;
            }
            DataTable dt = bll.GetList(partentID, _channel_id);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("請選擇類別...", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                string Id         = dr["id"].ToString();
                int    ClassLayer = Utils.StringToNum(dr["class_layer"].ToString());
                string Title      = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
            }
            //捷运线
            int partent = 28;

            if (channel_id == 10)
            {
                partent = 44;
            }
            dt = bll.GetList(partent, 3);

            this.ddlditie.Items.Clear();
            this.ddlditie.Items.Add(new ListItem("請選擇類別...", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                string Id         = dr["id"].ToString();
                int    ClassLayer = Utils.StringToNum(dr["class_layer"].ToString());
                string Title      = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlditie.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlditie.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// 綁定類別
        /// </summary>
        private void GetCategory()
        {
            BLL.category bll = new BLL.category();
            DataTable    dt  = bll.GetList(0, channel_id);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("請選擇類別...", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                string Id         = dr["id"].ToString();
                int    ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title      = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Exemple #3
0
        public void LoadArea(int _channel_id)
        {
            BLL.category bll = new BLL.category();
            //捷运线
            int partent = 0;

            if (channel_id == 10)
            {
                partent = 330;
            }
            DataTable dt = bll.GetList(partent, _channel_id);

            this.ddlArea.Items.Clear();
            this.ddlArea.Items.Add(new ListItem("請選擇類別...", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                string Id         = dr["id"].ToString();
                int    ClassLayer = Utils.StringToNum(dr["class_layer"].ToString());
                string Title      = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlArea.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlArea.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Exemple #4
0
 //数据绑定
 private void RptBind()
 {
     BLL.category bll = new BLL.category();
     DataTable dt = bll.GetList(0, this.channel_id);
     this.rptList.DataSource = dt;
     this.rptList.DataBind();
 }
Exemple #5
0
        private void TreeBind(int _channel_id)
        {
            BLL.category bll = new BLL.category();
            DataTable dt = bll.GetList(0, _channel_id);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("所有类别", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Exemple #6
0
        private void RptBind()
        {
            BLL.category bll = new BLL.category();
            DataTable    dt  = bll.GetList(0, 6);

            this.rptList.DataSource = dt;
            this.rptList.DataBind();
        }
Exemple #7
0
        private void RptBind()
        {
            BLL.category bll       = new BLL.category();
            int          partentID = 0;
            DataTable    dt        = bll.GetList(partentID, this.channel_id);

            if (dt.Rows.Count > 0)
            {
                rptList.DataSource = dt.DefaultView;
                rptList.DataBind();
            }
        }
Exemple #8
0
        void list()
        {
            BLL.category bll       = new BLL.category();
            string       CatList   = string.Empty;
            string       FirstName = bll.GetTitle(PartentID);
            string       keyWords  = string.Empty;

            // CatList = "<h3><a href='Search.aspx?Pcid=" + PartentID + "&mid=" + channel_id + "&Catacid=" + PartentID + "'>" + FirstName + "</a></h3>";
            CatList = "<h3>" + FirstName + "</h3>";
            if (!string.IsNullOrEmpty(Request.QueryString["key"]) && Request.QueryString["key"] != "請輸入商品名稱")
            {
                keyWords = Request.QueryString["key"];
            }
            DataTable dt = bll.GetNextList(this.PartentID, channel_id, keyWords);

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int    pID        = Utils.StringToNum(dt.Rows[i]["ID"].ToString());
                    string SecondName = dt.Rows[i]["title"].ToString();
                    CatList += "<h1><a href='Search.aspx?Pcid=" + PartentID + "&mid=" + channel_id + "&Catacid=" + pID + "'>" + SecondName + "</a></h1>";
                    DataTable dt1 = bll.GetList(pID, channel_id);
                    if (dt1 != null)
                    {
                        for (int j = 0; j < dt1.Rows.Count; j++)
                        {
                            pID = Utils.StringToNum(dt1.Rows[j]["ID"].ToString());
                            string ThreeName = dt1.Rows[j]["title"].ToString();
                            CatList += "<h2><a href='Search.aspx?Pcid=" + PartentID + "&mid=" + channel_id + "&Catacid=" + pID + "'>" + ThreeName + "</a></h2>";
                        }
                    }
                }
            }
            HtmlList.InnerHtml = CatList;
        }
        private void TreeBind(int _channel_id)
        {
            BLL.category bll = new BLL.category();

            DataTable dt_business = null;
            DataTable dt_discount = null;

            #region 绑定商家类型
            dt_business = bll.GetList(0, _channel_id, DTEnums.CategoryEnum.business.ToString());
            this.ddlBusiness.Items.Clear();
            //this.ddlBusiness.Items.Add(new ListItem("请选择商家类型...", ""));
            foreach (DataRow dr in dt_business.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlBusiness.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlBusiness.Items.Add(new ListItem(Title, Id));
                }
            }
            #endregion

            #region 绑定折扣
            dt_discount = bll.GetList(0, _channel_id, DTEnums.CategoryEnum.discount.ToString());
            this.ddlDiscount.Items.Clear();
            this.ddlDiscount.Items.Add(new ListItem("请选择折扣...", ""));
            foreach (DataRow dr in dt_discount.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlDiscount.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlDiscount.Items.Add(new ListItem(Title, Id));
                }
            }
            #endregion
        }
        private void businesschange(HttpContext context)
        {
            int business_id = DTRequest.GetQueryInt("business_id");
            int channel_id = (int)DTEnums.ChannelEnum.business;
            if (business_id == 0)
            {
                return;
            }
            DataTable dt_type = null;
            BLL.category bll = new BLL.category();
            switch (business_id)
            {
                case (int)DTEnums.CatergoryID.food:
                    dt_type = bll.GetList(0, channel_id, DTEnums.CategoryEnum.food.ToString());
                    break;
                case (int)DTEnums.CatergoryID.hotel:
                    dt_type = bll.GetList(0, channel_id, DTEnums.CategoryEnum.hotel.ToString());
                    break;
                case (int)DTEnums.CatergoryID.shop:
                    dt_type = bll.GetList(0, channel_id, DTEnums.CategoryEnum.shop.ToString());
                    break;
                case (int)DTEnums.CatergoryID.play:
                    dt_type = bll.GetList(0, channel_id, DTEnums.CategoryEnum.play.ToString());
                    break;
                case (int)DTEnums.CatergoryID.car:
                    dt_type = bll.GetList(0, channel_id, DTEnums.CategoryEnum.car.ToString());
                    break;
                case (int)DTEnums.CatergoryID.season:
                    dt_type = bll.GetList(0, channel_id, DTEnums.CategoryEnum.season.ToString());
                    break;
            }
            StringBuilder sb = new StringBuilder();
            //<option value='123'>a</option>
            foreach (DataRow dr in dt_type.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    sb.Append( string.Format("<option value='{0}'>{1}</option>", Id, Title));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    sb.Append(string.Format("<option value='{0}'>{1}</option>", Id, Title));
                }
            }
            context.Response.Write(sb.ToString());
            return ;
        }
        private void TreeBind(int _channel_id)
        {
            BLL.category bll = new BLL.category();
            BLL.cityinfo bll_city = new BLL.cityinfo();
            DataTable dt_grouptype, dt_property, dt_language, dt_pay, dt_account,dt_world = null;
            DataTable dt_city = null;

            #region 绑定旅团类型
            dt_grouptype = bll.GetList(0, _channel_id, DTEnums.CategoryEnum.tourgroup.ToString());
            this.ddlGroupType.Items.Clear();
            foreach (DataRow dr in dt_grouptype.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlGroupType.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlGroupType.Items.Add(new ListItem(Title, Id));
                }
            }
            #endregion

            #region 绑定语种
            dt_language = bll.GetList(0, _channel_id, DTEnums.CategoryEnum.language.ToString());
            this.ddlLanguage.Items.Clear();
            this.ddlLanguage.Items.Add(new ListItem("请选择语种...", "0"));
            foreach (DataRow dr in dt_language.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlLanguage.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlLanguage.Items.Add(new ListItem(Title, Id));
                }
            }
            #endregion

            #region 绑定账单周期
            dt_account = bll.GetList(0, _channel_id, DTEnums.CategoryEnum.period.ToString());
            this.ddlAccount.Items.Clear();
            this.ddlAccount.Items.Add(new ListItem("请选择账单周期...", "0"));
            foreach (DataRow dr in dt_account.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlAccount.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlAccount.Items.Add(new ListItem(Title, Id));
                }
            }
            #endregion

            #region 绑定支付类型
            dt_pay = bll.GetList(0, _channel_id, DTEnums.CategoryEnum.pay.ToString());
            this.ddlRestaurant.Items.Clear();
            this.ddlRestaurant.Items.Add(new ListItem("请选择餐厅支付类型...", "0"));
            this.ddlTicketType.Items.Clear();
            this.ddlTicketType.Items.Add(new ListItem("请选择门票支付类型...", "0"));
            foreach (DataRow dr in dt_pay.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlRestaurant.Items.Add(new ListItem(Title, Id));
                    this.ddlTicketType.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlRestaurant.Items.Add(new ListItem(Title, Id));
                    this.ddlTicketType.Items.Add(new ListItem(Title, Id));
                }
            }
            #endregion

            #region 绑定团属
            dt_property = bll.GetList(0, _channel_id, DTEnums.CategoryEnum.groupteam.ToString());
            this.ddlProperty.Items.Clear();
            this.ddlProperty.Items.Add(new ListItem("请选择团属...", "0"));
            foreach (DataRow dr in dt_property.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlProperty.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlProperty.Items.Add(new ListItem(Title, Id));
                }
            }
            #endregion

            #region 绑定国际线路
            //world
            dt_world = bll.GetList(0, _channel_id, DTEnums.CategoryEnum.world.ToString());
            this.ddlLineCity.Items.Clear();
            this.ddlLineCity.Items.Add(new ListItem("请选择线路...", "0"));
            foreach (DataRow dr in dt_world.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlLineCity.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlLineCity.Items.Add(new ListItem(Title, Id));
                }
            }
            #endregion

            #region  绑定城市
            dt_city = bll_city.GetChildList(0, _channel_id);

            this.ddlFromCity.Items.Clear();
            this.ddlFromCity.Items.Add(new ListItem("请选择省市...", ""));
            this.ddlToCity.Items.Clear();
            this.ddlToCity.Items.Add(new ListItem("请选择省市...", ""));
            foreach (DataRow dr in dt_city.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {

                    this.ddlFromCity.Items.Add(new ListItem(Title, Id));
                    this.ddlToCity.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;

                    this.ddlFromCity.Items.Add(new ListItem(Title, Id));
                    this.ddlToCity.Items.Add(new ListItem(Title, Id));
                }
            }
            #endregion
        }