Exemple #1
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);
        }
        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;
        }
Exemple #3
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 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;
        }
        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;
        }
        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;
        }
        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();
            }
        }