// 廣告成效頁
        public ActionResult Index(AdsStatisticsSearchModel search, long?siteId, int?index)
        {
            DateTime today = DateTime.Now;
            DateTime firstDayOfCurrentMonth = new DateTime(today.Year, today.Month, 1);
            DateTime endDayOfCurrentMonth   = firstDayOfCurrentMonth.AddMonths(1).AddDays(-1);

            if (Request.HttpMethod == "GET")
            {
                if (index == null)
                {
                    Utility.ClearSearchValue();
                    search.StartDate        = search.StartDate != DateTime.MinValue ? search.StartDate : firstDayOfCurrentMonth;
                    search.EndDate          = search.EndDate != DateTime.MinValue ? search.EndDate : endDayOfCurrentMonth;
                    Session["ExportSearch"] = search;
                }
                else
                {
                    AdsStatisticsSearchModel prevSearch = Utility.GetSearchValue <AdsStatisticsSearchModel>();
                    if (prevSearch != null)
                    {
                        search = prevSearch;
                    }
                }
            }
            else if (Request.HttpMethod == "POST")
            {
                Utility.SetSearchValue(search);
                Session["ExportSearch"] = search;
            }

            search.SiteId = search.SiteId ?? siteId;

            if (index == null)
            {
                index = 1;
            }

            int pageSize    = 20;
            int recordCount = 0;
            List <AdsStatisticsViewModel> statisticsData = AdvertisementStatisticsDAO.GetAdsStatisticsData(search, pageSize, (int)index, out recordCount);

            ViewBag.Pagination = new Pagination {
                PageSize = pageSize, PageIndex = (int)index, TotalRecord = recordCount
            };
            ViewBag.AdsPositionMapping = AdvertisementStatisticsDAO.AdsPosition;
            ViewBag.UploadUrl          = WorkV3.Golbal.UpdFileInfo.GetVPathBySiteID((long)search.SiteId, "Advertisement");
            ViewBag.Search             = search;
            ViewBag.StartDate          = firstDayOfCurrentMonth;
            ViewBag.EndDate            = endDayOfCurrentMonth;
            ViewBag.SiteId             = search.SiteId;

            return(View(statisticsData));
        }