// 廣告成效詳細內容頁
        public ActionResult Detail(AdsDetailStatisticsSearchModel search, int?index)
        {
            DateTime          today = DateTime.Now;
            DateTime          firstDayOfCurrentMonth = new DateTime(today.Year, today.Month, 1);
            DateTime          endDayOfCurrentMonth   = firstDayOfCurrentMonth.AddMonths(1).AddDays(-1);
            AdsCustomizeModel adCustomize            = AdvertisementDAO.GetAdsCustomizeItem(search.AdsCustomId);

            adCustomize = adCustomize ?? new AdsCustomizeModel();

            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["ExportDetailSearch"] = search;
                }
                else
                {
                    AdsDetailStatisticsSearchModel prevSearch = Utility.GetSearchValue <AdsDetailStatisticsSearchModel>();
                    if (prevSearch != null)
                    {
                        search = prevSearch;
                    }
                }
            }
            else if (Request.HttpMethod == "POST")
            {
                Utility.SetSearchValue(search);
                Session["ExportDetailSearch"] = search;
            }

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

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

            ViewBag.Pagination = new Pagination {
                PageSize = pageSize, PageIndex = (int)index, TotalRecord = recordCount
            };
            ViewBag.Search    = search;
            ViewBag.StartDate = firstDayOfCurrentMonth;
            ViewBag.EndDate   = endDayOfCurrentMonth;
            ViewBag.AdsCustomizeDescription = adCustomize.Description;
            return(View(statisticsData));
        }