Esempio n. 1
0
        public JsResultObject submitOrder(OrderModel order, bool isElong)
        {
            JsResultObject re = new JsResultObject();

            order.lastModifyDate = DateTime.Now;


            if (isElong)
            {
                ELongApiBiz elongBiz = ELongApiBiz.GetInstant();
                re = elongBiz.submitHotelOrder(ref order);
                if (re.code == JsResultObject.CODE_SUCCESS)
                {
                    order.orderStatus = OrderModel.ORDER_STATUS_ELONG_SUCCESS;
                }
                else
                {
                    order.orderStatus = OrderModel.ORDER_STATUS_FAIL;
                }
            }

            BaseZdBiz.SaveOrUpdate(order, "订单");

            return(re);
        }
Esempio n. 2
0
        public JsResultObject cancelOrders(IList <OrderModel> orders, string cancelCode, string cancelReason)
        {
            JsResultObject re            = new JsResultObject();
            ELongApiBiz    elongBiz      = ELongApiBiz.GetInstant();
            IList <int>    cancelOrderId = new List <int>();

            foreach (OrderModel order in orders)
            {
                JsResultObject tempRe = elongBiz.cancelHotelOrderById(order.elongOrderId, cancelCode, cancelReason);
                if (tempRe.code == JsResultObject.CODE_SUCCESS)
                {
                    cancelOrderId.Add(order.elongOrderId);
                }
            }
            re.title = "操作成功";
            if (cancelOrderId.Count == 0)
            {
                re.msg = "没有订单被取消";
            }
            else
            {
                re.msg = string.Format("成功取消 {0} 条订单,订单号:{0}",
                                       cancelOrderId.Count
                                       , cancelOrderId.ToArray().ToString()
                                       );
            }

            return(re);
        }
Esempio n. 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);
        }
Esempio n. 4
0
 public static ELongApiBiz GetInstant()
 {
     if (Instant == null)
     {
         lock (lockHelper)
         {
             if (Instant == null)
             {
                 Instant = new ELongApiBiz();
             }
         }
     }
     return(Instant);
 }
Esempio n. 5
0
        public static ELongApiBiz GetInstant()
        {
            if (Instant == null)
            {
                lock (lockHelper)
                {
                    if (Instant == null)
                    {
                        Instant = new ELongApiBiz();
                    }
                }

            }
            return Instant;
        }
Esempio n. 6
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);
        }