Пример #1
0
    private void LoadPostInfo()
    {
        try
        {
            posts = new PostBLL();
            Post post = posts.ListPostWithPostCode(Request.QueryString["PostCode"]).FirstOrDefault();
            txtPostTitleVN.Value     = post.TitleVN;
            txtPostTitleEN.Value     = post.TitleEN;
            EditorPostContentVN.Text = post.PostContentVN;
            EditorPostContentEN.Text = post.PostContentEN;
            txtMetaTitle.Text        = post.MetaTitle;
            txtMetaKeywords.Text     = post.MetaKeywords;
            txtMetaDescription.Text  = post.MetaDescriptions;
            chkTopHot.Checked        = post.TopHot;
            lblpost_status.Text      = (post.PostStatus) ? " -- Đăng bài --" : " -- Chờ xét duyệt  --";
            dlpost_status.Items.FindByValue((post.PostStatus) ? "1" : "0").Selected = true;

            lblTimePost.Text = post.PostTime.ToString();
            this.load_Checkcbltag(post.ID);

            images              = new ImagesBLL();
            imgpost.Src         = (images.ListWithID(post.PostImages).FirstOrDefault() == null) ? "../../images/noimage.jpg.jpg" : "../../" + images.ListWithID(post.PostImages).FirstOrDefault().ImagesUrl;
            txtPostImgTemp.Text = (images.ListWithID(post.PostImages).FirstOrDefault() == null) ? "" : images.ListWithID(post.PostImages).FirstOrDefault().ImagesName;
            posts = new PostBLL();
            this.checkedTreeBoxCategory(posts.ListPostWithPostCode(Request.QueryString["PostCode"]).FirstOrDefault().ID.ToString());
        }
        catch (Exception ex)
        {
            this.AlertPageValid(true, ex.ToString(), alertPageValid, lblPageValid);
        }
    }
Пример #2
0
 protected void gwCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         btnEditCategory.Attributes.Add("class", "btn btn-circle btn-icon-only btn-default");
         btnchangeLBImageCT.Attributes.Add("class", "btn btn-circle btn-icon-only btn-default");
         this.load_dlEditParent();
         category = new CategoryBLL();
         int      ID  = Convert.ToInt32((gwCategory.SelectedRow.FindControl("lblCategoryID") as Label).Text);
         Category cat = category.ListCategoryWithID(ID).FirstOrDefault();
         txtENameVN.Text           = cat.NameVN;
         txtENameEN.Text           = cat.NameEN;
         txtEPermalink.Text        = cat.Permalink;
         txtESeoTitle.Text         = cat.SeoTitle;
         txtEMetaTitle.Text        = cat.MetaTitle;
         txtEMetaKeywords.Text     = cat.MetaKeywords;
         txtEMetaDescriptions.Text = cat.MetaDescriptions;
         dlEParent.Items.FindByValue(cat.Parent.ToString()).Selected = true;
         chkUpdateStatus.Checked = cat.CategoryStatus;
         chkShowHome.Checked     = cat.ShowOnHome;
         images = new ImagesBLL();
         Images img = images.ListWithID(cat.CateogryImage).FirstOrDefault();
         ImageUpdate.ImageUrl = (img == null) ? "#" : "../../" + img.ImagesUrl;
     }
     catch (Exception ex)
     {
         this.AlertPageValid(true, ex.ToString(), alertPageValid, lblPageValid);
     }
 }
Пример #3
0
 protected void gwSubSlider_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         subslider = new SubSliderBLL();
         images    = new ImagesBLL();
         btnfixSubSlider.Attributes.Add("class", "btn btn-default");
         btnselectImg.Attributes.Add("class", "btn btn-default");
         int       ID  = Convert.ToInt32((gwSubSlider.SelectedRow.FindControl("lblID") as Label).Text);
         SubSlider sub = subslider.ListWithID(ID).FirstOrDefault();
         txtETitle.Text        = sub.Title;
         txtEDescription.Text  = sub.Descriptions;
         txtERedirectLink.Text = sub.RedirectLink;
         Images img = images.ListWithID(sub.SliderImg).FirstOrDefault();
         ImgEditImages.ImageUrl  = (img == null) ? "#" : "../../" + img.ImagesUrl;
         chkEditStatus.Checked   = sub.SliderStatus;
         UploadEditImage.ToolTip = (img == null) ? "" : img.ImagesName;
     }
     catch (Exception ex)
     {
         this.AlertPageValid(true, ex.ToString(), alertPageValid, lblPageValid);
     }
 }