protected void Page_Load(object sender, EventArgs e) { const string boxtname = "tuyensinhhome"; var zoneid = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname)); if (zoneid <= 0) { return; } var info = ZoneDB.GetInfo(zoneid); if (info == null) { return; } lnkOther.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID); string lang = AppEnv.GetLanguageFrontEnd(); var zoneClassRegister = ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + lang)); lnkRegister.NavigateUrl = UrlFilter.BuildUrlByZoneID(zoneClassRegister); var dtData = DistributionDB.GetContentByZoneIDselfAndNumberRecord(zoneid, 10); if (dtData.Rows.Count <= 0) { return; } rptData.DataSource = dtData; rptData.DataBind(); }
public static int GetIDByFriendlyUrl(string friendlyUrl) { var dbConn = new SqlConnection(AppEnv.ConnectionString); var dbCmd = new SqlCommand("CMS_Zones_GetIDByFriendlyUrl", dbConn) { CommandType = CommandType.StoredProcedure }; dbCmd.Parameters.AddWithValue("@FriendlyUrl", friendlyUrl); dbCmd.Parameters.AddWithValue("@Lang", AppEnv.GetLanguageFrontEnd()); try { dbConn.Open(); SqlDataReader dr = dbCmd.ExecuteReader(); if (dr.Read()) { return(dr.GetInt32(0)); } else { return(0); } } finally { dbConn.Close(); } }
protected void Page_Load(object sender, EventArgs e) { _zoneCurrent = ZoneUtility.GetZoneCurrent(); _excludeSpecial = ConvertUtility.ToInt32(SessionUtility.GetValue("excludeid")); var source = DistributionDB.GetNewContentByZoneIDNoPage(_zoneCurrent, true, _excludeSpecial); if (source.Rows.Count > 0) { CollectionPager1.DataSource = source.DefaultView; CollectionPager1.BindToControl = rptData; if (AppEnv.GetLanguageFrontEnd() == "vi-VN") { CollectionPager1.LabelText = "Trang: "; } else { CollectionPager1.LabelText = "Page: "; } CollectionPager1.BackText = "<<"; CollectionPager1.PageNumbersSeparator = " "; CollectionPager1.BackNextLinkSeparator = " "; rptData.DataSource = CollectionPager1.DataSourcePaged; rptData.DataBind(); } else { rptData.Visible = false; } }
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var curData = (DataRowView)e.Item.DataItem; var lnkRegister = (HyperLink)e.Item.FindControl("lnkRegister"); var litName = (Literal)e.Item.FindControl("litName"); var litContent = (Literal)e.Item.FindControl("litContent"); var rptDocument = (Repeater)e.Item.FindControl("rptDocument"); litName.Text = curData["Content_Name"].ToString(); litContent.Text = curData["Content_Body"].ToString(); lnkRegister.NavigateUrl = UrlFilter.BuildUrlByZoneID( ConvertUtility.ToInt32( SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguageFrontEnd()))) + "&lh=" + curData["Distribution_ZoneID"]; var strSQL = "SELECT CMS_ContentDownload.*, CMS_Download.* FROM CMS_ContentDownload "; strSQL += " INNER JOIN CMS_Download ON CMS_ContentDownload.Download_ID = CMS_Download.Download_ID "; strSQL += " WHERE 1=1 "; strSQL += " AND CMS_Download.Download_Visible=1 "; strSQL += " AND CMS_ContentDownload.Content_ID=" + curData["Content_ID"] + " "; strSQL += " ORDER BY CMS_ContentDownload.Priority ASC "; var source = DataHelper.GetDataFromTable(strSQL); rptDocument.DataSource = source; rptDocument.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { _zoneCurrent = ZoneUtility.GetZoneCurrent(); lnkZone.Text = ZoneDB.GetZoneNameByID(_zoneCurrent); lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent); var source = DistributionDB.GetNewContentByZoneIDNoPage(_zoneCurrent, true, _excludeSpecial); if (source.Rows.Count > 0) { CollectionPager1.DataSource = source.DefaultView; CollectionPager1.BindToControl = rptData; if (AppEnv.GetLanguageFrontEnd() == "vi-VN") { CollectionPager1.LabelText = "Trang: "; } else { CollectionPager1.LabelText = "Page: "; } CollectionPager1.BackText = "<<"; CollectionPager1.PageNumbersSeparator = " "; CollectionPager1.BackNextLinkSeparator = " "; rptData.DataSource = CollectionPager1.DataSourcePaged; rptData.DataBind(); } else { rptData.Visible = false; } }
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var curData = (DataRowView)e.Item.DataItem; var lnkName = (HyperLink)e.Item.FindControl("lnkName"); var litTeaser = (Literal)e.Item.FindControl("litTeaser"); var litDatetime = (Literal)e.Item.FindControl("litDatetime"); //var lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); var divRight = (HtmlGenericControl)e.Item.FindControl("divRight"); var lnkRegister = (HyperLink)e.Item.FindControl("lnkRegister"); lnkName.Text = curData["Content_Name"].ToString(); lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(ConvertUtility.ToInt32(curData["Distribution_ID"])); litTeaser.Text = curData["Content_Teaser"].ToString(); var khInfo = KhoahocDB.GetInfo(ConvertUtility.ToInt32(curData["Content_ID"])); if (khInfo != null) { litDatetime.Text = khInfo.Khoahoc_KhaiGiang; lnkRegister.NavigateUrl = UrlFilter.BuildUrlByZoneID( ConvertUtility.ToInt32( SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguageFrontEnd()))) + "&khoahocid=" + khInfo.Khoahoc_ID; } //var newstime = ConvertUtility.ToDateTime(curData["Distribution_CreateDate"]); //litDatetime.Text = newstime.Day + " tháng " + newstime.Month + " năm" + newstime.Year; var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(curData["Content_ID"])); if (coverInfo != null) { string avatar = coverInfo.Image_File; if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 120, 0); } else { imgAvatar.Visible = false; divRight.Attributes.Add("style", "width: 100%;"); } } else { imgAvatar.Visible = false; divRight.Attributes.Add("style", "width: 100%"); } } }
protected void Page_Load(object sender, EventArgs e) { _zonecurrent = ZoneUtility.GetZoneCurrent(); var zoneKhoahoc = ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneKhoaHoc + AppEnv.GetLanguageFrontEnd())); lnkZoneName.NavigateUrl = UrlFilter.BuildUrlByZoneID(zoneKhoahoc); rptData.DataSource = ZoneDB.GetByParentID(zoneKhoahoc); rptData.DataBind(); }
public static DataTable GetAvailables(int _positionID, int _paramID) { DataTable retVal = null; SqlConnection dbConn = new SqlConnection(AppEnv.ConnectionString); SqlCommand dbCmd = new SqlCommand("Adv_Advertises_GetAvailables", dbConn); dbCmd.CommandType = CommandType.StoredProcedure; dbCmd.Parameters.AddWithValue("@PositionID", _positionID); dbCmd.Parameters.AddWithValue("@AttachID", _paramID); dbCmd.Parameters.AddWithValue("@Lang", AppEnv.GetLanguageFrontEnd()); try { retVal = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(dbCmd); da.Fill(retVal); } finally { dbConn.Close(); } return(retVal); }
protected void Page_Load(object sender, EventArgs e) { litDescription.Text = "<meta name=\"description\" content=\"" + AppEnv.MetaDescription + "\">"; litKeyword.Text = "<meta name=\"keywords\" content=\"" + AppEnv.MetaSearch + "\">"; AppEnv.GetLanguageFrontEnd(); string jumpto = ConvertUtility.ToString(Request.QueryString["tab"]); switch (jumpto) { case "zone": PlaceHolder1.Controls.Add(Page.LoadControl("Layout/Zone.ascx")); break; case "content": PlaceHolder1.Controls.Add(Page.LoadControl("Layout/Content.ascx")); break; case "register": PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/Register_Member.ascx")); break; case "active": PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/Active_Member.ascx")); break; case "cart": PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/Cart.ascx")); break; default: PlaceHolder1.Controls.Add(Page.LoadControl("Layout/Home.ascx")); Pageclass = "banner_wrap"; Column_Right1.Visible = false; TuyenSinh_Home1.Visible = true; Home_AloneArea1.Visible = true; break; } int itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]); if (itemid != 0) { switch (jumpto) { case "tab": litWebTitle.Text = defaultTitle + " - " + DistributionDB.GetNameByDistID(itemid); break; default: litWebTitle.Text = defaultTitle; break; } } else { int zonecurrent = ZoneUtility.GetZoneCurrent(); if (zonecurrent == 0) { litWebTitle.Text = defaultTitle; } else { litWebTitle.Text = defaultTitle + " - " + ZoneDB.GetZoneNameByID(zonecurrent); } } }
protected void Page_Load(object sender, EventArgs e) { zoneCurrent = ZoneUtility.GetZoneCurrent(); zoneHome = ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneHome + AppEnv.GetLanguageFrontEnd())); rptData.DataSource = ZoneDB.GetZoneVisbleInMainNav(); rptData.DataBind(); }
protected void butSearch_Click(object sender, EventArgs e) { var dotuoi = dropFilterDoTuoi.SelectedValue; var monhoc = dropFilterMonHoc.SelectedValue; var coso = dropFilterCoso.SelectedValue; Response.Redirect(UrlFilter.BuildUrlByZoneID(ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguageFrontEnd()))) + "&dt=" + dotuoi + "&mh=" + monhoc + "&cs=" + coso, true); }
protected void Page_Load(object sender, EventArgs e) { _zoneCurrent = ZoneUtility.GetZoneCurrent(); _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]); _distInfo = DistributionDB.GetInfo(_itemid); if (_distInfo == null) { Visible = false; return; } DistributionDB.UpdateView(_distInfo.Distribution_ID, 1); _contentId = _distInfo.Distribution_ContentID; var contentInfo = ContentDB.GetInfo(_contentId); lnkName.Text = contentInfo.Content_Name; lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(_itemid); lnkZone.Text = ZoneDB.GetZoneNameByID(_zoneCurrent); lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent); var strSQL = "SELECT CMS_ContentImage.*, CMS_Images.* FROM CMS_ContentImage "; strSQL += " INNER JOIN CMS_Images ON CMS_ContentImage.Image_ID = CMS_Images.Image_ID "; strSQL += " WHERE 1=1 "; strSQL += " AND CMS_ContentImage.Content_ID=" + _contentId + " "; strSQL += " AND CMS_Images.Image_Visible=1 "; strSQL += " ORDER BY CMS_ContentImage.Priority ASC "; var source = DataHelper.GetDataFromTable(strSQL); if (source.Rows.Count > 0) { CollectionPager1.DataSource = source.DefaultView; CollectionPager1.BindToControl = rptData; if (AppEnv.GetLanguageFrontEnd() == "vi-VN") { CollectionPager1.LabelText = "Trang: "; } else { CollectionPager1.LabelText = "Page: "; } CollectionPager1.BackText = "<<"; CollectionPager1.PageNumbersSeparator = " "; CollectionPager1.BackNextLinkSeparator = " "; rptData.DataSource = CollectionPager1.DataSourcePaged; rptData.DataBind(); } else { rptData.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { _distInfo = DistributionDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["itemid"])); if (_distInfo == null) { Visible = false; return; } DistributionDB.UpdateView(_distInfo.Distribution_ID, 1); var contentInfo = ContentDB.GetInfo(_distInfo.Distribution_ContentID); litName.Text = contentInfo.Content_Name; if (_distInfo.Distribution_DisableTeaser) { pnTeaser.Visible = false; } else { if (contentInfo.Content_Teaser.Length > 0) { litTeaser.Text = contentInfo.Content_Teaser; } else { litTeaser.Visible = false; } if (_distInfo.Distribution_DisableAvatar) { imgAvatar.Visible = false; } else { var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(contentInfo.Content_ID)); if (coverInfo != null) { string avatar = coverInfo.Image_File; if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 150, 0); lnkAvatar.NavigateUrl = MultimediaUtility.GetOriginalImage(avatar); lnkAvatar.Attributes.Add("rel", "prettyPhoto"); lnkAvatar.ToolTip = coverInfo.Image_Description; } else { imgAvatar.Visible = false; } } else { imgAvatar.Visible = false; } } } litContent.Text = contentInfo.Content_Body; //litDatetime.Text = ConvertUtility.ToDateTime(distInfo.Distribution_CreateDate).ToString("dd/MM/yyyy"); //DataTable dtNews = DistributionDB.GetNewsForCurrent(distInfo.Distribution_ID, 5); //if (dtNews.Rows.Count == 0) //{ // pnNew.Visible = false; //} //else //{ // rptNew.DataSource = dtNews; // rptNew.DataBind(); //} var khInfo = KhoahocDB.GetInfo(ConvertUtility.ToInt32(contentInfo.Content_ID)); if (khInfo != null) { litDatetime.Text = khInfo.Khoahoc_KhaiGiang; lnkRegister.NavigateUrl = UrlFilter.BuildUrlByZoneID( ConvertUtility.ToInt32( SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguageFrontEnd()))) + "&khoahocid=" + khInfo.Khoahoc_ID; } }