Exemple #1
0
        public JsResultObject submitComment(MemberCommentModel comment)
        {
            JsResultObject        re    = new JsResultObject();
            OrderModel            order = BaseZdBiz.Load <OrderModel>(comment.orderFk);
            MemberRewardRuleModel rule  = GetCurRewardRule();

            if (order.checkOutDate.AddDays(rule.comValidityDays).CompareTo(DateTime.Now) < 0)
            {
                re.code = JsResultObject.CODE_ERROR;
                re.msg  = string.Format("离店日期超出{0}日", rule.comValidityDays);
                return(re);
            }

            comment.createDate = DateTime.Now;
            comment.setPk(comment.createPk());
            re = BaseZdBiz.Save(comment);
            order.orderStatus = OrderModel.ORDER_STATUS_COMMENTED;
            re = BaseZdBiz.Update(order, "");
            MemberModel        member     = BaseZdBiz.Load <MemberModel>(comment.memberFk);
            MemberAccountModel oldAccount = getCurrMemberAccount(member);
            MemberAccountModel newAccount = new MemberAccountModel(comment.memberFk);

            newAccount.method       = MemberAccountModel.METHOD_COMMENT_REWARD;
            newAccount.createDate   = DateTime.Now;
            newAccount.method       = MemberAccountModel.METHOD_COMMENT_REWARD;
            newAccount.oldAmount    = oldAccount.newAmount;
            newAccount.changeAmount = Convert.ToInt32(GetReward(order).amount);
            newAccount.newAmount    = newAccount.oldAmount + newAccount.changeAmount;
            newAccount.setPk(newAccount.createPk());
            re = BaseZdBiz.Save(newAccount);

            return(re);
        }
Exemple #2
0
        public JsResultObject requireMemberRewards(MemberModel member)
        {
            JsResultObject            re      = new JsResultObject();
            IList <MemberRewardModel> rewards = getMemberRewards(member, new string[] { MemberRewardModel.REBATE_STATUS_UNREBATED });

            foreach (MemberRewardModel reward in rewards)
            {
                reward.rebateStatus = MemberRewardModel.REBATE_STATUS_REQUIRE;
                re.code            += BaseZdBiz.Update(reward, "").code;
            }
            return(re);
        }
Exemple #3
0
        public JsResultObject cancelOrder(OrderModel order, string cancelCode, string cancelReason)
        {
            JsResultObject re       = new JsResultObject();
            ELongApiBiz    elongBiz = ELongApiBiz.GetInstant();

            order.orderStatus = OrderModel.ORDER_STATUS_CANCEL;
            BaseZdBiz.Update(order, "");
            if (order.elongOrderId != default(int))
            {
                re = elongBiz.cancelHotelOrderById(order.elongOrderId, cancelCode, cancelReason);
            }
            return(re);
        }
Exemple #4
0
        public JsResultObject renewOrder(OrderModel order)
        {
            JsResultObject re       = new JsResultObject();
            ELongApiBiz    elongBiz = ELongApiBiz.GetInstant();

            if (DateTimeUtil.CompareDay(order.checkInDate, DateTime.Now) < 0)
            {
                re.code = JsResultObject.CODE_ERROR;
                re.msg  = string.Format("原订单:{0} 已超出入住日期{1},不能再还原,请重新创建订单", order.id, order.checkInDate.ToShortDateString());
            }
            else
            {
                order.orderStatus = OrderModel.ORDER_STATUS_NEW;
                re     = BaseZdBiz.Update(order, "");
                re.msg = string.Format("原订单:{0} 还原成功,请记得在{1}入住", order.id, order.checkInDate.ToShortDateString());
            }


            return(re);
        }