Ejemplo n.º 1
0
        // 最新訊息 - 活動寫真 - 最新(中央)活動
        public ActionResult EventLatest(int?page)
        {
            //======語系取得========
            string lang_id = GetLang();
            //======================
            EventLatestListFilter filter = new EventLatestListFilter()
            {
                CurrentPage = page ?? 1,
                LangCode    = lang_id
            };

            EventLatestRepository repo  = new EventLatestRepository();
            EventLatestResult     mdoel = repo.GetList(filter);

            return(View(mdoel));
        }
Ejemplo n.º 2
0
        // 最新訊息 - 活動寫真 - 最新活動內容
        public ActionResult EventLatestContent(int?ID, int?pagingID)
        {
            if (!ID.HasValue)
            {
                return(RedirectToAction("EventLatest"));
            }
            //======語系取得========
            string langCd = GetLang();
            //======================
            EventLatestRepository repo  = new EventLatestRepository();
            EventContent          model = repo.GetContentByID((int)ID, langCd);

            if (pagingID != null)
            {
                model.PagingID = (int)pagingID;
                var pagFirst = model.Data.PagingList.Where(s => s.ID == (int)pagingID).FirstOrDefault();
                if (pagFirst == null)
                {
                    return(RedirectToAction("EventLatest"));
                }
                pagFirst.Current = "current";
            }
            else
            {
                if (model.Data.PagingList.Count > 0)
                {
                    model.Data.PagingList.First().Current = "current";
                }
            }

            //=瀏覽記錄====================
            DataTable d_log;
            string    err_msg = "";

            DB.Log_Insert(ID.ToString(), "News");
            d_log = DB.Log_List(ref err_msg, ID.ToString(), "News");
            ViewData["log_count"] = d_log.Rows.Count.ToString();
            //============================

            return(View(model));
        }