예제 #1
0
        //
        // GET: /Reward/

        public ActionResult Index(string dateRegexp)
        {
            MemberModel member = this.getAuthMember();

            if (member == null)
            {
                this.SetResult(JsResultObject.CODE_ALERT, "进入点评奖励,请用户先进行登陆", false);
                return(RedirectToAction("Login", "Home"));
            }
            ICriteria icr = BaseZdBiz.CreateCriteria <MemberRewardModel>();

            icr.Add(Restrictions.Eq("memberFk", member.id));

            if (dateRegexp == "_week")
            {
                ToyzWeekObject week = new ToyzWeekObject(DateTime.Now);
                icr.Add(week.createCriterion("createDate"));
            }
            else if (dateRegexp == "_month")
            {
                ToyzMonthObject month = new ToyzMonthObject(DateTime.Now);
                icr.Add(month.createCriterion("createDate"));
            }
            else if (dateRegexp == "_season")
            {
                ToyzSeasonObject season = new ToyzSeasonObject(DateTime.Now);
            }

            icr.AddOrder(Order.Desc("createDate"));

            IList <MemberRewardModel> rewards = icr.List <MemberRewardModel>();

            ViewData[typeof(MemberRewardModel).Name] = rewards;
            return(View());
        }
예제 #2
0
        //
        // GET: /Reward/
        public ActionResult Index(string dateRegexp)
        {
            MemberModel member = this.getAuthMember();
            if (member == null)
            {
                this.SetResult(JsResultObject.CODE_ALERT, "进入点评奖励,请用户先进行登陆",false);
                return RedirectToAction("Login", "Home");
            }
            ICriteria icr = BaseZdBiz.CreateCriteria<MemberRewardModel>();
            icr.Add(Restrictions.Eq("memberFk", member.id));

            if (dateRegexp == "_week")
            {
                ToyzWeekObject week = new ToyzWeekObject(DateTime.Now);
                icr.Add(week.createCriterion("createDate"));
            }
            else if (dateRegexp == "_month")
            {
                ToyzMonthObject month = new ToyzMonthObject(DateTime.Now);
                icr.Add(month.createCriterion("createDate"));

            }
            else if (dateRegexp == "_season")
            {

                ToyzSeasonObject season = new ToyzSeasonObject(DateTime.Now);
            }

            icr.AddOrder(Order.Desc("createDate"));

            IList<MemberRewardModel> rewards = icr.List<MemberRewardModel>();
            ViewData[typeof(MemberRewardModel).Name] = rewards;
            return View();
        }
예제 #3
0
        //
        // GET: /Order/

        public ActionResult Index(string dateRegexp, DateTime?startDate, DateTime?endDate)
        {
            MemberModel member = this.getAuthMember();

            if (member == null)
            {
                this.SetResult(JsResultObject.CODE_ALERT, "进入订单管理,请用户先进行登陆", false);

                return(RedirectToAction("Login", "Home"));
            }
            ICriteria icr = BaseZdBiz.CreateCriteria <OrderModel>();

            icr.Add(Restrictions.Eq("memberFk", member.id));


            if (WebUtil.IsPost())
            {
                ToyzRangeDateObject range = new ToyzRangeDateObject(startDate ?? DateTime.Now, endDate ?? DateTime.Now.AddDays(1));
                icr.Add(range.createCriterion("createDate"));
                ViewData["startDate"] = range.getFirstDay().ToShortDateString();
                ViewData["endDate"]   = range.getLastDay().ToShortDateString();
            }
            else
            {
                if (string.IsNullOrEmpty(dateRegexp) || dateRegexp == "_week")
                {
                    ToyzWeekObject week = new ToyzWeekObject(DateTime.Now);
                    icr.Add(week.createCriterion("checkInDate"));
                    ViewData["startDate"] = week.sun.ToShortDateString();
                    ViewData["endDate"]   = week.sat.ToShortDateString();
                }
                else if (dateRegexp == "_month")
                {
                    ToyzMonthObject month = new ToyzMonthObject(DateTime.Now);
                    icr.Add(month.createCriterion("checkInDate"));
                    ViewData["startDate"] = month.getFirstDay().ToShortDateString();
                    ViewData["endDate"]   = month.getLastDay().ToShortDateString();
                }
                else if (dateRegexp == "_season")
                {
                    ToyzSeasonObject season = new ToyzSeasonObject(DateTime.Now);
                }
            }
            icr.AddOrder(Order.Desc("checkInDate"));

            IList <OrderModel> orders = icr.List <OrderModel>();

            ViewData[typeof(OrderModel).Name] = orders;
            return(View());
        }
예제 #4
0
        //
        // GET: /Order/
        public ActionResult Index(string dateRegexp, DateTime? startDate, DateTime? endDate)
        {
            MemberModel member = this.getAuthMember();
            if (member == null)
            {
                this.SetResult(JsResultObject.CODE_ALERT,"进入订单管理,请用户先进行登陆",false);

                return RedirectToAction("Login", "Home");
            }
            ICriteria icr = BaseZdBiz.CreateCriteria<OrderModel>();
            icr.Add(Restrictions.Eq("memberFk", member.id));

            if (WebUtil.IsPost())
            {

                ToyzRangeDateObject range = new ToyzRangeDateObject(startDate ?? DateTime.Now, endDate ?? DateTime.Now.AddDays(1));
                icr.Add(range.createCriterion("createDate"));
                ViewData["startDate"] = range.getFirstDay().ToShortDateString();
                ViewData["endDate"] = range.getLastDay().ToShortDateString();
            }
            else
            {
                if (string.IsNullOrEmpty(dateRegexp)|| dateRegexp == "_week")
                {
                    ToyzWeekObject week = new ToyzWeekObject(DateTime.Now);
                    icr.Add(week.createCriterion("checkInDate"));
                    ViewData["startDate"] = week.sun.ToShortDateString();
                    ViewData["endDate"] = week.sat.ToShortDateString();
                }
                else if (dateRegexp == "_month")
                {
                    ToyzMonthObject month = new ToyzMonthObject(DateTime.Now);
                    icr.Add(month.createCriterion("checkInDate"));
                    ViewData["startDate"] = month.getFirstDay().ToShortDateString();
                    ViewData["endDate"] = month.getLastDay().ToShortDateString();

                }
                else if (dateRegexp == "_season")
                {

                    ToyzSeasonObject season = new ToyzSeasonObject(DateTime.Now);
                }
            }
            icr.AddOrder(Order.Desc("checkInDate"));

            IList<OrderModel> orders = icr.List<OrderModel>();
            ViewData[typeof(OrderModel).Name] = orders;
            return View();
        }