Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <CouponInfo> coupon = new List <CouponInfo>();

            coupon = CouponHelper.GetHishop_Coupons();
            foreach (CouponInfo co in coupon)
            {
                ListItem item = new ListItem();
                item.Text  = co.Name;
                item.Value = co.CouponId.ToString();
                DDLcoupon.Items.Add(item);
            }
            if (!int.TryParse(this.Page.Request.QueryString["articleId"], out this.articleId))
            {
                base.GotoResourceNotFound();
            }
            else
            {
                this.btnAddArticle.Click += new EventHandler(this.btnAddArticle_Click);
                this.btnPicDelete.Click  += new EventHandler(this.btnPicDelete_Click);
                if (!this.Page.IsPostBack)
                {
                    this.dropArticleCategory.DataBind();
                    ArticleInfo article = ArticleHelper.GetArticle(this.articleId);
                    if (article == null)
                    {
                        base.GotoResourceNotFound();
                    }
                    else
                    {
                        Globals.EntityCoding(article, false);
                        this.txtArticleTitle.Text              = article.Title;
                        this.txtMetaDescription.Text           = article.MetaDescription;
                        this.txtMetaKeywords.Text              = article.MetaKeywords;
                        this.imgPic.ImageUrl                   = article.IconUrl;
                        this.txtShortDesc.Text                 = article.Description;
                        this.fcContent.Text                    = article.Content;
                        this.dropArticleCategory.SelectedValue = new int?(article.CategoryId);
                        this.btnPicDelete.Visible              = !string.IsNullOrEmpty(this.imgPic.ImageUrl);
                        this.ckrrelease.Checked                = article.IsRelease;
                    }
                }
            }
        }