protected 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) { cbo_lanquage.SelectedIndex = UltilFunc.GetIndexControl(cbo_lanquage, _obj.Lang_ID.ToString()); 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; } 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 = _obj.News_TienNB.ToString(); //System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "Comma('" + txtTienNhuanBut.ClientID + "');", true); 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.TinPathBDT + "/" + _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); //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; } }
protected 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 T_News obj_T_news = new T_News(); HPCBusinessLogic.DAL.T_NewsDAL ObjDAl = new HPCBusinessLogic.DAL.T_NewsDAL(); obj_T_news = ObjDAl.load_T_news(_ID); this.Txt_tieude.Text = obj_T_news.News_Tittle.ToString(); this.txtTukhoa.Text = ObjDAl.GetKeywordsByNewsID(_ID); this.txt_TieuDePhu.Text = obj_T_news.News_Sub_Title.ToString(); this.txt_tomtat.Text = obj_T_news.News_Summary.ToString(); this.txt_noidung.Text = obj_T_news.News_Body.ToString(); this.Txt_Comments.Text = obj_T_news.News_Comment.ToString(); this.txt_Author_name.Text = obj_T_news.News_AuthorName.ToString(); this.txtThumbnail.Text = obj_T_news.Images_Summary; if (obj_T_news.Images_Summary.ToString().Length > 0) { this.ImgTemp.Src = HPCComponents.Global.UploadPathBDT + obj_T_news.Images_Summary; } else { this.ImgTemp.Attributes.CssStyle.Add("display", "none"); } this.cbo_lanquage.SelectedValue = obj_T_news.Lang_ID.ToString(); this.chk_IsCategorys.Checked = obj_T_news.News_IsCategorys; this.chk_IsHomePages.Checked = obj_T_news.News_IsHomePages; this.chk_IsCategoryParrent.Checked = obj_T_news.News_IsCategoryParrent; this.chkNewsIsFocus.Checked = obj_T_news.News_IsFocus; this.chkNewsIsHot.Checked = obj_T_news.News_IsHot; this.chkHistorys.Checked = obj_T_news.News_IsHistory; this.chkImages.Checked = obj_T_news.News_IsImages; this.chkVideo.Checked = obj_T_news.News_IsVideo; if (obj_T_news.News_TienNB > 0.0) { this.txtTienNhuanBut.Text = string.Format("{0:#,#}", obj_T_news.News_TienNB).Replace(".", ","); } 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 ThuTuHienThi ASC"); cbo_chuyenmuc.UpdateAfterCallBack = true; cbo_chuyenmuc.SelectedIndex = CommonLib.GetIndexControl(cbo_chuyenmuc, obj_T_news.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_T_news.News_Realate.ToString().Trim() != "") { txtListID.Text = obj_T_news.News_Realate.ToString().Trim().Replace(",0", ""); } LoadNewRealation(); //Add By nvthai //obj_T_news.News_Priority == 1; txtVideoPath.Text = obj_T_news.News_PhotoAtt; txtChuthichanh.Text = obj_T_news.News_DescImages; this.cbHienthiAnh.Checked = obj_T_news.Image_Hot; this.txtNguon.Text = obj_T_news.News_Nguon; this.cbDisplayMobile.Checked = obj_T_news.News_DisplayMobile; this.cbMoreViews.Checked = obj_T_news.News_Delete; }
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; } } }