예제 #1
0
        /// <summary>
        /// 优惠券列表
        /// </summary>
        /// <param name="index"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="stutas"></param>
        /// <param name="storeNum"></param>
        /// <returns></returns>
        public ActionResult ShowCoupon(int index = 1, string start = "", string end = "", int stutas = -1, string storeNum = "")
        {
            var      loginUser = (UserInfo)ViewBag.User;
            DateTime startTime = new DateTime();
            DateTime endTime   = new DateTime();
            DateTime now       = DateTime.Now;
            DateTime date      = now.AddDays(-1);

            if (string.IsNullOrEmpty(start))
            {
                startTime = new DateTime(date.Year, date.Month, date.Day - 1, 16, 0, 0);
            }
            else
            {
                startTime = Utils.GetTime(start, true);
            }
            if (string.IsNullOrEmpty(end))
            {
                endTime = new DateTime(now.Year, now.Month, now.Day, 16, 0, 0);
            }
            else
            {
                endTime = Utils.GetTime(end);
            }
            var page = _active.GetCouponPager(index, startTime, endTime, stutas, storeNum, loginUser.UserId);

            ViewBag.Start    = startTime;
            ViewBag.End      = endTime;
            ViewBag.Stutas   = stutas;
            ViewBag.StoreNum = storeNum;
            ViewBag.Pager    = page;
            return(View());
        }