Exemplo n.º 1
0
        public ActionResult FocusCategory()
        {
            //======語系取得========
            string langCd = GetLang();
            //======================
            FocusRepository repo  = new FocusRepository();
            var             mdoel = repo.GetFocusCate(langCd);

            return(View(mdoel));
        }
Exemplo n.º 2
0
        // 焦點專欄 - 內容
        public ActionResult FocusContent(int?focusTypeID, int?ID, int?pagingID)
        {
            if (!focusTypeID.HasValue || !ID.HasValue)
            {
                return(RedirectToAction("EventLatest"));
            }

            //======語系取得========
            string langCd = GetLang();
            //======================
            FocusRepository  repo  = new FocusRepository();
            FocusNewsContent model = repo.GetContentByID((int)focusTypeID, (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("FocusList", new { focusTypeID }));
                }
                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(), "Focus");
            d_log = DB.Log_List(ref err_msg, ID.ToString(), "Focus");
            ViewData["log_count"] = d_log.Rows.Count.ToString();
            //============================

            return(View(model));
        }
Exemplo n.º 3
0
        // 焦點專欄 - 列表
        public ActionResult FocusList(int?focusTypeID, int?page)
        {
            if (!focusTypeID.HasValue)
            {
                return(RedirectToAction("EventLatest"));
            }
            //======語系取得========
            string langCd = GetLang();
            //======================
            FocusNewsListFilter filter = new FocusNewsListFilter()
            {
                CurrentPage = page ?? 1,
                LangCode    = langCd
            };

            focusTypeID = focusTypeID ?? 1;

            FocusRepository repo  = new FocusRepository();
            FocusNewsResult mdoel = repo.GetList((int)focusTypeID, filter);

            return(View(mdoel));
        }