<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GoogleMap.aspx.cs" Inherits="GoogleMap" %>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Codaxy.WkHtmlToPdf; using System.Data; using Common.DataAccess; using ECentury.Utility; using System.Configuration; using System.Web.UI.HtmlControls; using ECentury.LogicObject; using ECentury.TagV1_0; using Newtonsoft.Json.Linq; using System.Text; using Newtonsoft.Json; public partial class GoogleMap : System.Web.UI.Page { /// /// 網頁共用元件 /// protected WebPageCommon c; protected void Page_PreInit(object sender, EventArgs e) { //初始化網頁共用元件 c = new WebPageCommon(this.Context, this.ViewState); } protected void Page_Load(object sender, EventArgs e) { string name = Request.QueryString["name"]; string dayNo = Request.QueryString["dayNo"]; string itemType = Request.QueryString["itemType"]; string position = Request.QueryString["position"]; string w = Request.QueryString["w"]; string h = Request.QueryString["h"]; string multi = Request.QueryString["multi"]; if (multi == "0") ltrScript.Text = string.Format("", name, position, dayNo, itemType, w, h); else { JObject trip = null; //轉成json物件 //if (Request.Cookies["Trip"] != null) // trip = JObject.Parse(Server.UrlDecode(Request.Cookies["Trip"].Value.ToString())); trip = JObject.Parse(Server.UrlDecode("%7b%22items%22%3a%5b%7b%22itemId%22%3a%226260%22%2c%22isSelected%22%3a1%2c%22dayNo%22%3a1%2c%22itemType%22%3a%221%22%2c%22SortNo%22%3a1%2c%22position%22%3a%2222.60786%2c120.29930%22%7d%2c%7b%22itemId%22%3a%226262%22%2c%22isSelected%22%3a1%2c%22dayNo%22%3a1%2c%22itemType%22%3a%221%22%2c%22SortNo%22%3a0%2c%22position%22%3a%2222.59528%2c120.31557%22%7d%5d%7d")); if (trip == null) return; JArray items = (JArray)trip["items"]; if (items.Count == 0) return; string s = JsonConvert.SerializeObject(trip["items"]); DataTable dt = JsonConvert.DeserializeObject(s); DataView dv = dt.DefaultView; dv.RowFilter = string.Format("isSelected=1 and dayNo={0}", dayNo); dv.Sort = "SortNo asc"; DataSet ds = null; DataRow dr = null; string ErrMsg = ""; StringBuilder sb = new StringBuilder(); StringBuilder sbHtml = new StringBuilder(); sbHtml.Append(""); ltrItemList.Text = sbHtml.ToString(); ltrScript.Text = string.Format("", sb.ToString().TrimEnd(','), h); } } }<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %> <%@ Register src="matrix/wucFooterMenu.ascx" tagname="wucFooterMenu" tagprefix="uc10" %> 高雄旅遊網
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %> <%@ Register src="matrix/wucFooterMenu.ascx" tagname="wucFooterMenu" tagprefix="uc10" %> 高雄旅遊網
using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using Common.DataAccess; using ECentury.Utility; using System.Configuration; using System.Web.UI.HtmlControls; using ECentury.LogicObject; using System.Text; using ECentury.TagV1_0; public partial class index : System.Web.UI.Page { /// /// 網頁共用元件 /// protected WebPageCommon c; /// /// 網頁共用元件 /// protected QueryCommon qc; /// /// 主題網頁代碼 /// protected int[] aryThemeArticleId = new int[] { 4, 32, 33, 34, 28, 29 }; /// /// 側邊選單網頁代碼 /// protected int[] arySideMenuArticleId = new int[] { 30, 1042, 31, 1043, 2072 }; /// /// 旅遊資訊 /// protected int[] aryTravelInfoArticleId = new int[] { 30, 1042, 31, 1043 }; protected void Page_PreInit(object sender, EventArgs e) { //初始化網頁共用元件 c = new WebPageCommon(this.Context, this.ViewState); //初始化網頁共用元件 qc = new QueryCommon(this.Context, this.ViewState); //設定主版頁面 if (!c.SetupMasterPage(Master)) { //錯誤 Response.Redirect("~/ErrorPage.html"); } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string ErrMsg = ""; //載入介面所需資料 LoadUIData(); //顯示主要橫幅 DisplayMainBanner(); //載入主題選擇區介面所需資料 LoadTopMenuUIData(); //載入側邊選單介面所需資料 LoadSideMenuUIData(); //載入旅遊資訊 LoadTravelInfoUIData(); //顯示緊急公告 DisplayMarqueeList(); //顯示天氣 DisplayWeather(); // 顯示最新消息 DisplayNewsList(); //顯示廣告看板 DisplayEventBanner(); //顯示年度盛事 DisplaySeasonList(); //顯示推薦景點 DisplayRecommendList(); //顯示行程指南 DisplayTripList(); //顯示胖頁尾 DisplayFatFooter(); //增加網頁被點閱次數 if (c.IsOtherLang) ArticleDataAccessFacade.spArticleMultiLanguage_IncreaseReadCount(2, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleDataAccessFacade.spArticle_IncreaseReadCount(2, ref ErrMsg); } Title = Resources.Lang.SiteName; } /// /// 載入介面所需資料 /// private void LoadUIData() { aLogo.HRef = string.Format("index.aspx?l={0}", c.qsLangNo); imgLogo.Alt = Resources.Lang.SiteName; //依語言別讀取對應CSS ltrCssLang.Text = string.Format("", c.qsLangNo); //上方選單區導盲磚 aUpperAccessPoint.HRef = Request.RawUrl + "#"; aUpperAccessPoint.Title = ":::" + Resources.Lang.AccessPoint_Upper; //中間內文區導盲磚 aCenterAccessPoint.HRef = Request.RawUrl + "#"; aCenterAccessPoint.Title = ":::" + Resources.Lang.AccessPoint_Center; //中間內文區導盲磚 aCenterAccessPoint.HRef = Request.RawUrl + "#"; aCenterAccessPoint.Title = ":::" + Resources.Lang.AccessPoint_Center; //網站導覽 aSiteMap.InnerHtml = aSiteMap.Title = Resources.Lang.TopLink_SiteMap; aSiteMap.HRef = string.Format("~/Article.aspx?a=1046&l={0}", c.qsLangNo); //意見信箱 aFeedback.InnerHtml = aFeedback.Title = Resources.Lang.TopLink_Feedback; aFeedback.HRef = string.Format("~/Article.aspx?a=14&l={0}", c.qsLangNo); //語言確認鈕 btnLanguage.Text = Resources.Lang.Confirm; ddlLanguage.SelectedValue = c.qsLangNo; //頁尾資訊 string ErrMsg = ""; DataSet dsFooterInfo = null; int articleIdOfFooterInfo = 1047; //取得網頁內容 if (c.IsOtherLang) { dsFooterInfo = ArticleDataAccessFacade.spArticleMultiLanguage_GetData(articleIdOfFooterInfo, c.qsCultureNameOfLangNo, ref ErrMsg); divFloatBanner.Visible = false; } else dsFooterInfo = ArticleDataAccessFacade.spArticle_GetData(articleIdOfFooterInfo, ref ErrMsg); if (dsFooterInfo != null && dsFooterInfo.Tables[0].Rows.Count > 0) ltrFooterInfo.Text = dsFooterInfo.Tables[0].Rows[0]["ArticleContext"].ToString(); //瀏覽人次 int totalReadCount = ArticleDataAccessFacade.spArticle_GetTotalReadCount(ref ErrMsg); ltrVisitors.Text = string.Format("{0}{1:#,#}", Resources.Lang.CurrentGuestCountTitle, totalReadCount); //關鍵字 ltrKeyword.Text = Resources.Lang.KeyWordInputHint; txtKeyword.Attributes["placeholder"] = Resources.Lang.KeyWordInputHint; //旅遊資訊 ltrTravelTitle.Text = Resources.Lang.TravelInfoTitle; //回到頂部 aTop.InnerHtml = string.Format("{0}", Resources.Lang.Top); //行政資訊網 aGovSite.Title = aGovSite.InnerText = Resources.Lang.TopLink_AdminInfoSite; switch (c.qsLangNo) { case "1": case "4": aFacebook.Visible = true; aWeibo.Visible = true; aGovSite.HRef = "http://tourism.kcg.gov.tw/tw/default1.asp"; break; default: aGovSite.HRef = "http://tourism.kcg.gov.tw/en/default1.asp"; break; } } /// /// 顯示主要橫幅 /// private void DisplayMainBanner() { string ErrMsg = ""; //取得上方背景橫幅 DataSet dsPic = null; if (c.IsOtherLang) dsPic = ArticleDataAccessFacade.spArticlePicturesMultiLanguage_GetList(2, c.qsCultureNameOfLangNo, ref ErrMsg); else dsPic = ArticleDataAccessFacade.spArticlePictures_GetList(2, ref ErrMsg); StringBuilder sbBanner = new StringBuilder(); int cnt=0; foreach (DataRow dr in dsPic.Tables[0].Rows) { cnt++; sbBanner.AppendFormat("
", cnt); sbBanner.AppendFormat("
{1}
", dr["ArtPicId"], dr["ArtPicName"]); sbBanner.Append("
"); } ltrMainBanner.Text = sbBanner.ToString(); } /// /// 顯示緊急公告 /// private void DisplayMarqueeList() { string ErrMsg = ""; DataSet ds = null; if (c.IsOtherLang) { ltrNotice.Text = ArticleDataAccessFacade.spArticleMultiLanguage_GetArticleSubject(1048, c.qsCultureNameOfLangNo, ref ErrMsg); ds = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(1048, c.qsCultureNameOfLangNo, ref ErrMsg); } else { ltrNotice.Text = ArticleDataAccessFacade.spArticle_GetArticleSubject(1048, ref ErrMsg); ds = ArticleDataAccessFacade.spArticle_GetListOfChild(1048, ref ErrMsg); } if (ds == null || ds.Tables[0].Rows.Count == 0) return; rptMarqueeList.DataSource = ds.Tables[0]; rptMarqueeList.DataBind(); divMarqueeBox.Visible = true; } /// /// 載入主題選擇區介面所需資料 /// private void LoadTopMenuUIData() { //顯示 rptTopMenu.DataSource = aryThemeArticleId; rptTopMenu.DataBind(); } /// /// 載入側邊選單介面所需資料 /// private void LoadSideMenuUIData() { //顯示 rptSideMenu.DataSource = arySideMenuArticleId; rptSideMenu.DataBind(); } /// /// 載入旅遊資訊 /// private void LoadTravelInfoUIData() { //顯示 rptTravelInfo.DataSource = aryTravelInfoArticleId; rptTravelInfo.DataBind(); } /// /// 顯示天氣 /// private void DisplayWeather() { string ErrMsg = ""; DataSet ds = null; ltrDate.Text = DateTime.Today.ToString("MM/dd"); ds = ArticleDataAccessFacade.spWeatherOpenData_GetList("", c.qsCultureNameOfLangNo, "", DateTime.Now, "", ref ErrMsg); if(ds!=null && ds.Tables[0].Rows.Count>0) { DataView dv =ds.Tables[0].DefaultView; //高雄 dv.RowFilter="RegionId=64000"; imgWeather.Src = string.Format("images/weather/{0}.png", Utils.GetWeatherIconNo(dv[0]["Wx"].ToString())); imgWeather.Alt = "*"; ltrTempture.Text = string.Format("{0}°C", dv[0]["T"].ToString()); } if (c.IsOtherLang) { aWeekWeather.HRef = "http://www.cwb.gov.tw/V7e/forecast/taiwan/Kaohsiung_City.htm"; } else { aWeekWeather.HRef = "http://www.cwb.gov.tw/V7/forecast/taiwan/Kaohsiung_City.htm"; } aWeekWeather.InnerText = Resources.Lang.WeatherForcast; aWeekWeather.Target = "_blank"; } /// /// 顯示最新消息 /// private void DisplayNewsList() { ltrNewsTitle.Text = Resources.Lang.News; ltrActivityTitle.Text = Resources.Lang.Events; aMoreNews.InnerText = aMoreNews.Title = Resources.Lang.MoreMessages; aMoreActivity.InnerText = aMoreActivity.Title = Resources.Lang.MoreEvents; aMoreNews.HRef = aMoreActivity.HRef = string.Format("News.aspx?a=5&l={0}", c.qsLangNo); int RowCount = 0; string ErrMsg = ""; //取得最新消息清單 DataSet dsNewsList = null; DataSet dsActivityList = null; if (c.IsOtherLang) dsNewsList = NewsDataAccessFacade.spNewsMultiLanguage_GetList("", 1, c.qsCultureNameOfLangNo, 1, 5, "", true, ref RowCount, ref ErrMsg); else dsNewsList = NewsDataAccessFacade.spNews_GetList("", 1, 1, 5, "", true, ref RowCount, ref ErrMsg); if (dsNewsList != null) { rptNewsList.DataSource = dsNewsList.Tables[0]; rptNewsList.DataBind(); } //取得活動清單 if (c.IsOtherLang) dsActivityList = NewsDataAccessFacade.spNewsMultiLanguage_GetList("", 2, c.qsCultureNameOfLangNo, 1, 5, "", true, ref RowCount, ref ErrMsg); else dsActivityList = NewsDataAccessFacade.spNews_GetList("", 2, 1, 5, "", true, ref RowCount, ref ErrMsg); if (dsActivityList != null) { rptActivityList.DataSource = dsActivityList.Tables[0]; rptActivityList.DataBind(); } } /// /// 顯示廣告看板 /// private void DisplayEventBanner() { string ErrMsg = ""; DataSet ds = null; if (c.IsOtherLang) ds = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(6339, c.qsCultureNameOfLangNo, ref ErrMsg); else ds = ArticleDataAccessFacade.spArticle_GetListOfChild(6339, ref ErrMsg); rptEventBanner.DataSource = ds.Tables[0]; rptEventBanner.DataBind(); } /// /// 顯示年度盛事 /// private void DisplaySeasonList() { string ErrMsg = ""; DataSet ds = null; if (c.IsOtherLang) ds = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(7, c.qsCultureNameOfLangNo, ref ErrMsg); else ds = ArticleDataAccessFacade.spArticle_GetListOfChild(7, ref ErrMsg); rptSeasonList.DataSource = ds.Tables[0]; rptSeasonList.DataBind(); } /// /// 顯示推薦景點 /// private void DisplayRecommendList() { string ErrMsg = ""; DataSet ds = null; if (c.IsOtherLang) ds = ArticleDataAccessFacade.spArticleExtMultiLanguage_GetListByRecommended(c.qsCultureNameOfLangNo, ref ErrMsg); else ds = ArticleDataAccessFacade.spArticleExt_GetListByRecommended(ref ErrMsg); DataView dv = ds.Tables[0].DefaultView; dv.RowFilter = "RowNum<5"; rptRecommendList.DataSource = dv; rptRecommendList.DataBind(); //地圖導覽 aMapNav.InnerText = aMapNav.Title = Resources.Lang.MapGuide; aMapNav.HRef = string.Format("Article.aspx?a=1056&l={0}", c.qsLangNo); } /// /// 顯示行程指南 /// private void DisplayTripList() { string ErrMsg = ""; DataSet ds = null; if (c.IsOtherLang) ds = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(34, c.qsCultureNameOfLangNo, ref ErrMsg); else ds = ArticleDataAccessFacade.spArticle_GetListOfChild(34, ref ErrMsg); rptTripList.DataSource = ds.Tables[0]; rptTripList.DataBind(); } protected void rptMarqueeList_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結清單後 DataRowView drvTemp = (DataRowView)e.Item.DataItem; HtmlAnchor aItem = (HtmlAnchor)e.Item.FindControl("aItem"); aItem.HRef = drvTemp["LinkUrl"].ToString(); aItem.Target = drvTemp["LinkTarget"].ToString(); aItem.InnerText = aItem.Title = drvTemp["ArticleSubject"].ToString(); } protected void rptSeasonList_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView drvTemp = (DataRowView)e.Item.DataItem; int articleId = Convert.ToInt32(drvTemp["ArticleId"]); HtmlImage imgItem = (HtmlImage)e.Item.FindControl("imgItem"); Literal ltrItemName = (Literal)e.Item.FindControl("ltrItemName"); Literal ltrShortContext = (Literal)e.Item.FindControl("ltrShortContext"); Literal ltrMore = (Literal)e.Item.FindControl("ltrMore"); HtmlAnchor aTab = (HtmlAnchor)e.Item.FindControl("aTab"); HtmlAnchor aMore = (HtmlAnchor)e.Item.FindControl("aMore"); HtmlGenericControl liItem = (HtmlGenericControl)e.Item.FindControl("liItem"); HtmlGenericControl ulItem = (HtmlGenericControl)e.Item.FindControl("ulItem"); liItem.Attributes["class"] = string.Format("tabBox_{0}", e.Item.ItemIndex + 1); ulItem.Attributes["class"] = string.Format("ecNetUlTabContent info{0}", e.Item.ItemIndex + 1); aMore.HRef = string.Format("Article.aspx?a={0}&l={1}", articleId, c.qsLangNo); aMore.Title = ltrMore.Text = Resources.Lang.MoreActivities; aTab.InnerHtml = string.Format("{0}", drvTemp["ArticleSubject"]); aTab.Title = ltrItemName.Text = drvTemp["ArticleSubject"].ToString(); string ErrMsg = ""; DataSet ds = null; if (c.IsOtherLang) ds = ArticleDataAccessFacade.spArticleMultiLanguage_GetData(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ds = ArticleDataAccessFacade.spArticle_GetData(articleId, ref ErrMsg); if (ds != null && ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; ltrShortContext.Text = StringUtility.RemoveHtmlTagToShortContext(dr["ArticleContext"].ToString(), 50); } if (e.Item.ItemIndex == 0) aTab.Attributes["class"] = "ecNetUlTab ecNetUlTabSelected"; DataSet dsPic = null; if (c.IsOtherLang) dsPic = ArticleDataAccessFacade.spArticlePicturesMultiLanguage_GetList(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsPic = ArticleDataAccessFacade.spArticlePictures_GetList(articleId, ref ErrMsg); if (dsPic != null && dsPic.Tables[0].Rows.Count > 0) { DataRow drPic = dsPic.Tables[0].Rows[0]; imgItem.Src = string.Format("~/FileArtPic.ashx?id={0}&w=2048&h=1500", drPic["ArtPicId"]); imgItem.Alt = drPic["ArtPicName"].ToString(); } } protected void rptRecommendList_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView drvTemp = (DataRowView)e.Item.DataItem; int articleId = Convert.ToInt32(drvTemp["ArticleId"]); HtmlImage imgItem = (HtmlImage)e.Item.FindControl("imgItem"); Literal ltrItemName = (Literal)e.Item.FindControl("ltrItemName"); Literal ltrShortContext = (Literal)e.Item.FindControl("ltrShortContext"); HtmlAnchor aTab = (HtmlAnchor)e.Item.FindControl("aTab"); HtmlAnchor aMore = (HtmlAnchor)e.Item.FindControl("aMore"); Literal ltrMore = (Literal)e.Item.FindControl("ltrMore"); HtmlGenericControl liItem = (HtmlGenericControl)e.Item.FindControl("liItem"); liItem.Attributes["class"] = string.Format("tabBox_{0}", e.Item.ItemIndex + 1); aMore.HRef = string.Format("Article.aspx?a={0}&l={1}&stype=1055", articleId, c.qsLangNo); aMore.Title = ltrMore.Text = Resources.Lang.MoreRecommended; string ErrMsg = ""; DataSet ds = null; if (c.IsOtherLang) ds = TagDataAccess.spArticleTagMultiLanguage_GetListBySNo(articleId.ToString(), Convert.ToInt32(c.qsLangNo), ref ErrMsg); else ds = TagDataAccess.spArticleTag_GetListBySNo(articleId.ToString(), ref ErrMsg); if (ds != null && ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; aTab.InnerHtml = string.Format("{0}", dr["Name"]); aTab.Title = ltrItemName.Text = dr["Name"].ToString(); ltrShortContext.Text = StringUtility.RemoveHtmlTagToShortContext(dr["Description"].ToString(), 50); } if (e.Item.ItemIndex == 0) aTab.Attributes["class"] = "ecNetUlTabSelected_2"; DataSet dsPic = null; if (c.IsOtherLang) dsPic = ArticleDataAccessFacade.spArticlePicturesMultiLanguage_GetList(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsPic = ArticleDataAccessFacade.spArticlePictures_GetList(articleId, ref ErrMsg); if (dsPic != null && dsPic.Tables[0].Rows.Count > 0) { DataRow drPic = dsPic.Tables[0].Rows[0]; imgItem.Src = string.Format("~/FileArtPic.ashx?id={0}&w=2048&h=1500", drPic["ArtPicId"]); imgItem.Alt = drPic["ArtPicName"].ToString(); } } protected void rptTripList_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView drvTemp = (DataRowView)e.Item.DataItem; int articleId = Convert.ToInt32(drvTemp["ArticleId"]); HtmlImage imgItem = (HtmlImage)e.Item.FindControl("imgItem"); Literal ltrItemName = (Literal)e.Item.FindControl("ltrItemName"); Literal ltrShortContext = (Literal)e.Item.FindControl("ltrShortContext"); Literal ltrMore = (Literal)e.Item.FindControl("ltrMore"); HtmlAnchor aTab = (HtmlAnchor)e.Item.FindControl("aTab"); HtmlAnchor aMore = (HtmlAnchor)e.Item.FindControl("aMore"); HtmlGenericControl liItem = (HtmlGenericControl)e.Item.FindControl("liItem"); HtmlGenericControl ulItem = (HtmlGenericControl)e.Item.FindControl("ulItem"); liItem.Attributes["class"] = string.Format("tabBox_{0}", e.Item.ItemIndex + 1); aMore.HRef = string.Format("Article.aspx?a={0}&l={1}", articleId, c.qsLangNo); aMore.Title = ltrMore.Text = Resources.Lang.MoreTrip; aTab.InnerHtml = string.Format("{0}", drvTemp["ArticleSubject"]); aTab.Title = ltrItemName.Text = drvTemp["ArticleSubject"].ToString(); string ErrMsg = ""; DataSet ds = null; if (c.IsOtherLang) ds = ArticleDataAccessFacade.spArticleMultiLanguage_GetData(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ds = ArticleDataAccessFacade.spArticle_GetData(articleId, ref ErrMsg); if (ds != null && ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; ltrShortContext.Text = dr["ArticleContext"].ToString(); } if (e.Item.ItemIndex == 0) aTab.Attributes["class"] = "ecNetUlTabSelected_3"; DataSet dsPic = null; if (c.IsOtherLang) dsPic = ArticleDataAccessFacade.spArticlePicturesMultiLanguage_GetList(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsPic = ArticleDataAccessFacade.spArticlePictures_GetList(articleId, ref ErrMsg); if (dsPic != null && dsPic.Tables[0].Rows.Count > 0) { DataRow drPic = dsPic.Tables[0].Rows[0]; imgItem.Src = string.Format("~/FileArtPic.ashx?id={0}&w=2048&h=1500", drPic["ArtPicId"]); imgItem.Alt = drvTemp["ArticleSubject"].ToString(); } } /// /// 顯示胖頁尾 /// private void DisplayFatFooter() { string ErrMsg = ""; DataSet dsTheme = null; //取得主題清單 if (c.IsOtherLang) dsTheme = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(2/*主網*/, c.qsCultureNameOfLangNo, ref ErrMsg); else dsTheme = ArticleDataAccessFacade.spArticle_GetListOfChild(2/*主網*/, ref ErrMsg); if (dsTheme == null || dsTheme.Tables[0].Rows.Count == 0) return; rptThemeArticle.DataSource = dsTheme.Tables[0]; rptThemeArticle.DataBind(); } protected void rptTopMenu_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結主題選擇區後 int articleId = (int)e.Item.DataItem; string ArticleSubject = "", ErrMsg = ""; HtmlAnchor aTopMenuItem = (HtmlAnchor)e.Item.FindControl("aTopMenuItem"); HtmlGenericControl liTopMenuItem = (HtmlGenericControl)e.Item.FindControl("liTopMenuItem"); aTopMenuItem.HRef = string.Format("Article.aspx?a={0}&l={1}", articleId, c.qsLangNo); //取得網頁標題 if (c.IsOtherLang) ArticleSubject = ArticleDataAccessFacade.spArticleMultiLanguage_GetArticleSubject(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleSubject = ArticleDataAccessFacade.spArticle_GetArticleSubject(articleId, ref ErrMsg); aTopMenuItem.InnerHtml = aTopMenuItem.Title = ArticleSubject; liTopMenuItem.Attributes.Add("class", string.Format("nav{0}", e.Item.ItemIndex + 1)); } protected void rptSideMenu_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結主題選擇區後 int articleId = (int)e.Item.DataItem; string ArticleSubject = "", ErrMsg = ""; HtmlAnchor aItem = (HtmlAnchor)e.Item.FindControl("aItem"); HtmlGenericControl liItem = (HtmlGenericControl)e.Item.FindControl("liItem"); Literal ltrItemName = (Literal)e.Item.FindControl("ltrItemName"); aItem.HRef = string.Format("Article.aspx?a={0}&l={1}", articleId, c.qsLangNo); //取得網頁標題 if (c.IsOtherLang) ArticleSubject = ArticleDataAccessFacade.spArticleMultiLanguage_GetArticleSubject(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleSubject = ArticleDataAccessFacade.spArticle_GetArticleSubject(articleId, ref ErrMsg); ltrItemName.Text = aItem.Title = ArticleSubject; liItem.Attributes.Add("class", string.Format("nav{0}", e.Item.ItemIndex + 1)); } protected void rptTravelInfo_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結主題選擇區後 int articleId = (int)e.Item.DataItem; string ArticleSubject = "", ErrMsg = ""; HtmlAnchor aItem = (HtmlAnchor)e.Item.FindControl("aItem"); HtmlGenericControl liItem = (HtmlGenericControl)e.Item.FindControl("liItem"); HtmlGenericControl divItem1 = (HtmlGenericControl)e.Item.FindControl("divItem1"); HtmlGenericControl divItem2 = (HtmlGenericControl)e.Item.FindControl("divItem2"); Literal ltrItemName = (Literal)e.Item.FindControl("ltrItemName"); aItem.HRef = string.Format("Article.aspx?a={0}&l={1}", articleId, c.qsLangNo); //取得網頁標題 if (c.IsOtherLang) ArticleSubject = ArticleDataAccessFacade.spArticleMultiLanguage_GetArticleSubject(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleSubject = ArticleDataAccessFacade.spArticle_GetArticleSubject(articleId, ref ErrMsg); ltrItemName.Text = aItem.Title = ArticleSubject; liItem.Attributes.Add("class", string.Format("nav{0}", e.Item.ItemIndex + 1)); divItem1.Attributes.Add("class", string.Format("ch-info-front ch-img-{0}", e.Item.ItemIndex + 1)); divItem2.Attributes.Add("class", string.Format("ch-info-back ch-img-{0}_on", e.Item.ItemIndex + 1)); } protected void rptThemeArticle_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結主題 DataRowView drvTemp = (DataRowView)e.Item.DataItem; int ArticleId = Convert.ToInt32(drvTemp["ArticleId"]); //主題連結 HtmlAnchor aTheme = (HtmlAnchor)e.Item.FindControl("aTheme"); aTheme.HRef = string.Format("Article.aspx?a={0}&l={1}", ArticleId, c.qsLangNo); aTheme.InnerText = aTheme.Title = drvTemp["ArticleSubject"].ToString(); switch (ArticleId) { case 34: //行程指南 ltrTripTitle.Text = drvTemp["ArticleSubject"].ToString(); break; } //子網頁控制項 Repeater rptArticle = (Repeater)e.Item.FindControl("rptArticle"); string ErrMsg = ""; DataSet dsArticle = null; //取得子網頁清單 if (c.IsOtherLang) dsArticle = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsArticle = ArticleDataAccessFacade.spArticle_GetListOfChild(ArticleId, ref ErrMsg); rptArticle.DataSource = dsArticle.Tables[0]; rptArticle.DataBind(); } protected void rptArticle_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結子網頁 DataRowView drvTemp = (DataRowView)e.Item.DataItem; int ArticleId = Convert.ToInt32(drvTemp["ArticleId"]); //子網頁連結 HtmlAnchor aArticle = (HtmlAnchor)e.Item.FindControl("aArticle"); aArticle.HRef = string.Format("Article.aspx?a={0}&l={1}", ArticleId, c.qsLangNo); aArticle.InnerText = aArticle.Title = drvTemp["ArticleSubject"].ToString(); switch (ArticleId) { case 7: //年度盛事 ltrSeasonTitle.Text = drvTemp["ArticleSubject"].ToString(); break; case 1055: //本季推薦 ltrRecommendTitle.Text = drvTemp["ArticleSubject"].ToString(); break; } } protected void rptNewsList_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結清單後 DataRowView drvTemp = (DataRowView)e.Item.DataItem; //最新消息群組 int NewsGroupId = Convert.ToInt32(drvTemp["NewsGroupId"]); //最新消息代碼 int NewsId = Convert.ToInt32(drvTemp["NewsId"]); HtmlAnchor aNewsItem = (HtmlAnchor)e.Item.FindControl("aNewsItem"); Literal ltrNewsSubject = (Literal)e.Item.FindControl("ltrNewsSubject"); ltrNewsSubject.Text = aNewsItem.Title = drvTemp["NewsSubject"].ToString(); //建立內容頁的重新載入頁面用的字串 aNewsItem.HRef = string.Format("News-Content.aspx?l={0}&nid={1}", c.qsLangNo, NewsId); //內文 Literal ltrNewsShortContext = (Literal)e.Item.FindControl("ltrNewsShortContext"); string ErrMsg = ""; DataSet ds = null; if (c.IsOtherLang) ds = NewsDataAccessFacade.spNewsMultiLanguage_GetData(NewsId, c.qsCultureNameOfLangNo, ref ErrMsg); else ds = NewsDataAccessFacade.spNews_GetData(NewsId, ref ErrMsg); ltrNewsShortContext.Text = StringUtility.RemoveHtmlTagToShortContext(ds.Tables[0].Rows[0]["NewsContext"].ToString(), 120); //日期 Literal ltrDisplayPostDate = (Literal)e.Item.FindControl("ltrDisplayPostDate"); if (NewsGroupId == 1) { ltrDisplayPostDate.Text = string.Format("{0:yyyy.MM.dd}", drvTemp["DisplayPostDate"]); } else { ltrDisplayPostDate.Text = string.Format("{0:yyyy.MM.dd} - {1:yyyy.MM.dd}", drvTemp["ActivityStartDate"], drvTemp["ActivityEndDate"]); } } protected void rptEventBanner_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結清單後 DataRowView drvTemp = (DataRowView)e.Item.DataItem; int articleId = Convert.ToInt32(drvTemp["ArticleId"]); HtmlAnchor aItem = (HtmlAnchor)e.Item.FindControl("aItem"); HtmlImage imgItem = (HtmlImage)e.Item.FindControl("imgItem"); string ErrMsg = ""; aItem.HRef = drvTemp["LinkUrl"].ToString(); aItem.Target = drvTemp["LinkTarget"].ToString(); DataSet dsPic = null; if (c.IsOtherLang) dsPic = ArticleDataAccessFacade.spArticlePicturesMultiLanguage_GetList(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsPic = ArticleDataAccessFacade.spArticlePictures_GetList(articleId, ref ErrMsg); if (dsPic != null && dsPic.Tables[0].Rows.Count > 0) { DataRow drPic = dsPic.Tables[0].Rows[0]; imgItem.Src = string.Format("~/FileArtPic.ashx?id={0}&w=1024&h=800", drPic["ArtPicId"]); imgItem.Alt = aItem.Title = drvTemp["ArticleSubject"].ToString(); } } protected void btnLanguage_Click(object sender, EventArgs e) { string langNo = ddlLanguage.SelectedValue; if (langNo != "") Response.Redirect("~/?l=" + langNo); } protected void btnSearch_Click(object sender, EventArgs e) { //查詢 string keyWord = txtKeyword.Text.Trim(); if (keyWord == "" || keyWord == Resources.Lang.KeyWordInputHint) return; //到搜尋結果頁 qc.GoToSearchResult(keyWord); } }<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InvalidParameter.aspx.cs" Inherits="InvalidParameter" %> 錯誤訊息頁/Error Page
系統偵測到無效的參數內容!
Invalid parameter has been found.


輸入的資料可能含有惡意程式碼,系統選擇停止回應。
Input data may contain malicious code, the system chosen to stop responding.


回首頁 / Home
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterArt.master" AutoEventWireup="true" CodeFile="Lodge-Content.aspx.cs" Inherits="Lodge_Content" %> <%@ Register src="matrix/wucReturnToList.ascx" TagName="wucReturnToList" TagPrefix="uc1" %>

電話

07-636-6611

傳真

07-636-6611

電子信箱

位置

高雄市鳳山區崇德里月球路36號
using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using Common.DataAccess; using ECentury.Utility; using System.Configuration; using System.Web.UI.HtmlControls; using ECentury.LogicObject; using System.Text; using ECentury.TagV1_0; public partial class Lodge_Content : System.Web.UI.Page { /// /// 旅宿代碼 /// public string qsLid { get { object obj = Request.QueryString["lid"]; if (obj != null) return obj.ToString(); else return ""; } } /// /// 星級 /// public int qsGrade { get { object obj = Request.QueryString["grade"]; int nResult; if (obj != null && int.TryParse(obj.ToString(), out nResult)) { } else return 0; return nResult; } } /// /// 郵遞區號 /// public string qsZipcode { get { object obj = Request.QueryString["zcode"]; if (obj != null) return obj.ToString(); else return ""; } } /// /// 關鍵字 /// public string qsKeyword { get { object obj = Request.QueryString["kw"]; if (obj != null) return obj.ToString(); else return ""; } } /// /// 網頁共用元件 /// protected WebPageCommon c; private MasterArtBase _masterArtBase; protected void Page_PreInit(object sender, EventArgs e) { //初始化網頁共用元件 c = new WebPageCommon(this.Context, this.ViewState); //設定主版頁面 if (!c.SetupMasterPage(Master)) { //錯誤 Response.Redirect("~/ErrorPage.html"); } _masterArtBase = (MasterArtBase)Master; //啟用轉跳到連結位置的動作 //_masterArtBase.EnableRedirectToLinkUrl = true; //顯示列印功能區 _masterArtBase.ShowPrintFuncArea = true; //隱藏回列表區和Top _masterArtBase.ShowReturnToListArea = false; //設定回列表控制項 //return string.Format("~/{0}/News.aspx?l={1}&p={2}&title={3}", _articleDirOfLink, lang, p, title); //ucReturnToList.SetReturnToListUrl(c.BuildReloadPageStringOfList(c.qsLangNo, c.qsPageCode, c.qsSearchTitle)); //Article.aspx?a=6982&l={0}&lid={1}&zcode={2}&grade={3}&kw={4} } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //載入介面所需資料 LoadUIData(); //顯示內容 DisplayContent(); } } /// /// 載入介面所需資料 /// private void LoadUIData() { //相關資訊 ltrInfoTitle.Text = Resources.Lang.PageTitle07; //位置 ltrInfoTab01.Text = Resources.Lang.PageTitle01; //週邊搜尋 ltrInfoTab02.Text = Resources.Lang.PageTitle02; ltrQRCodeText.Text = Resources.Lang.PageTitle06; //回列表 ucReturnToList.SetReturnToListUrl(string.Format("~/Article.aspx?a={0}&l={1}&zcode={2}&grade={3}&kw={4}&p={5}", _masterArtBase.ParentId, c.qsLangNo, qsZipcode, qsGrade, qsKeyword, c.qsPageCode)); } /// /// 顯示內容 /// private void DisplayContent() { string ErrMsg = ""; DataSet ds = null; switch (c.qsLangNo) { case "1": case "4": ds = ArticleDataAccessFacade.spTaiwanstay_GetData("1", qsLid, ref ErrMsg); break; case "2": default: ds = ArticleDataAccessFacade.spTaiwanstay_GetData("2", qsLid, ref ErrMsg); break; case "3": ds = ArticleDataAccessFacade.spTaiwanstay_GetData(c.qsLangNo, qsLid, ref ErrMsg); break; } if (ds == null || ds.Tables[0].Rows.Count == 0) return; DataRow dr = ds.Tables[0].Rows[0]; decimal px = Convert.ToDecimal(dr["px"]); decimal py = Convert.ToDecimal(dr["py"]); //準備參數 string Name = dr["Name"].ToString(); string Add = dr["Add"].ToString(); string WebSite = dr["WebSite"].ToString(); string Fax = dr["Fax"].ToString(); string Tel = dr["Tel"].ToString(); string Coordinate = string.Format("{0},{1}", px, py); string GoogleCoordinate = string.Format("{0},{1}", py, px); string Description = dr["Description"].ToString(); string Picture1 = dr["Picture1"].ToString(); string Picture2 = dr["Picture2"].ToString(); string Picture3 = dr["Picture3"].ToString(); if (c.qsLangNo == "4") { Name = LangUtility.TranslateStringZHTWtoZHCN(Name); Add = LangUtility.TranslateStringZHTWtoZHCN(Add); } if (Picture1.Length > 0) ltrPhoto.Text = string.Format("{1}", Picture1, Name); if (Picture2.Length > 0) ltrPhoto.Text += string.Format("{1}", Picture2, Name); if (Picture3.Length > 0) ltrPhoto.Text += string.Format("{1}", Picture3, Name); //自訂足跡區目前節點的文字內容 _masterArtBase.CustCurrentNodeTextOfFootPrint = Name; ltrSubject.Text = Name; ltrContent.Text = Description; if (Tel.Length > 0) { Tel = "+" + Tel; //給QRCode用 Tel = Tel.Replace("-0", "-"); divTel.InnerHtml = string.Format("

{0}

{1}
", Resources.Lang.TelNoTitle, Tel); divTel.Visible = true; } if (Fax.Length > 0) { Fax = "+" + Fax; //給QRCode用 Fax = Fax.Replace("-0", "-"); divFax.InnerHtml = string.Format("

{0}

{1}
", Resources.Lang.FaxNoTitle, Fax); divFax.Visible = true; } if (WebSite.Length > 0) { divWebsite.InnerHtml = string.Format("

{0}

{1}
", Resources.Lang.PageTitle08, Server.HtmlEncode(WebSite)); divWebsite.Visible = true; } if (Add.Length > 0) { divAddress.InnerHtml = string.Format("

{0}

{1}
", Resources.Lang.AddressTitle, Add); divAddress.Visible = true; } //產生QRCode imgQRCode.Src = string.Format("QRCode.ashx?w=150&name={0}&weburl={1}&addr={2}&tel={3}&coordinate={4}&oh=''", Name, Server.UrlEncode(WebSite), Add, Tel, Coordinate); imgQRCode.Alt = "QRCode"; //週邊連結設定(開啓地圖快搜) string url = System.Web.Configuration.WebConfigurationManager.AppSettings["GMapUrl"]; aScene.Title = string.Format("{0}({1})", Resources.Lang.PageTitle03, Resources.Lang.OpenInNewWindow); aLodge.Title = string.Format("{0}({1})", Resources.Lang.PageTitle04, Resources.Lang.OpenInNewWindow); aFood.Title = string.Format("{0}({1})", Resources.Lang.PageTitle05, Resources.Lang.OpenInNewWindow); aScene.InnerText = Resources.Lang.PageTitle03; aLodge.InnerText = Resources.Lang.PageTitle04; aFood.InnerText = Resources.Lang.PageTitle05; aScene.Target = aLodge.Target = aFood.Target = "_blank"; if(c.qsLangNo=="1") { aScene.HRef = string.Format("{0}/kgmap/gMap.aspx?l=1&lat={1}&lng={2}&layer1=12", url, py, px); aLodge.HRef = string.Format("{0}/kgmap/gMap.aspx?l=1&lat={1}&lng={2}&layer1=11", url, py, px); aFood.HRef = string.Format("{0}/kgmap/gMap.aspx?l=1&lat={1}&lng={2}&layer1=10", url, py, px); } else { aScene.HRef = string.Format("{0}/kgmap/gMap.aspx?l=2&lat={1}&lng={2}&layer1=12", url, py, px); aLodge.HRef = string.Format("{0}/kgmap/gMap.aspx?l=2&lat={1}&lng={2}&layer1=11", url, py, px); aFood.HRef = string.Format("{0}/kgmap/gMap.aspx?l=2&lat={1}&lng={2}&layer1=10", url, py, px); } //顯示位置圖 DisplayGoogleMap(Name, px, py); } /// /// 顯示位置圖 /// private void DisplayGoogleMap(string title, decimal px, decimal py) { ltrGoogleAPI.Text = string.Format("", c.qsCultureNameOfLangNo); StringBuilder sbScript = new StringBuilder(); sbScript.Append(""); ltrJS.Text = sbScript.ToString(); divMapArea.Visible = true; } }<%@ Page Title="" Language="C#" MasterPageFile="~/MasterArt.master" AutoEventWireup="true" CodeFile="Lodge.aspx.cs" Inherits="Lodge" %> <%@ Register src="matrix/wucDataPager.ascx" tagname="wucDataPager" tagprefix="uc1" %> using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using Common.DataAccess; using ECentury.Utility; using System.Configuration; using System.Web.UI.HtmlControls; using ECentury.LogicObject; using ECentury.TagV1_0; public partial class Lodge : System.Web.UI.Page { /// /// 類別 /// public int qsClass { get { object obj = Request.QueryString["class"]; int nResult; if (obj != null && int.TryParse(obj.ToString(), out nResult)) { } else return 0; return nResult; } } /// /// 星級 /// public int qsGrade { get { object obj = Request.QueryString["grade"]; int nResult; if (obj != null && int.TryParse(obj.ToString(), out nResult)) { } else return 0; return nResult; } } /// /// 郵遞區號 /// public string qsZipcode { get { object obj = Request.QueryString["zcode"]; if (obj != null) return obj.ToString(); else return ""; } } /// /// 關鍵字 /// public string qsKeyword { get { object obj = Request.QueryString["kw"]; if (obj != null) return obj.ToString(); else return ""; } } /// /// 網頁共用元件 /// protected WebPageCommon c; private MasterArtBase _masterArtBase; protected void Page_PreInit(object sender, EventArgs e) { //初始化網頁共用元件 c = new WebPageCommon(this.Context, this.ViewState); //設定主版頁面 if (!c.SetupMasterPage(Master)) { //錯誤 Response.Redirect("~/ErrorPage.html"); } _masterArtBase = (MasterArtBase)Master; //顯示列印功能區 //_masterArtBase.ShowPrintFuncArea = true; //設定分頁控制項內容範圍 ucDataPager.MaxItemCountOfPage = 10; ucDataPager.MaxDisplayCountInPageCodeArea = 5; //設定分頁控制項的重新載入用的連結內容 ucDataPager.LinkUrlToReload = string.Concat(Request.AppRelativeCurrentExecutionFilePath, "?", Request.QueryString); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //載入介面所需資料 LoadUIData(); //顯示列表 DisplayList(); } } /// /// 載入介面所需資料 /// private void LoadUIData() { ltrSubject.Text = _masterArtBase.ArticleSubject; ltrContext.Text = _masterArtBase.ArticleContext; txtKeyword.Attributes.Add("placeholder", Resources.Lang.KeyWordInputHint); ltrSearchRuleTitle.Text = Resources.Lang.SearchRuleTitle; btnSearch.Text = Resources.Lang.ButtonText_Query; string ErrMsg = ""; DataSet ds = null; ds = ArticleDataAccessFacade.spTaiwanstay_GetDistrict(c.qsLangNo, "800", "852", ref ErrMsg); ddlZipcode.DataTextField = "town"; ddlZipcode.DataValueField = "Zipcode"; ddlZipcode.DataSource = ds.Tables[0]; ddlZipcode.DataBind(); ddlZipcode.Items.Insert(0, new ListItem(Resources.Lang.PageTitle16, "")); ddlGrade.Items.Add(new ListItem(Resources.Lang.OptionText_All, "0")); ddlGrade.Items.Add(new ListItem(Resources.Lang.Star1, "1")); ddlGrade.Items.Add(new ListItem(Resources.Lang.Star2, "2")); ddlGrade.Items.Add(new ListItem(Resources.Lang.Star3, "3")); ddlGrade.Items.Add(new ListItem(Resources.Lang.Star4, "4")); ddlGrade.Items.Add(new ListItem(Resources.Lang.Star5, "5")); ddlZipcode.SelectedValue = qsZipcode; ddlGrade.SelectedValue = qsGrade.ToString(); if (qsKeyword.Length > 0) txtKeyword.Text = qsKeyword; if (qsClass == 4) ddlGrade.Visible = false; } /// /// 顯示列表 /// private void DisplayList() { string ErrMsg = ""; int RowCount = 0; DataSet ds = null; string beginZipcode = "800"; string endZipcode = "852"; if (qsZipcode.Length > 0) { beginZipcode = endZipcode = qsZipcode; } switch (c.qsLangNo) { case "1": case "4": if (qsClass == 1) ArticleDataAccessFacade.spTaiwanstay_GetList("1", "1", "3", beginZipcode, endZipcode, qsGrade.ToString(), qsKeyword, 0, 0, "Name", false, ref RowCount, ref ErrMsg); else ArticleDataAccessFacade.spTaiwanstay_GetList("1", "4", "4", beginZipcode, endZipcode, "", qsKeyword, 0, 0, "Name", false, ref RowCount, ref ErrMsg); break; case "2": default: if (qsClass == 1) ArticleDataAccessFacade.spTaiwanstay_GetList("2", "1", "3", beginZipcode, endZipcode, qsGrade.ToString(), qsKeyword, 0, 0, "Name", false, ref RowCount, ref ErrMsg); else ArticleDataAccessFacade.spTaiwanstay_GetList("2", "4", "4", beginZipcode, endZipcode, "", qsKeyword, 0, 0, "Name", false, ref RowCount, ref ErrMsg); break; case "3": if (qsClass == 1) ArticleDataAccessFacade.spTaiwanstay_GetList(c.qsLangNo, "1", "3", beginZipcode, endZipcode, qsGrade.ToString(), qsKeyword, 0, 0, "Name", false, ref RowCount, ref ErrMsg); else ArticleDataAccessFacade.spTaiwanstay_GetList(c.qsLangNo, "4", "4", beginZipcode, endZipcode, "", qsKeyword, 0, 0, "Name", false, ref RowCount, ref ErrMsg); break; } //設定分頁控制項內容 ucDataPager.ItemTotalCount = RowCount; ucDataPager.CurrentPageCode = c.qsPageCode; int BeginNum = ucDataPager.BeginNumberOfPage; int EndNum = ucDataPager.EndNumberOfPage; switch (c.qsLangNo) { case "1": case "4": if (qsClass == 1) ds = ArticleDataAccessFacade.spTaiwanstay_GetList("1", "1", "3", beginZipcode, endZipcode, qsGrade.ToString(), qsKeyword, BeginNum, EndNum, "Name", false, ref RowCount, ref ErrMsg); else ds = ArticleDataAccessFacade.spTaiwanstay_GetList("1", "4", "4", beginZipcode, endZipcode, "", qsKeyword, BeginNum, EndNum, "Name", false, ref RowCount, ref ErrMsg); break; case "2": default: if (qsClass == 1) ds = ArticleDataAccessFacade.spTaiwanstay_GetList("2", "1", "3", beginZipcode, endZipcode, qsGrade.ToString(), qsKeyword, BeginNum, EndNum, "Name", false, ref RowCount, ref ErrMsg); else ds = ArticleDataAccessFacade.spTaiwanstay_GetList("2", "4", "4", beginZipcode, endZipcode, "", qsKeyword, BeginNum, EndNum, "Name", false, ref RowCount, ref ErrMsg); break; case "3": if (qsClass == 1) ds = ArticleDataAccessFacade.spTaiwanstay_GetList(c.qsLangNo, "1", "3", beginZipcode, endZipcode, qsGrade.ToString(), qsKeyword, BeginNum, EndNum, "Name", false, ref RowCount, ref ErrMsg); else ds = ArticleDataAccessFacade.spTaiwanstay_GetList(c.qsLangNo, "4", "4", beginZipcode, endZipcode, "", qsKeyword, BeginNum, EndNum, "Name", false, ref RowCount, ref ErrMsg); break; } if (ds == null) { rptList.DataSource = null; return; } rptList.DataSource = ds.Tables[0]; rptList.DataBind(); } protected void btnSearch_Click(object sender, EventArgs e) { string url = string.Format("Article.aspx?a={0}&l={1}&zcode={2}&grade={3}&kw={4}", c.qsArticleId, c.qsLangNo, ddlZipcode.SelectedValue, ddlGrade.SelectedValue, Server.UrlEncode(qsKeyword)); Response.Redirect(url); } protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView drvTemp = (DataRowView)e.Item.DataItem; HtmlAnchor aImage = (HtmlAnchor)e.Item.FindControl("aImage"); HtmlAnchor aName = (HtmlAnchor)e.Item.FindControl("aName"); HtmlGenericControl pStar = (HtmlGenericControl)e.Item.FindControl("pStar"); Literal ltrDistrict = (Literal)e.Item.FindControl("ltrDistrict"); Literal ltrTel = (Literal)e.Item.FindControl("ltrTel"); Literal ltrAddress = (Literal)e.Item.FindControl("ltrAddress"); HtmlAnchor aDetail = (HtmlAnchor)e.Item.FindControl("aDetail"); HtmlAnchor aWebsite = (HtmlAnchor)e.Item.FindControl("aWebsite"); Literal ltrDistrictTitle = (Literal)e.Item.FindControl("ltrDistrictTitle"); Literal ltrTelTitle = (Literal)e.Item.FindControl("ltrTelTitle"); Literal ltrAddressTitle = (Literal)e.Item.FindControl("ltrAddressTitle"); ltrDistrictTitle.Text = Resources.Lang.PageTitle16; ltrTelTitle.Text = Resources.Lang.TelNoTitle; ltrAddressTitle.Text = Resources.Lang.AddressTitle; aDetail.InnerText = Resources.Lang.PageTitle17; aWebsite.InnerText = Resources.Lang.PageTitle08; aImage.InnerHtml = string.Format("{1}", drvTemp["Picture1"].ToString(), drvTemp["Name"].ToString()); string grade = drvTemp["Grade"].ToString().Trim(); if (grade.Length > 0 && grade != "Y") { for (int i = 1; i <= Convert.ToInt32(grade); i++) { pStar.InnerHtml += "*"; } } else pStar.Visible = false; if (c.qsLangNo == "4") { aName.InnerText = LangUtility.TranslateStringZHTWtoZHCN(drvTemp["Name"].ToString()); ltrDistrict.Text = LangUtility.TranslateStringZHTWtoZHCN(drvTemp["town"].ToString()); ltrAddress.Text = LangUtility.TranslateStringZHTWtoZHCN(drvTemp["Add"].ToString()); } else { aName.InnerText = drvTemp["Name"].ToString(); ltrDistrict.Text = drvTemp["town"].ToString(); ltrAddress.Text = drvTemp["Add"].ToString(); } ltrTel.Text = string.Format("+{0}", drvTemp["Tel"].ToString()); ltrTel.Text = ltrTel.Text.Replace("-0", "-"); if (drvTemp["Website"].ToString().Length > 0) { aWebsite.HRef = drvTemp["Website"].ToString(); aWebsite.Visible = true; } if (qsClass == 1) aDetail.HRef = aImage.HRef = aName.HRef = string.Format("Article.aspx?a=6982&l={0}&lid={1}&zcode={2}&grade={3}&kw={4}&p={5}", c.qsLangNo, drvTemp["id"].ToString(), qsZipcode, qsGrade, Server.UrlEncode(qsKeyword), c.qsPageCode); else aDetail.HRef = aImage.HRef = aName.HRef = string.Format("Article.aspx?a=6983&l={0}&lid={1}&zcode={2}&grade={3}&kw={4}&p={5}", c.qsLangNo, drvTemp["id"].ToString(), qsZipcode, qsGrade, Server.UrlEncode(qsKeyword), c.qsPageCode); } }<%@ WebHandler Language="C#" Class="Logout" %> using System; using System.Web; using System.Web.Security; using System.Web.SessionState; public class Logout : IHttpHandler, IRequiresSessionState { public void ProcessRequest (HttpContext context) { //登出 context.Session.Clear(); FormsAuthentication.SignOut(); if (context.Request.UrlReferrer == null) { //回到登入頁 context.Response.Redirect(FormsAuthentication.LoginUrl); } else { //導回原來的頁面 context.Response.Redirect(context.Request.UrlReferrer.PathAndQuery); } } public bool IsReusable { get { return false; } } }<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MapContent.aspx.cs" Inherits="MapContent" %> 高雄旅遊網

using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using Common.DataAccess; using ECentury.Utility; using System.Configuration; using System.Web.UI.HtmlControls; using ECentury.LogicObject; using ECentury.TagV1_0; using System.Text; public partial class MapContent : System.Web.UI.Page { /// /// 網頁共用元件 /// protected WebPageCommon c; protected void Page_PreInit(object sender, EventArgs e) { //初始化網頁共用元件 c = new WebPageCommon(this.Context, this.ViewState); //設定主版頁面 if (!c.SetupMasterPage(Master)) { //錯誤 Response.Redirect("~/ErrorPage.html"); } } protected void Page_Init(object sender, EventArgs e) { //設定搜尋區 } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //顯示內容 DisplayContent(); } } /// /// 顯示內容 /// private void DisplayContent() { string ErrMsg = ""; DataSet ds = null; //取行政區資料 if (c.IsOtherLang) ds = ArticleDataAccessFacade.spArticleMultiLanguage_GetData(c.qsScenicItem, c.qsCultureNameOfLangNo, ref ErrMsg); else ds = ArticleDataAccessFacade.spArticle_GetData(c.qsScenicItem, ref ErrMsg); if (ds == null || ds.Tables[0].Rows.Count == 0) return; DataRow dr = ds.Tables[0].Rows[0]; ltrTitle.Text = dr["ArticleSubject"].ToString(); ltrContext.Text = dr["ArticleContext"].ToString().Replace("\n", "
"); //依行政區取景點資料 if (c.IsOtherLang) ds = ArticleDataAccessFacade.spArticleExtMultiLanguage_GetListByDistrict(c.qsScenicItem.ToString(), c.qsCultureNameOfLangNo, ref ErrMsg); else ds = ArticleDataAccessFacade.spArticleExt_GetListByDistrict(c.qsScenicItem.ToString(), ref ErrMsg); if (ds == null || ds.Tables[0].Rows.Count == 0) return; int cnt = 0; StringBuilder sbHtml = new StringBuilder(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i]; int articleId = Convert.ToInt32(dr["ArticleId"]); //每8個一組, 起始標籤 if ((i + 1) % 8 == 1) sbHtml.Append("
"); } ltrItem.Text = sbHtml.ToString(); } }<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterArt.master.cs" Inherits="MasterArt" %> <%@ Register src="matrix/wucFootPrint.ascx" tagname="wucFootPrint" tagprefix="uc1" %> <%@ Register src="matrix/wucTopLink.ascx" tagname="wucTopLink" tagprefix="uc9" %> <%@ Register src="matrix/wucFooterMenu.ascx" tagname="wucFooterMenu" tagprefix="uc10" %> 高雄旅遊網

主題導覽主題導覽主題導覽主題導覽主題導覽主題導覽主題導覽主題導覽主題導覽主題導覽主題導覽主題導覽!

往下探索
圖片名稱

using System; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Data; using Common.DataAccess; using System.Text; using ECentury.LogicObject; using System.Web; using ECentury.Utility; public partial class MasterArt : MasterArtBase { /// /// 側邊選單網頁代碼 /// protected int[] arySideMenuArticleId = new int[] { 30, 1042, 31, 1043, 2072 }; /// /// 景點導覽網頁代碼 /// protected int[] aryScenicNavArticleId = new int[] { 1057, 1056, 1055, 1058, 1059 }; /// /// 景點導覽網頁代碼多語 /// protected int[] aryScenicNavArticleIdMuliLanguage = new int[] { 1056, 1055, 1058, 1059 }; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //載入介面所需資料 LoadUIData(); //載入主題選擇區介面所需資料 LoadTopMenuUIData(); //載入側邊選單介面所需資料 LoadSideMenuUIData(); //顯示網頁內容 DisplayArticleContent(); } //瀏覽器標題 Page.Title = ArticleSubject + " - " + Resources.Lang.SiteName; //建立cookie CreateCookies(); } /// /// 建立cookie /// private void CreateCookies() { HttpCookie oCookie = null; if (Request.Cookies["Trip"] == null) { oCookie = new HttpCookie("Trip"); oCookie.Value = @"{""items"":[]}"; oCookie.Expires = DateTime.Now.AddHours(1); Response.Cookies.Add(oCookie); } else if (Request.Cookies["Trip"].Value.Length == 0) { oCookie = new HttpCookie("Trip"); oCookie.Value = @"{""items"":[]}"; oCookie.Expires = DateTime.Now.AddHours(1); Response.Cookies.Add(oCookie); } } /// /// 載入介面所需資料 /// private void LoadUIData() { //取得分類檢索 ltrCategory.Text = c.GetCategory(c.qsArticleId); //依語言別讀取對應CSS ltrCssLang.Text = string.Format("", c.qsLangNo); //標識圖 aLogo.Title = Resources.Lang.SiteName; aLogo.HRef = string.Format("index.aspx?l={0}", c.qsLangNo); imgLogo.Alt = aLogo.Title; //報馬仔 aBMZ.HRef = string.Format("Article.aspx?a=1044&l={0}&pt={1}&pu={2}", c.qsLangNo, ArticleSubject + " - " + Resources.Lang.SiteName, Server.UrlEncode(Request.Url.AbsoluteUri)); aBMZ.InnerText = aBMZ.Title = Resources.Lang.BMZ; if (c.qsArticleId != 1044) divBMZ.Visible = true; //設定足跡區 //網頁代碼 ucFootPrint.ArticleId = ArticleId; //自訂足跡區目前節點的文字內容 ucFootPrint.CustCurrentNodeText = CustCurrentNodeTextOfFootPrint; aSmallFontSize.Title = aSmallFontSize.InnerText = Resources.Lang.FontSettings_Title8; aMediumFontSize.Title = aSmallFontSize.InnerText = Resources.Lang.FontSettings_Title9; aLargeFontSize.Title = aSmallFontSize.InnerText = Resources.Lang.FontSettings_Title10; //左方選單區導盲磚 aLeftAccessPoint.Title = Resources.Lang.AccessPoint_Left; aLeftAccessPoint.HRef = Request.RawUrl + "#"; //頁尾資訊 string ErrMsg = ""; DataSet dsFooterInfo = null; int articleIdOfFooterInfo = 1047; //取得網頁內容 if (c.IsOtherLang) dsFooterInfo = ArticleDataAccessFacade.spArticleMultiLanguage_GetData(articleIdOfFooterInfo, c.qsCultureNameOfLangNo, ref ErrMsg); else dsFooterInfo = ArticleDataAccessFacade.spArticle_GetData(articleIdOfFooterInfo, ref ErrMsg); if (dsFooterInfo != null && dsFooterInfo.Tables[0].Rows.Count > 0) ltrFooterInfo.Text = dsFooterInfo.Tables[0].Rows[0]["ArticleContext"].ToString(); switch (ArticleId) { case 2072: //自訂行程 case 1044: //報馬仔 case 1045: //全文檢索 divHeader.Visible = false; divFontSize.Visible = false; ulTools.Visible = false; ltrJsECTab.Text = ""; break; default: ltrJsECTab.Text = ""; break; } //瀏覽人次 int totalReadCount = ArticleDataAccessFacade.spArticle_GetTotalReadCount(ref ErrMsg); ltrVisitors.Text = string.Format("{0}{1:#,#}", Resources.Lang.CurrentGuestCountTitle, totalReadCount); //友善列印 aPrint.Title = Resources.Lang.PrintFriendly; aPrint.HRef = StringUtility.SetParaValueInUrl(Request.RawUrl, "print", "1"); //轉寄好友 aForward.Title = Resources.Lang.ForwardToPal; aForward.HRef = StringUtility.SetParaValueInUrl(Request.RawUrl, "forward", "1"); //分享 aShare.Title = Resources.Lang.SocialMedia; aShare.InnerHtml = string.Format("{0}", aShare.Title); //回到頂部 aTop.InnerHtml = string.Format("{0}", Resources.Lang.Top); if (ArticleId != 7) { //設定預設頁籤 Page.ClientScript.RegisterStartupScript(Page.GetType(), "", ""); } switch (c.qsLangNo) { case "1": case "4": aFacebook.Visible = true; aWeibo.Visible = true; break; } } /// /// 載入主題選擇區介面所需資料 /// private void LoadTopMenuUIData() { switch (Lv2ArticleId) { case 4://夯情報 case 28://美食 case 31: //小叮嚀 case 6985: //其他功能 case 10: //關於我們 body.Attributes["class"] = "main_color1"; break; case 32: //高雄一點通 case 1043: //資訊分享站 body.Attributes["class"] = "main_color2"; break; case 33: //景點萬花筒 body.Attributes["class"] = "main_color3"; break; case 1042: //交通百寶箱 case 34: //行程指南 body.Attributes["class"] = "main_color4"; break; case 29: //購物 body.Attributes["class"] = "main_color2"; break; default: body.Attributes["class"] = "main_color3"; break; } //顯示 rptTopMenu.DataSource = aryThemeArticleId; rptTopMenu.DataBind(); } /// /// 載入景點導覽介面所需資料 /// private void LoadNavListUIData() { if (c.IsOtherLang) rptNavList.DataSource = aryScenicNavArticleIdMuliLanguage; else rptNavList.DataSource = aryScenicNavArticleId; rptNavList.DataBind(); } /// /// 載入側邊選單介面所需資料 /// private void LoadSideMenuUIData() { //顯示 rptSideMenu.DataSource = arySideMenuArticleId; rptSideMenu.DataBind(); } /// /// 顯示網頁內容 /// private void DisplayArticleContent() { string ErrMsg = ""; //設定橫幅(原則上取第2層照片, 特殊情況取自己的照片) DataSet dsPic = null; if (Lv2ArticleId == 33 && ArticleLevelNo == 3) { //景點萬花筒下一層, 取自己的橫幅 if (c.IsOtherLang) dsPic = ArticleDataAccessFacade.spArticlePicturesMultiLanguage_GetList(ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsPic = ArticleDataAccessFacade.spArticlePictures_GetList(ArticleId, ref ErrMsg); } else { if (c.IsOtherLang) dsPic = ArticleDataAccessFacade.spArticlePicturesMultiLanguage_GetList(Lv2ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsPic = ArticleDataAccessFacade.spArticlePictures_GetList(Lv2ArticleId, ref ErrMsg); } if (dsPic != null && dsPic.Tables[0].Rows.Count > 0) { DataRow drPic = dsPic.Tables[0].Rows[0]; imgBanner.Src = string.Format("~/FileArtPic.ashx?id={0}&w=2048&h=960", drPic["ArtPicId"]); ltrBannerName.Text = imgBanner.Alt = drPic["ArtPicName"].ToString(); } //Fun遊高雄導覽頁 if (Lv2ArticleId == 33 && ArticleLevelNo == 3) { pNavDiscription.InnerHtml = ArticleContext; aNavPoint.InnerText = aNavPoint.Title = "往下探索"; divNav.Visible = true; pNavDiscription.Visible = true; aNavPoint.Visible = true; //載入景點導覽介面所需資料 LoadNavListUIData(); } //依開啟方式顯示網頁內容 switch (ShowTypeId) { case 1: default: //一般內容 break; case 2: //至下一層 //取得子網頁清單 DataSet dsChild = null; if (c.IsOtherLang) dsChild = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsChild = ArticleDataAccessFacade.spArticle_GetListOfChild(ArticleId, ref ErrMsg); if (dsChild != null && dsChild.Tables[0].Rows.Count > 0) { //到第一個有效的子網頁 DataRow drChild = dsChild.Tables[0].Rows[0]; Response.Redirect(string.Format("Article.aspx?a={0}&l={1}", drChild["ArticleId"], c.qsLangNo)); return; } break; case 3: //超連結 //轉到連結位置 if (EnableRedirectToLinkUrl) { //附加上目前的網址參數 //執行 Response.Redirect(c.AppendCurrentQueryString(LinkUrl)); return; } break; case 4: //控制項 break; } //顯示列印功能區 divFontSize.Visible = ShowPrintFuncArea; ulTools.Visible = ShowPrintFuncArea; //顯示選單內容 if (LayoutModeId == 2 || LayoutModeId == 3) { //換成2欄 divMain.Attributes["class"] = "main twoColumn"; switch (Lv2ArticleId) { case 33: //Fun遊高雄 DisplayScenicMenu(); break; default: //一般選單 DisplayMenu(); break; } } else { switch (Lv2ArticleId) { case 33: divMain.Attributes["class"] = "main fullWidth FunKaosiung FunKaosiung_4"; break; default: //行程指南 divMain.Attributes["class"] = "main fullWidth FunKaosiung_4"; break; } } //顯示胖頁尾 DisplayFatFooter(); //增加網頁被點閱次數 if (c.IsOtherLang) ArticleDataAccessFacade.spArticleMultiLanguage_IncreaseReadCount(ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleDataAccessFacade.spArticle_IncreaseReadCount(ArticleId, ref ErrMsg); } /// /// 顯示選單內容 /// private void DisplayMenu() { string ErrMsg = ""; //取得第二層的選單標題內容 DataSet dsMenuSubject = ArticleDataAccessFacade.spArticle_GetDataForMenu(Lv2ArticleId, ref ErrMsg); if (dsMenuSubject == null) return; if (dsMenuSubject.Tables[0].Rows.Count == 0) return; DataRow drMenuSubject = dsMenuSubject.Tables[0].Rows[0]; //是否需隱藏下層項目 bool IsHideChild = Convert.ToBoolean(drMenuSubject["IsHideChild"]); if (!IsHideChild) { //取得子網頁清單 DataSet dsMenuList = null; if (c.IsOtherLang) dsMenuList = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(Lv2ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuList = ArticleDataAccessFacade.spArticle_GetListOfChild(Lv2ArticleId, ref ErrMsg); if (dsMenuList == null) return; if (dsMenuList.Tables[0].Rows.Count == 0) return; //顯示選單項目 rptMenuItem.DataSource = dsMenuList.Tables[0]; rptMenuItem.DataBind(); divMenu.Visible = true; ulMenu.Visible = true; } } /// /// 顯示景點選單內容 /// private void DisplayScenicMenu() { string ErrMsg = ""; //取得子網頁清單 DataSet dsMenuList = null; switch (c.qsScenicType) { case 1055: //本季推薦 if (c.IsOtherLang) dsMenuList = ArticleDataAccessFacade.spArticleExtMultiLanguage_GetListByRecommended(c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuList = ArticleDataAccessFacade.spArticleExt_GetListByRecommended(ref ErrMsg); break; case 1056: case 1057: default: //地圖導覽,行政區導覽 if (c.IsOtherLang) dsMenuList = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(1057, c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuList = ArticleDataAccessFacade.spArticle_GetListOfChild(1057, ref ErrMsg); break; case 1058: case 1059: //主題導覽, 捷運站導覽 if (c.IsOtherLang) dsMenuList = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(c.qsScenicType, c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuList = ArticleDataAccessFacade.spArticle_GetListOfChild(c.qsScenicType, ref ErrMsg); break; } if (dsMenuList == null) return; if (dsMenuList.Tables[0].Rows.Count == 0) return; //顯示選單項目 rptScenicMenuItem.DataSource = dsMenuList.Tables[0]; rptScenicMenuItem.DataBind(); divMenu.Visible = true; ulScenicMenu.Visible = true; } //顯示胖頁尾 private void DisplayFatFooter() { string ErrMsg = ""; DataSet dsTheme = null; //取得主題清單 if (c.IsOtherLang) dsTheme = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(2/*主網*/, c.qsCultureNameOfLangNo, ref ErrMsg); else dsTheme = ArticleDataAccessFacade.spArticle_GetListOfChild(2/*主網*/, ref ErrMsg); if (dsTheme == null || dsTheme.Tables[0].Rows.Count == 0) return; rptThemeArticle.DataSource = dsTheme.Tables[0]; rptThemeArticle.DataBind(); } protected void rptMenuItem_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header || e.Item.ItemType == ListItemType.Footer) { return; } //繫結選單項目 Repeater rptTemp = (Repeater)sender; DataRowView drvTemp = (DataRowView)e.Item.DataItem; //網頁代碼 int ArticleId = Convert.ToInt32(drvTemp["ArticleId"]); //隱藏本篇文章 bool IsHideSelf = Convert.ToBoolean(drvTemp["IsHideSelf"]); //開始有效日期 DateTime StartDate = Convert.ToDateTime(drvTemp["StartDate"]).Date; //結束有效日期 DateTime EndDate = Convert.ToDateTime(string.Format("{0:yyyy/MM/dd 23:59:59}", drvTemp["EndDate"])); //在該語言版本中顯示 bool IsShowByLang = Convert.ToBoolean(drvTemp["IsShowByLang"]); HtmlAnchor aMenuGenericItem = null; HtmlGenericControl liMenuGenericItem = null; //依繫結來源取得選單項目或子項目 if (rptTemp.ID == "rptMenuItem") { aMenuGenericItem = (HtmlAnchor)e.Item.FindControl("aMenuItem"); liMenuGenericItem = (HtmlGenericControl)e.Item.FindControl("liMenuItem"); } else if (rptTemp.ID == "rptMenuSubItem") { aMenuGenericItem = (HtmlAnchor)e.Item.FindControl("aMenuSubItem"); liMenuGenericItem = (HtmlGenericControl)e.Item.FindControl("liMenuSubItem"); } aMenuGenericItem.InnerText = aMenuGenericItem.Title = drvTemp["ArticleSubject"].ToString(); //判斷是否隱藏 if (IsHideSelf || !IsShowByLang || DateTime.Now < StartDate || DateTime.Now > EndDate) { if (rptTemp.ID == "rptMenuItem") liMenuGenericItem.Visible = false; else if (rptTemp.ID == "rptMenuSubItem") aMenuGenericItem.Visible = false; return; } //開啟方式 int ShowTypeId = Convert.ToInt32(drvTemp["ShowTypeId"]); //依開啟方式設定連結內容 switch (ShowTypeId) { case 1: //一般內容 case 2: //至下一層 case 4: //控制項 default: //設定 aMenuGenericItem.HRef = string.Format("Article.aspx?a={0}&l={1}", ArticleId, c.qsLangNo); break; case 3: //超連結 //超連結位置 StringBuilder sbLinkUrl = new StringBuilder(drvTemp["LinkUrl"].ToString()); //檢查原本連結內容有無參數 bool HasPara = sbLinkUrl.ToString().IndexOf("?") != -1; //加上參數分隔符號 if (!HasPara) sbLinkUrl.Append("?"); else sbLinkUrl.Append("&"); sbLinkUrl.AppendFormat("a={0}&l={1}", ArticleId, c.qsLangNo); //超連結開啟方式 string LinkTarget = drvTemp["LinkTarget"].ToString(); //設定 aMenuGenericItem.HRef = sbLinkUrl.ToString(); //另開視窗 if (LinkTarget != "") { aMenuGenericItem.Target = LinkTarget; aMenuGenericItem.Title += "(" + Resources.Lang.OpenInNewWindow + ")"; } break; } //第一層被選擇的選單項目 if (rptTemp.ID == "rptMenuItem" && ArticleId == Lv3ArticleId) liMenuGenericItem.Attributes["class"] = "current"; //被選擇的選單項目 //第一層被選擇的選單項目要抓子項目 if (rptTemp.ID == "rptMenuItem" && ArticleId == Lv3ArticleId) { //隱藏下層項目 bool IsHideChild = Convert.ToBoolean(drvTemp["IsHideChild"]); string ErrMsg = ""; if (!IsHideChild) { //取得子網頁清單 DataSet dsMenuSubList = null; if (c.IsOtherLang) dsMenuSubList = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuSubList = ArticleDataAccessFacade.spArticle_GetListOfChild(ArticleId, ref ErrMsg); if (dsMenuSubList != null && dsMenuSubList.Tables[0].Rows.Count > 0) { //顯示選單子項目 Repeater rptMenuSubItem = (Repeater)e.Item.FindControl("rptMenuSubItem"); rptMenuSubItem.DataSource = dsMenuSubList.Tables[0]; rptMenuSubItem.DataBind(); } } } else if (rptTemp.ID == "rptMenuSubItem" && (ArticleId == c.qsArticleId || ArticleId==ParentId)) { //第二層被選擇的選單項目 liMenuGenericItem.Attributes["class"] = "current"; } } protected void rptScenicMenuItem_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header || e.Item.ItemType == ListItemType.Footer) { return; } string ErrMsg = ""; DataSet ds = null; int stype = c.qsScenicType; int sitem = c.qsScenicItem; //stype=0, 一律視為行政區導覽 if (stype == 0) stype = 1057; //sitem=0, 一律找其行政區 if (sitem == 0) { ds = ArticleDataAccessFacade.spArticleExt_GetData(c.qsArticleId, ref ErrMsg); if (ds != null && ds.Tables[0].Rows.Count > 0) { sitem = Convert.ToInt32(ds.Tables[0].Rows[0]["District"]); } } //繫結選單項目 Repeater rptTemp = (Repeater)sender; DataRowView drvTemp = (DataRowView)e.Item.DataItem; //網頁代碼 int ArticleId = Convert.ToInt32(drvTemp["ArticleId"]); HtmlAnchor aMenuGenericItem = null; HtmlGenericControl liMenuGenericItem = null; //依繫結來源取得選單項目或子項目 if (rptTemp.ID == "rptScenicMenuItem") { aMenuGenericItem = (HtmlAnchor)e.Item.FindControl("aScenicMenuItem"); liMenuGenericItem = (HtmlGenericControl)e.Item.FindControl("liScenicMenuItem"); } else if (rptTemp.ID == "rptScenicMenuSubItem") { aMenuGenericItem = (HtmlAnchor)e.Item.FindControl("aScenicMenuSubItem"); liMenuGenericItem = (HtmlGenericControl)e.Item.FindControl("liScenicMenuSubItem"); } aMenuGenericItem.InnerText = aMenuGenericItem.Title = drvTemp["ArticleSubject"].ToString(); //給第2層選單項目用 if (rptTemp.ID == "rptScenicMenuSubItem") aMenuGenericItem.HRef = string.Format("Article.aspx?a={0}&l={1}&stype={2}&sitem={3}", ArticleId, c.qsLangNo, stype, drvTemp["SItem"]); //第一層被選擇的選單項目 if (rptTemp.ID == "rptScenicMenuItem" && (ArticleId == sitem || (c.qsScenicItem == 0 && c.qsArticleId == ArticleId))) liMenuGenericItem.Attributes["class"] = "current"; //被選擇的選單項目 //第一層被選擇的選單項目要抓子項目(為了抓第2層選單第一個項目, 每個都抓子清單) if (rptTemp.ID == "rptScenicMenuItem") { //取得子網頁清單 DataSet dsMenuSubList = null; switch (c.qsScenicType) { case 1055: //本季推薦 aMenuGenericItem.HRef = string.Format("Article.aspx?a={0}&l={1}&stype={2}", ArticleId, c.qsLangNo, c.qsScenicType); break; case 1056: case 1057: default: //地圖導覽,行政區導覽 if (c.IsOtherLang) dsMenuSubList = ArticleDataAccessFacade.spArticleExtMultiLanguage_GetListByDistrict(ArticleId.ToString(), c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuSubList = ArticleDataAccessFacade.spArticleExt_GetListByDistrict(ArticleId.ToString(), ref ErrMsg); break; case 1058: //主題導覽 if (c.IsOtherLang) dsMenuSubList = ArticleDataAccessFacade.spArticleExtMultiLanguage_GetListByCategory(string.Format(",{0},", ArticleId), c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuSubList = ArticleDataAccessFacade.spArticleExt_GetListByCategory(string.Format(",{0},", ArticleId), ref ErrMsg); break; case 1059: //捷運站導覽 if (c.IsOtherLang) dsMenuSubList = ArticleDataAccessFacade.spArticleExtMultiLanguage_GetListByMRT(string.Format(",{0},", ArticleId), c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuSubList = ArticleDataAccessFacade.spArticleExt_GetListByMRT(string.Format(",{0},", ArticleId), ref ErrMsg); break; } if (dsMenuSubList != null && dsMenuSubList.Tables[0].Rows.Count > 0) { //取第2層第一個項目當第一層連結 aMenuGenericItem.HRef = string.Format("Article.aspx?a={0}&l={1}&stype={2}&sitem={3}", dsMenuSubList.Tables[0].Rows[0]["ArticleId"], c.qsLangNo, stype, ArticleId); //如果是被選擇的第一層項目才繫結 if (sitem == ArticleId) { //加分類項目欄位給第2層用 dsMenuSubList.Tables[0].Columns.Add(new DataColumn("SItem")); for (int i = 0; i <= dsMenuSubList.Tables[0].Rows.Count - 1; i++) dsMenuSubList.Tables[0].Rows[i]["SItem"] = ArticleId; //顯示選單子項目 Repeater rptScenicMenuSubItem = (Repeater)e.Item.FindControl("rptScenicMenuSubItem"); rptScenicMenuSubItem.DataSource = dsMenuSubList.Tables[0]; rptScenicMenuSubItem.DataBind(); } } } else if (rptTemp.ID == "rptScenicMenuSubItem" && ArticleId == c.qsArticleId) { //第二層被選擇的選單項目 liMenuGenericItem.Attributes["class"] = "current"; } } protected void rptTopMenu_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結主題選擇區後 int articleId = (int)e.Item.DataItem; string ArticleSubject = "", ErrMsg = ""; HtmlAnchor aTopMenuItem = (HtmlAnchor)e.Item.FindControl("aTopMenuItem"); HtmlGenericControl liTopMenuItem = (HtmlGenericControl)e.Item.FindControl("liTopMenuItem"); aTopMenuItem.HRef = string.Format("Article.aspx?a={0}&l={1}", articleId, c.qsLangNo); //取得網頁標題 if (c.IsOtherLang) ArticleSubject = ArticleDataAccessFacade.spArticleMultiLanguage_GetArticleSubject(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleSubject = ArticleDataAccessFacade.spArticle_GetArticleSubject(articleId, ref ErrMsg); aTopMenuItem.InnerHtml = aTopMenuItem.Title = ArticleSubject; if (articleId == Lv2ArticleId) { liTopMenuItem.Attributes.Add("class", string.Format("nav{0} current", e.Item.ItemIndex+1)); ltrThemeName.Text = ArticleSubject; } else { liTopMenuItem.Attributes.Add("class", string.Format("nav{0}", e.Item.ItemIndex + 1)); } } protected void rptNavList_ItemDataBound(object sender, RepeaterItemEventArgs e) { int articleId = (int)e.Item.DataItem; string ArticleSubject = "", ErrMsg = ""; //取得網頁標題 if (c.IsOtherLang) ArticleSubject = ArticleDataAccessFacade.spArticleMultiLanguage_GetArticleSubject(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleSubject = ArticleDataAccessFacade.spArticle_GetArticleSubject(articleId, ref ErrMsg); HtmlAnchor aNav = (HtmlAnchor)e.Item.FindControl("aNav"); HtmlGenericControl liNav = (HtmlGenericControl)e.Item.FindControl("liNav"); aNav.InnerHtml = string.Format("{0}", ArticleSubject); aNav.Title = ArticleSubject; aNav.HRef = string.Format("Article.aspx?a={0}&l={1}", articleId, c.qsLangNo); if (articleId == ArticleId) { liNav.Attributes["class"] = string.Format("nav{0} current", articleId); } else { liNav.Attributes["class"] = string.Format("nav{0}", articleId); } } protected void rptThemeArticle_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結主題 DataRowView drvTemp = (DataRowView)e.Item.DataItem; int ArticleId = Convert.ToInt32(drvTemp["ArticleId"]); //主題連結 HtmlAnchor aTheme = (HtmlAnchor)e.Item.FindControl("aTheme"); aTheme.HRef = string.Format("Article.aspx?a={0}&l={1}", ArticleId, c.qsLangNo); aTheme.InnerText = aTheme.Title = drvTemp["ArticleSubject"].ToString(); //子網頁控制項 Repeater rptArticle = (Repeater)e.Item.FindControl("rptArticle"); string ErrMsg = ""; DataSet dsArticle = null; //取得子網頁清單 if (c.IsOtherLang) dsArticle = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsArticle = ArticleDataAccessFacade.spArticle_GetListOfChild(ArticleId, ref ErrMsg); rptArticle.DataSource = dsArticle.Tables[0]; rptArticle.DataBind(); } protected void rptArticle_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結子網頁 DataRowView drvTemp = (DataRowView)e.Item.DataItem; int ArticleId = Convert.ToInt32(drvTemp["ArticleId"]); //子網頁連結 HtmlAnchor aArticle = (HtmlAnchor)e.Item.FindControl("aArticle"); aArticle.HRef = string.Format("Article.aspx?a={0}&l={1}", ArticleId, c.qsLangNo); aArticle.InnerText = aArticle.Title = drvTemp["ArticleSubject"].ToString(); } protected void rptSideMenu_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結主題選擇區後 int articleId = (int)e.Item.DataItem; string ArticleSubject = "", ErrMsg = ""; HtmlAnchor aItem = (HtmlAnchor)e.Item.FindControl("aItem"); HtmlGenericControl liItem = (HtmlGenericControl)e.Item.FindControl("liItem"); Literal ltrItemName = (Literal)e.Item.FindControl("ltrItemName"); aItem.HRef = string.Format("Article.aspx?a={0}&l={1}", articleId, c.qsLangNo); //取得網頁標題 if (c.IsOtherLang) ArticleSubject = ArticleDataAccessFacade.spArticleMultiLanguage_GetArticleSubject(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleSubject = ArticleDataAccessFacade.spArticle_GetArticleSubject(articleId, ref ErrMsg); ltrItemName.Text = aItem.Title = ArticleSubject; if (Lv2ArticleId == articleId || ArticleId == articleId) { liItem.Attributes.Add("class", string.Format("nav{0} current", e.Item.ItemIndex + 1)); ltrThemeName.Text = ArticleSubject; } else liItem.Attributes.Add("class", string.Format("nav{0}", e.Item.ItemIndex + 1)); } } <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterArtBak.master.cs" Inherits="User_MasterArt" %> <%@ Register src="matrix/wucFootPrint.ascx" tagname="wucFootPrint" tagprefix="uc1" %> <%@ Register Src="matrix/wucFontSettings.ascx" TagName="wucFontSettings" TagPrefix="uc1" %> <%@ Register src="matrix/wucAttachmentFileArea.ascx" tagname="wucAttachmentFileArea" tagprefix="uc5" %> <%@ Register src="matrix/wucSearch.ascx" tagname="wucSearch" tagprefix="uc6" %> <%@ Register src="matrix/wucPrintFuncArea.ascx" tagname="wucPrintFuncArea" tagprefix="uc8" %> <%@ Register src="matrix/wucTopLink.ascx" tagname="wucTopLink" tagprefix="uc9" %> <%@ Register src="matrix/wucFooterMenu.ascx" tagname="wucFooterMenu" tagprefix="uc10" %>
<%--上方連結區--%>
<%--網頁Logo--%> <%--主題選擇區--%> Subject...
<%--舊主題選擇區(馬祖的)--%>
<%--橫幅flash--%>
<%--左側選單區--%>
<%--選單標題圖--%> <%--選單標題圖--%>
:::
<%--足跡區--%> <%--兩欄內文區--%>
<%--字級設定區--%> <%--列印區--%>
<%--兩欄標題區--%> 標題圖 <%--兩欄標題資訊區--%> <%--三欄標題圖區--%> <%--三欄標題資訊區--%>
<%--主要內文--%> <%--全版內文--%> <%--附件下載區--%>
<%--三欄右側區--%>
<%--頁尾選單--%>
using System; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Data; using Common.DataAccess; using System.Text; using ECentury.LogicObject; public partial class User_MasterArt : MasterArtBase { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //載入介面所需資料 LoadUIData(); //顯示網頁內容 DisplayArticleContent(); } //瀏覽器標題 Page.Title = ArticleSubject + " - " + Resources.Lang.SiteName; } /// /// 載入介面所需資料 /// private void LoadUIData() { //取得分類檢索 ltrCategory.Text = c.GetCategory(c.qsArticleId); //標識圖 aLogo.Title = Resources.Lang.SiteName; aLogo.HRef = string.Format("Default.htm?l={0}", c.qsLangNo); imgLogo.Alt = aLogo.Title; //載入主題選擇區介面所需資料 LoadTopMenuUIData(); //設定足跡區 //網頁代碼 ucFootPrint.ArticleId = ArticleId; //自訂足跡區目前節點的文字內容 ucFootPrint.CustCurrentNodeText = CustCurrentNodeTextOfFootPrint; //左方選單區導盲磚 aLeftAccessPoint.Title = Resources.Lang.AccessPoint_Left; aLeftAccessPoint.HRef = Request.RawUrl + "#"; //中間內文區導盲磚 aCenterAccessPoint.Title = Resources.Lang.AccessPoint_Center; aCenterAccessPoint.HRef = Request.RawUrl + "#"; //右方選單區導盲磚 aRightAccessPoint.Title = Resources.Lang.AccessPoint_Right; aRightAccessPoint.HRef = Request.RawUrl + "#"; //頁尾資訊 string ErrMsg = ""; DataSet dsFooterInfo = null; int articleIdOfFooterInfo = 516; //取得網頁內容 if (c.IsOtherLang) dsFooterInfo = ArticleDataAccessFacade.spArticleMultiLanguage_GetData(articleIdOfFooterInfo, c.qsCultureNameOfLangNo, ref ErrMsg); else dsFooterInfo = ArticleDataAccessFacade.spArticle_GetData(articleIdOfFooterInfo, ref ErrMsg); if (dsFooterInfo != null && dsFooterInfo.Tables[0].Rows.Count > 0) ltrFooterInfo.Text = dsFooterInfo.Tables[0].Rows[0]["ArticleContext"].ToString(); } /// /// 載入主題選擇區介面所需資料 /// private void LoadTopMenuUIData() { //背景變色用CSS StringBuilder sbStyle = new StringBuilder(200); sbStyle.Append(""); ltrTopMenuItemHoverStyle.Text = sbStyle.ToString(); //顯示 rptTopMenu.DataSource = aryThemeArticleId; rptTopMenu.DataBind(); } protected void rptTopMenu_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結主題選擇區後 int articleId = (int)e.Item.DataItem; string ArticleSubject = "", ErrMsg = ""; HtmlAnchor aTopMenuItem = (HtmlAnchor)e.Item.FindControl("aTopMenuItem"); aTopMenuItem.HRef = string.Format("Article.aspx?a={0}&l={1}", articleId, c.qsLangNo); aTopMenuItem.Attributes.Add("class", string.Concat("topMenuItem topMenuItemLightHover", e.Item.ItemIndex + 1)); //取得網頁標題 if (c.IsOtherLang) ArticleSubject = ArticleDataAccessFacade.spArticleMultiLanguage_GetArticleSubject(articleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleSubject = ArticleDataAccessFacade.spArticle_GetArticleSubject(articleId, ref ErrMsg); aTopMenuItem.InnerHtml = aTopMenuItem.Title = ArticleSubject; } /// /// 顯示網頁內容 /// private void DisplayArticleContent() { string ErrMsg = ""; //設定橫幅 string BannerImagePath = string.Format("images/{0}/{1}", c.qsLangNo, BannerPicFileName); ltrBanner.Text = " " + "" + "" + "" + "" + "橫幅背景畫面"; //設定主題css int nThemeNo = 3; for(int i=0; i 0) { //到第一個有效的子網頁 DataRow drChild = dsChild.Tables[0].Rows[0]; Response.Redirect(string.Format("Article.aspx?a={0}&l={1}", drChild["ArticleId"], c.qsLangNo)); return; } break; case 3: //超連結 //轉到連結位置 if (EnableRedirectToLinkUrl) { //附加上目前的網址參數 //執行 Response.Redirect(c.AppendCurrentQueryString(LinkUrl)); return; } break; case 4: //控制項 break; } //顯示選單內容 if (LayoutModeId == 2 || LayoutModeId == 3) DisplayMenu(); //增加網頁被點閱次數 if (c.IsOtherLang) ArticleDataAccessFacade.spArticleMultiLanguage_IncreaseReadCount(ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else ArticleDataAccessFacade.spArticle_IncreaseReadCount(ArticleId, ref ErrMsg); } /// /// 顯示選單內容 /// private void DisplayMenu() { string ErrMsg = ""; //取得第二層的選單標題內容 DataSet dsMenuSubject = ArticleDataAccessFacade.spArticle_GetDataForMenu(Lv2ArticleId, ref ErrMsg); if (dsMenuSubject == null) return; if (dsMenuSubject.Tables[0].Rows.Count == 0) return; DataRow drMenuSubject = dsMenuSubject.Tables[0].Rows[0]; //取得網頁標題 string MenuArticleSubject = drMenuSubject["ArticleSubject"].ToString(); DataSet dsMenuSubjectMulti = null; if (c.IsOtherLang) { //取得特定語言的選單用網頁內容 dsMenuSubjectMulti = ArticleDataAccessFacade.spArticleMultiLanguage_GetDataForMenu(Lv2ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); if (dsMenuSubjectMulti != null && dsMenuSubjectMulti.Tables[0].Rows.Count > 0) { //取得網頁標題 MenuArticleSubject = dsMenuSubjectMulti.Tables[0].Rows[0]["ArticleSubject"].ToString(); } } //選單標題圖 ltrMenuArticleSubject.Text = MenuArticleSubject; //imgMenuSubjectPic.Alt = MenuArticleSubject; //imgMenuSubjectPic.Attributes.Add("title", imgMenuSubjectPic.Alt); //imgMenuSubjectPic.Src = string.Format("~/images/{0}/{1}", c.qsLangNo, drMenuSubject["MenuSubjectPicFileName"]); //是否需隱藏下層項目 bool IsHideChild = Convert.ToBoolean(drMenuSubject["IsHideChild"]); if (!IsHideChild) { //取得子網頁清單 DataSet dsMenuList = null; if (c.IsOtherLang) dsMenuList = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(Lv2ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuList = ArticleDataAccessFacade.spArticle_GetListOfChild(Lv2ArticleId, ref ErrMsg); if (dsMenuList == null) return; if (dsMenuList.Tables[0].Rows.Count == 0) return; //顯示選單項目 rptMenuItem.DataSource = dsMenuList.Tables[0]; rptMenuItem.DataBind(); } } protected void rptMenuItem_ItemDataBound(object sender, RepeaterItemEventArgs e) { //繫結選單項目 Repeater rptTemp = (Repeater)sender; DataRowView drvTemp = (DataRowView)e.Item.DataItem; //網頁代碼 int ArticleId = Convert.ToInt32(drvTemp["ArticleId"]); //隱藏本篇文章 bool IsHideSelf = Convert.ToBoolean(drvTemp["IsHideSelf"]); //開始有效日期 DateTime StartDate = Convert.ToDateTime(drvTemp["StartDate"]).Date; //結束有效日期 DateTime EndDate = Convert.ToDateTime(string.Format("{0:yyyy/MM/dd 23:59:59}", drvTemp["EndDate"])); //在該語言版本中顯示 bool IsShowByLang = Convert.ToBoolean(drvTemp["IsShowByLang"]); //選單項目區 HtmlGenericControl divMenuItem = (HtmlGenericControl)e.Item.FindControl("divMenuItem"); HyperLink hlkMenuGenericItem = null; //依繫結來源取得選單項目或子項目 if (rptTemp.ID == "rptMenuItem") hlkMenuGenericItem = (HyperLink)e.Item.FindControl("hlkMenuItem"); else if (rptTemp.ID == "rptMenuSubItem") hlkMenuGenericItem = (HyperLink)e.Item.FindControl("hlkMenuSubItem"); hlkMenuGenericItem.Text = hlkMenuGenericItem.ToolTip = drvTemp["ArticleSubject"].ToString(); //判斷是否隱藏 if (IsHideSelf || !IsShowByLang || DateTime.Now < StartDate || DateTime.Now > EndDate) { if (rptTemp.ID == "rptMenuItem") divMenuItem.Visible = false; else if (rptTemp.ID == "rptMenuSubItem") hlkMenuGenericItem.Visible = false; return; } //開啟方式 int ShowTypeId = Convert.ToInt32(drvTemp["ShowTypeId"]); //依開啟方式設定連結內容 switch (ShowTypeId) { case 1: //一般內容 case 2: //至下一層 case 4: //控制項 default: //設定 hlkMenuGenericItem.NavigateUrl = string.Format("Article.aspx?a={0}&l={1}", ArticleId, c.qsLangNo); break; case 3: //超連結 //超連結位置 StringBuilder sbLinkUrl = new StringBuilder(drvTemp["LinkUrl"].ToString()); //檢查原本連結內容有無參數 bool HasPara = sbLinkUrl.ToString().IndexOf("?") != -1; //加上參數分隔符號 if (!HasPara) sbLinkUrl.Append("?"); else sbLinkUrl.Append("&"); sbLinkUrl.AppendFormat("a={0}&l={1}", ArticleId, c.qsLangNo); //超連結開啟方式 string LinkTarget = drvTemp["LinkTarget"].ToString(); //設定 hlkMenuGenericItem.NavigateUrl = sbLinkUrl.ToString(); //另開視窗 if (LinkTarget != "") { hlkMenuGenericItem.Target = LinkTarget; hlkMenuGenericItem.ToolTip += "(" + Resources.Lang.OpenInNewWindow + ")"; } break; } //第一層被選擇的選單項目 if (rptTemp.ID == "rptMenuItem" && ArticleId == Lv3ArticleId) divMenuItem.Attributes["class"] = "second1"; //被選擇的選單項目 //第一層被選擇的選單項目要抓子項目 if (rptTemp.ID == "rptMenuItem" && ArticleId == Lv3ArticleId) { //隱藏下層項目 bool IsHideChild = Convert.ToBoolean(drvTemp["IsHideChild"]); string ErrMsg = ""; if (!IsHideChild) { //取得子網頁清單 DataSet dsMenuSubList = null; if (c.IsOtherLang) dsMenuSubList = ArticleDataAccessFacade.spArticleMultiLanguage_GetListOfChild(ArticleId, c.qsCultureNameOfLangNo, ref ErrMsg); else dsMenuSubList = ArticleDataAccessFacade.spArticle_GetListOfChild(ArticleId, ref ErrMsg); if (dsMenuSubList != null && dsMenuSubList.Tables[0].Rows.Count > 0) { //顯示選單子項目