Esempio n. 1
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));
                }
            }
        }
Esempio n. 2
0
        private bool DoAdd()
        {
            try
            {
                Model.category model = new Model.category();
                BLL.category   bll   = new BLL.category();

                model.channel_id      = this.channel_id;
                model.call_index      = txtCallIndex.Text.Trim();
                model.title           = txtTitle.Text.Trim();
                model.parent_id       = int.Parse(ddlParentId.SelectedValue);
                model.sort_id         = int.Parse(txtSortId.Text.Trim());
                model.seo_title       = txtSeoTitle.Text;
                model.seo_keywords    = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url        = txtLinkUrl.Text.Trim();
                model.img_url         = txtImgUrl.Text.Trim();
                model.content         = txtContent.Value;
                if (bll.Add(model) < 1)
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
            return(true);
        }
Esempio n. 3
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();
 }
Esempio n. 4
0
        private bool DoEdit(int _id)
        {
            try
            {
                BLL.category   bll      = new BLL.category();
                Model.category model    = bll.GetModel(_id);
                int            parentId = int.Parse(ddlParentId.SelectedValue);

                model.channel_id = this.channel_id;
                model.call_index = txtCallIndex.Text.Trim();
                model.title      = txtTitle.Text.Trim();
                //如果選擇的父ID不是自己,則更改
                if (parentId != model.id)
                {
                    model.parent_id = parentId;
                }
                model.sort_id         = int.Parse(txtSortId.Text.Trim());
                model.seo_title       = txtSeoTitle.Text;
                model.seo_keywords    = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url        = txtLinkUrl.Text.Trim();
                model.img_url         = txtImgUrl.Text.Trim();
                model.content         = txtContent.Value;
                if (!bll.Update(model))
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
            return(true);
        }
Esempio n. 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));
                }
            }
        }
Esempio n. 6
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));
                }
            }
        }
Esempio n. 7
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));
                }
            }
        }
Esempio n. 8
0
        private void RptBind()
        {
            BLL.category bll = new BLL.category();
            DataTable    dt  = bll.GetList(0, 6);

            this.rptList.DataSource = dt;
            this.rptList.DataBind();
        }
Esempio n. 9
0
 /// <summary>
 /// 返回当前类别名称
 /// </summary>
 /// <param name="category_id">类别ID</param>
 /// <returns>String</returns>
 protected string get_category_title(int category_id, string default_value)
 {
     BLL.category bll = new BLL.category();
     if (bll.Exists(category_id))
     {
         return bll.GetTitle(category_id);
     }
     return default_value;
 }
Esempio n. 10
0
 /// <summary>
 /// 返回当前类别名称
 /// </summary>
 /// <param name="category_id">类别ID</param>
 /// <returns>String</returns>
 protected string get_category_title(int category_id, string default_value)
 {
     BLL.category bll = new BLL.category();
     if (bll.Exists(category_id))
     {
         return(bll.GetTitle(category_id));
     }
     return(default_value);
 }
Esempio n. 11
0
 /// <summary>
 /// 返回当前类别频道模型
 /// </summary>
 /// <param name="category_id">类别ID</param>
 /// <returns>String</returns>
 protected Model.sys_channel get_channel_by_catagoryid(int category_id)
 {
     BLL.category bll = new BLL.category();
     if (bll.Exists(category_id))
     {
         return bll.GetChannelModel(category_id);
     }
     return null; 
 }
Esempio n. 12
0
 /// <summary>
 /// 递归找到父节点
 /// </summary>
 private void LoopChannelMenu(StringBuilder strTxt, string urlKey, int category_id)
 {
     BLL.category bll = new BLL.category();
     int parentId = bll.GetParentId(category_id);
     if (parentId > 0)
     {
         this.LoopChannelMenu(strTxt, urlKey, parentId);
     }
     strTxt.Append("&nbsp;&gt;&nbsp;<a href=\"" + linkurl(urlKey, category_id, 1) + "\">" + bll.GetTitle(category_id) + "</a>");
 }
Esempio n. 13
0
        /// <summary>
        /// 递归找到父节点
        /// </summary>
        private void LoopChannelMenu(StringBuilder strTxt, string urlKey, int category_id)
        {
            BLL.category bll      = new BLL.category();
            int          parentId = bll.GetParentId(category_id);

            if (parentId > 0)
            {
                this.LoopChannelMenu(strTxt, urlKey, parentId);
            }
            strTxt.Append("&nbsp;&gt;&nbsp;<a href=\"" + linkurl(urlKey, category_id, 1) + "\">" + bll.GetTitle(category_id) + "</a>");
        }
Esempio n. 14
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();
            }
        }
Esempio n. 15
0
        //protected void btnSave_Click(object sender, EventArgs e)
        //{
        //    Model.article_comment model = new Model.article_comment();
        //    //HttpCookie cook = Request.Cookies["WEBUSERID"];
        //    string cook = Utils.GetCookie("WEBUSERID").ToString();
        //    if (cook == null)
        //    {
        //        this.Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('請先登入');window.location.href='login_vip.aspx'</script>");
        //    }
        //    else
        //    {
        //        //ids = cook.Value;
        //    }
        //    string Content = Request.Form["txtContent"];

        //    model.content = DTcms.Common.Utils.ToHtml(Content);
        //    model.article_id = id;
        //    model.user_ip = DTcms.Common.DTRequest.GetIP();
        //    BLL.article_comment bll = new BLL.article_comment();
        //    bll.Add(model);
        //    this.Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('送出成功');window.location.href='productview.aspx?id=" + id + "&mid=2'</script>");
        //}
        #endregion


        #region 獲取分區標題
        public string GetUserArea(int ID)
        {
            string Name = string.Empty;

            if (ID != 0)
            {
                int          CataID = ID;
                BLL.category CATA   = new BLL.category();
                Name = CATA.GetTitle(CataID);
            }
            return(Name);
        }
Esempio n. 16
0
        public string GetCategory(string CID)
        {
            string cataName = string.Empty;

            if (!string.IsNullOrEmpty(CID))
            {
                int          ID     = Utils.StringToNum(CID);
                BLL.category bllcat = new BLL.category();
                cataName = bllcat.GetTitle(ID);
            }
            return(cataName);
        }
Esempio n. 17
0
        private void ShowInfo(int _id)
        {
            BLL.category   bll   = new BLL.category();
            Model.category model = bll.GetModel(_id);

            this.ddlParentId.SelectedValue = model.parent_id.ToString();
            this.txtTitle.Text             = model.title;
            this.txtSortId.Text            = model.sort_id.ToString();
            this.txtSeoTitle.Text          = model.seo_title;
            this.txtSeoKeywords.Text       = model.seo_keywords;
            this.txtSeoDescription.Text    = model.seo_description;
            this.txtLinkUrl.Text           = model.link_url;
            this.txtImgUrl.Text            = model.img_url;
            this.txtContent.Value          = model.content;
        }
Esempio n. 18
0
 //刪除類別
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel(channel_id, DTEnums.ActionEnum.Delete.ToString()); //檢查許可權
     BLL.category bll = new BLL.category();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             bll.Delete(id);
         }
     }
     JscriptMsg("批次刪除成功!", Utils.CombUrlTxt("list.aspx", "channel_id={0}", this.channel_id.ToString()), "Success");
 }
Esempio n. 19
0
 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BLL.category bll = new BLL.category();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateField(id, "sort_id=" + sortId.ToString());
     }
     JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("list.aspx", "channel_id={0}", this.channel_id.ToString()), "Success");
 }
Esempio n. 20
0
 //儲存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BLL.category bll = new BLL.category();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateField(id, "sort_id=" + sortId.ToString());
     }
     JscriptMsg("儲存排序成功!", Utils.CombUrlTxt("list.aspx", "channel_id={0}", this.channel_id.ToString()), "Success");
 }
Esempio n. 21
0
 //删除类别
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel(channel_id, DTEnums.ActionEnum.Delete.ToString()); //检查权限
     BLL.category bll = new BLL.category();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             bll.Delete(id);
         }
     }
     JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("list.aspx", "channel_id={0}", this.channel_id.ToString()), "Success");
 }
Esempio n. 22
0
        private void Bind(int page)
        {
            BLL.article  bll    = new BLL.article();
            BLL.category bllCat = new BLL.category();
            int          totalCount;
            int          pageSize = 20;

            //最新商品
            string where = "";
            if (!string.IsNullOrEmpty(Request.QueryString["Catacid"]) && DTRequest.GetQueryInt("Catacid") != 0)
            {
                where = " and category_id =" + Request.QueryString["Catacid"];
            }
            else
            {
                if (!string.IsNullOrEmpty(Request.QueryString["Pcid"]) && DTRequest.GetQueryInt("Pcid") != 0)
                {
                    if (bllCat.GetNextList(this.PartentID, channel_id).Rows.Count > 0)
                    {
                        where = " and category_id in (select ID from dt_category where  parent_id= " + Request.QueryString["Pcid"] + ")";
                    }
                    else
                    {
                        where = " and category_id =" + Request.QueryString["Pcid"];
                    }
                }
            }

            if (!string.IsNullOrEmpty(Request.QueryString["key"]) && Request.QueryString["key"] != "請輸入商品名稱")
            {
                where += " and title like '%" + Request.QueryString["key"] + "%'";
            }
            this.rptList.DataSource = bll.list_pagesWhere(page, this.pageSize, " and  channel_id=" + channel_id + "  and Status=1" + where, "  order by add_time desc");
            this.rptList.DataBind();


            //綁定頁碼
            this.totalCount = bll.GetTatalNum(" channel_id=" + channel_id + "  and Status=1" + where);
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("Search.aspx", "mid={0}&Pcid={1}&keywords={2}&property={3}&Catacid={4}&page={5}",
                                              this.channel_id.ToString(), this.PartentID.ToString(), Request.QueryString["key"], this.property, this.cataID.ToString(), "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Esempio n. 23
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;
        }
Esempio n. 24
0
        private void Bind()
        {
            BLL.article         bll   = new BLL.article();
            Model.article_goods model = bll.GetGoodsModel(id);
            if (model != null)
            {
                LabTel.Text        = model.dianhua;
                lblConnet.Text     = model.lianxiren;
                lblTitle.Text      = model.title;
                lblContent.Text    = model.content;
                Image1Url          = model.img_url;
                lblSellPrice.Text  = model.single_price.ToString();
                lblTotalPrice.Text = model.sell_price.ToString();
                lblyajin.Text      = model.shangpinType.ToString();
                lblZjprice.Text    = model.market_price.ToString();
                //lblzuoxiang.Text = model.zuoxiang;
                lblpingshu.Text = model.mianji.ToString();
                BLL.category   bllCata = new BLL.category();
                Model.category Cata    = bllCata.GetModel(model.xianlu);
                lblNo.Text = model.shequ;
                switch (model.category_id)
                {
                case 302:
                    hire.Visible = true;
                    sell.Visible = false;
                    break;

                case 303:
                    hire.Visible = false;
                    sell.Visible = true;
                    break;

                case 328:
                    hire.Visible = true;
                    sell.Visible = true;
                    break;
                }
                //if (Cata != null)
                //{
                //    int Pid = Cata.parent_id;
                //    string FirstStaton = bllCata.GetModel(Pid).title;
                if (model.quyu == 0 || string.IsNullOrEmpty(model.quyu.ToString()))
                {
                    lblStation.Text = "無資料";
                }
                else
                {
                    lblStation.Text = model.quyu.ToString() + "%";
                }

                // }
                lblhuxing.Text   = model.stock_quantity == 1 ? "有" : "無";
                Cata             = bllCata.GetModel(model.category_id);
                lblxingneng.Text = model.xingneng;
                lblAge.Text      = model.fuwuxiangju.ToString();
                if (!string.IsNullOrEmpty(model.link_url))
                {
                    lbllouceng.Text = model.link_url.ToString();
                }
                //if (Cata != null)
                //{
                //    lblyongtu.Text = Cata.title;
                //}
                lblFenQu.Text = GetUserArea(model.point);
                if (model.jiaqianQJ == 0 || string.IsNullOrEmpty(model.jiaqianQJ.ToString()))
                {
                    lblchwei.Text = "無資料";
                }
                else
                {
                    lblchwei.Text = model.jiaqianQJ.ToString() + "%";
                }
                //lblshequ.Text = model.shequ;

                if (model.huxing == 0 || string.IsNullOrEmpty(model.huxing.ToString()))
                {
                    lbldizhi.Text = "無資料";
                }
                else
                {
                    lbldizhi.Text = model.huxing.ToString() + "米";
                }
                string Adress = model.dizhi;
                string Values = model.goods_no;
                big5Address = System.Web.HttpUtility.UrlEncode(Adress, Encoding.GetEncoding("UTF-8"));
                if (!string.IsNullOrEmpty(Values))
                {
                    if (Values.IndexOf('|') > 0)
                    {
                        string[] ArrList = Values.Split('|');
                        X = ArrList[0];
                        Y = ArrList[1];
                    }
                }

                foreach (var item in model.albums)
                {
                    Images += " <li><a  href='" + item.small_img + "'><img src=\"" + item.small_img + "\" alt=\"" + item.remark + "\" width=\"68\" height=\"50\" rel=\"" + item.big_img + "\"/></a></li>";
                }
                repdateImgae.DataSource = model.albums;
                repdateImgae.DataBind();
            }
        }
        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 ;
        }
Esempio n. 26
0
        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
        }
Esempio n. 27
0
        private bool DoEdit(int _id)
        {
            try
            {
                BLL.category bll = new BLL.category();
                Model.category model = bll.GetModel(_id);
                int parentId = int.Parse(ddlParentId.SelectedValue);

                model.channel_id = this.channel_id;
                model.title = txtTitle.Text.Trim();
                //如果选择的父ID不是自己,则更改
                if (parentId != model.id)
                {
                    model.parent_id = parentId;
                }
                model.sort_id = int.Parse(txtSortId.Text.Trim());
                model.seo_title = txtSeoTitle.Text;
                model.seo_keywords = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url = txtLinkUrl.Text.Trim();
                model.img_url = txtImgUrl.Text.Trim();
                model.content = txtContent.Value;
                if (!bll.Update(model))
                {
                    return false;
                }
            }
            catch
            {
                return false;
            }
            return true;
        }
Esempio n. 28
0
        private void Bind()
        {
            BLL.article         bll   = new BLL.article();
            Model.article_goods model = bll.GetGoodsModel(id);
            if (model != null)
            {
                p_1.Visible   = false;
                p_2_3.Visible = true;
                p_2.Visible   = false;
                if (model.category_id == 298)
                {
                    p_1.Visible   = true;
                    p_2_3.Visible = false;
                    p_2.Visible   = false;
                }
                if (model.category_id == 299)
                {
                    pingshu.Visible = false;
                    p_1.Visible     = false;
                    p_2_3.Visible   = false;
                    p_2.Visible     = true;
                }

                LabTel.Text       = model.dianhua;
                lblConnet.Text    = model.lianxiren;
                lblTitle.Text     = model.title;
                lblSingPrice.Text = model.yongtu;
                lblContent.Text   = model.content;
                Image1Url         = model.img_url;
                lblprice.Text     = model.sell_price.ToString();
                //lblyajin.Text = model.yajin.ToString();
                lblZjprice.Text  = model.sell_price.ToString();
                lblzuoxiang.Text = model.zuoxiang;
                lblpingshu.Text  = model.mianji.ToString();
                BLL.category   bllCata = new BLL.category();
                Model.category Cata    = bllCata.GetModel(model.xianlu);
                if (Cata != null)
                {
                    int    Pid         = Cata.parent_id;
                    string FirstStaton = bllCata.GetModel(Pid).title;
                    lblStation.Text = FirstStaton + "-" + Cata.title;
                }
                lblhuxing.Text   = GetTypleWhereTilte(model.huxing, null);
                Cata             = bllCata.GetModel(model.category_id);
                lblxingneng.Text = model.xingneng;
                lblAge.Text      = model.digg_good.ToString();
                if (!string.IsNullOrEmpty(model.louceng))
                {
                    lbllouceng.Text = model.louceng.ToString();
                }
                if (Cata != null)
                {
                    lblyongtu.Text = Cata.title;
                }

                lblchwei.Text = model.chewei;
                lblPort.Text  = model.chewei;
                lblshequ.Text = model.shequ;
                lbldizhi.Text = model.dizhi;
                string Adress = model.dizhi;
                string Values = model.goods_no;
                big5Address = System.Web.HttpUtility.UrlEncode(Adress, Encoding.GetEncoding("UTF-8"));
                if (!string.IsNullOrEmpty(Values))
                {
                    if (Values.IndexOf('|') > 0)
                    {
                        string[] ArrList = Values.Split('|');
                        X = ArrList[0];
                        Y = ArrList[1];
                    }
                }

                foreach (var item in model.albums)
                {
                    Images += " <li><a  href='" + item.small_img + "'><img src=\"" + item.small_img + "\" alt=\"" + item.remark + "\" width=\"68\" height=\"50\" rel=\"" + item.big_img + "\"/></a></li>";
                }

                #region 宴會廳
                lblDestTable.Text = model.link_url;  //桌數
                lblkictich.Text   = "無";
                if (model.stock_quantity == 1)
                {
                    lblkictich.Text = "有";   //廚房
                }
                lblStag.Text = "無";
                if (model.fangshi == 1)
                {
                    lblStag.Text = "有"; //舞台
                }
                lblMuisu.Text = "無";
                if (model.quyu == 1)
                {
                    lblMuisu.Text = "無";    //音響
                }
                lbllou1.Text = model.louceng;

                #endregion

                #region 戶外廣告
                lblForm.Text   = model.shangpinType;
                lblLou2.Text   = model.louceng;
                lblChiCun.Text = model.fuwuxiangju;

                #endregion

                repdateImgae.DataSource = model.albums;
                repdateImgae.DataBind();
            }
        }
Esempio n. 29
0
        private void ShowInfo(int _id)
        {
            BLL.category bll = new BLL.category();
            Model.category model = bll.GetModel(_id);

            this.ddlParentId.SelectedValue = model.parent_id.ToString();
            this.txtTitle.Text = model.title;
            this.txtSortId.Text = model.sort_id.ToString();
            this.txtSeoTitle.Text = model.seo_title;
            this.txtSeoKeywords.Text = model.seo_keywords;
            this.txtSeoDescription.Text = model.seo_description;
            this.txtLinkUrl.Text = model.link_url;
            this.txtImgUrl.Text = model.img_url;
            this.txtContent.Value = model.content;
        }
Esempio n. 30
0
        private bool DoAdd()
        {
            try
            {
                Model.category model = new Model.category();
                BLL.category bll = new BLL.category();

                model.channel_id = this.channel_id;
                model.title = txtTitle.Text.Trim();
                model.parent_id = int.Parse(ddlParentId.SelectedValue);
                model.sort_id = int.Parse(txtSortId.Text.Trim());
                model.seo_title = txtSeoTitle.Text;
                model.seo_keywords = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url = txtLinkUrl.Text.Trim();
                model.img_url = txtImgUrl.Text.Trim();
                model.content = txtContent.Value;
                if (bll.Add(model) < 1)
                {
                    return false;
                }
            }
            catch
            {
                return false;
            }
            return true;
        }
Esempio n. 31
0
        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
        }
Esempio n. 32
0
        private void ShowInfo(int _id)
        {
            BLL.category bll = new BLL.category();
            Model.category model = bll.GetModel(_id);

            ddlParentId.SelectedValue = model.parent_id.ToString();
            txtCallIndex.Text = model.call_index;
            txtTitle.Text = model.title;
            txtSortId.Text = model.sort_id.ToString();
            rblVisible.SelectedValue = model.visible.ToString();
            txtSeoKeywords.Text = model.signtype;
            txtSeoDescription.Text = model.seo_description;
            txtLinkUrl.Text = model.link_url;
            txtImgUrl.Text = model.img_url;
            txtContent.Value = model.content;
        }