コード例 #1
0
        //end

        #endregion

        #region Event click
        protected void btnLayout_Click(object sender, EventArgs e)
        {
            int ChildID = Convert.ToInt32(Request["ID"]);

            HPCBusinessLogic.DAL.T_NewsDAL tt = new HPCBusinessLogic.DAL.T_NewsDAL();
            T_News _objNewsCurr  = new T_NewsDAL().load_T_news(ChildID);
            int    Get_T_News_ID = int.Parse(_objNewsCurr.News_CopyFrom.ToString());
            T_News _objNews      = new T_News();

            if (tt.Get_NewsVersion(Get_T_News_ID, 7, 92) || tt.Get_NewsVersion(Get_T_News_ID, 7, 82))
            {
                _objNews              = tt.load_T_news(Get_T_News_ID);
                this.txt_tomtat.Text  = txt_tomtat.Text + "<br />" + _objNews.News_Summary;
                this.txt_noidung.Text = txt_noidung.Text + "<br />" + _objNews.News_Body;
            }
        }
コード例 #2
0
        private void PopulateItem(int _id)
        {
            //Lấy ID trong T_AutoSave
            AutoSavesDAL _dal        = new AutoSavesDAL();
            int          id_autoSave = _dal.Get_ID_AutoSave(_id, _user.UserID);

            txtID.Text = id_autoSave.ToString();
            //end
            HPCBusinessLogic.DAL.T_NewsDAL _untilDAL = new HPCBusinessLogic.DAL.T_NewsDAL();
            HPCInfo.T_News _obj = new T_News();
            _obj = _untilDAL.load_T_news(_id);
            if (_obj != null)
            {
                this.txt_Author_name.Text = _obj.News_AuthorName;
                this.Txt_tieude.Text      = _obj.News_Tittle;
                this.txt_TieuDePhu.Text   = _obj.News_Sub_Title;
                this.txt_noidung.Text     = _obj.News_Body;
                //this.ddlNews_Priority.SelectedValue = _obj.News_Priority.ToString();
                this.chk_IsCategorys.Checked       = _obj.News_IsCategorys;
                this.chk_IsHomePages.Checked       = _obj.News_IsHomePages;
                this.chk_IsCategoryParrent.Checked = _obj.News_IsCategoryParrent;
                this.chkHistorys.Checked           = _obj.News_IsHistory;
                this.chkImages.Checked             = _obj.News_IsImages;
                this.chkVideo.Checked = _obj.News_IsVideo;
                if (_obj.News_TienNB > 0.0)
                {
                    this.txtTienNhuanBut.Text = string.Format("{0:#,#}", _obj.News_TienNB).Replace(".", ",");
                }
                //this.ddlNews_IsType.SelectedValue = _obj.News_IsType.ToString();
                this.chkNewsIsFocus.Checked = _obj.News_IsFocus;
                this.chkNewsIsHot.Checked   = _obj.News_IsHot;
                if (_obj.Images_Summary.Length > 0)
                {
                    this.ImgTemp.Src = HPCComponents.Global.UploadPathBDT + _obj.Images_Summary;
                }
                else
                {
                    this.ImgTemp.Attributes.CssStyle.Add("display", "none");
                }
                this.Txt_Comments.Text = _obj.News_Comment;
                this.txt_tomtat.Text   = _obj.News_Summary;
                this.txtThumbnail.Text = _obj.Images_Summary;
                this.txtTukhoa.Text    = _untilDAL.GetKeywordsByNewsID(_id);

                this.cbo_lanquage.SelectedValue = _obj.Lang_ID.ToString();
                this.cbo_chuyenmuc.Items.Clear();
                if (cbo_lanquage.SelectedIndex > 0)
                {
                    UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cbo_lanquage.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by Ten_ChuyenMuc ASC");
                    cbo_chuyenmuc.UpdateAfterCallBack = true;
                    cbo_chuyenmuc.SelectedIndex       = CommonLib.GetIndexControl(cbo_chuyenmuc, _obj.CAT_ID.ToString());
                }
                else
                {
                    this.cbo_chuyenmuc.DataSource = null;
                    this.cbo_chuyenmuc.DataBind();
                    this.cbo_chuyenmuc.UpdateAfterCallBack = true;
                }
                //bind bai viet lien quan
                if (_obj.News_Realate.ToString().Trim() != "")
                {
                    txtListID.Text = _obj.News_Realate.ToString().Trim().Replace(",0", "");
                }
                LoadNewRealation();
                txtVideoPath.Text            = _obj.News_PhotoAtt;
                txtChuthichanh.Text          = _obj.News_DescImages;
                this.cbHienthiAnh.Checked    = _obj.Image_Hot;
                this.txtNguon.Text           = _obj.News_Nguon;
                this.cbDisplayMobile.Checked = _obj.News_DisplayMobile;
                this.cbMoreViews.Checked     = _obj.News_Delete;
                //if (_obj.Image_Hot)
                //    this.cbHienthiAnh.Text = "Hiển thị trong tin chi tiết";
                //else
                //    this.cbHienthiAnh.Text = "Không hiển thị trong tin chi tiết";

                if (_obj.News_DatePublished.ToString() != "1/1/0001 12:00:00 AM" && _obj.News_DatePublished.ToString() != "01/01/0001 12:00:00 SA")
                {
                    this.txtTimeXB.Text = _obj.News_DatePublished.ToString("dd/MM/yyyy HH:mm");
                }
                if (_untilDAL.Get_NewsVersion(_untilDAL.load_T_news(Convert.ToInt32(_id)).News_CopyFrom, 7, 92) ||
                    _untilDAL.Get_NewsVersion(_untilDAL.load_T_news(Convert.ToInt32(_id)).News_CopyFrom, 7, 82))
                {
                    btn_Layout.Visible = true;
                }
                else
                {
                    btn_Layout.Visible = false;
                }
            }
        }