예제 #1
0
        // 最新訊息 - 活動寫真 - 各州活動列表
        public ActionResult EventStatesList(int?statesTypeID, int?page)
        {
            if (!statesTypeID.HasValue)
            {
                return(RedirectToAction("EventLatest"));
            }

            //======語系取得========
            string langCd = GetLang();
            //======================

            EventStatesListFilter filter = new EventStatesListFilter()
            {
                CurrentPage = page ?? 1,
                LangCode    = langCd
            };

            statesTypeID = statesTypeID ?? 1;

            EventStatesRepository repo  = new EventStatesRepository();
            EventStatesResult     mdoel = repo.GetList((int)statesTypeID, filter);

            mdoel.StatesTypeID    = (int)statesTypeID;
            TempData["StateInfo"] = repo.GetStatesCateByID((int)statesTypeID, langCd);
            return(View(mdoel));
        }
예제 #2
0
        // 最新訊息 - 活動寫真 - 各州活動分類
        public ActionResult EventStatesCategory()
        {
            //======語系取得========
            string langCd = GetLang();
            //======================

            EventStatesRepository repo = new EventStatesRepository();
            var mdoel = repo.GetStatesCate(langCd);

            return(View(mdoel));
        }
예제 #3
0
        // 最新訊息 - 活動寫真 - 各州活動內容
        public ActionResult EventStatesContent(int?statesTypeID, int?ID, int?pagingID)
        {
            if (!statesTypeID.HasValue || !ID.HasValue)
            {
                return(RedirectToAction("EventStatesList"));
            }

            //======語系取得========
            string langCd = GetLang();
            //======================

            EventStatesRepository repo  = new EventStatesRepository();
            EventStatesContent    model = repo.GetContentByID((int)statesTypeID, (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));
        }