示例#1
0
 /// <summary>
 /// 获取订单
 /// </summary>
 /// <param name="orderId"></param>
 private void GetData(int orderId)
 {
     var orderRequest = new GetHotelOrderByOrderIdRequest()
     {
         OrderId = orderId
     };
     Order = BusHelper.Send<GetHotelOrderResponse>(orderRequest); 
     GetIdentifyingCode(orderId);
     GetOrderList(orderId);
     GetUserMsg(Order);
     //            GetOrderStatusMsg(Order);
 }
示例#2
0
        protected void btnSaveRefund_OnClick(object sender, EventArgs e)
        {
            var wxUserweixin = GetAdminInfo();
            if (wxUserweixin == null)
            {
                throw new Exception("用户不能为空!");
            }
            if (chkIsRefund.Checked)
            {
                double money = MyCommFun.Str2Float(txtAmount.Text);
                var hotelService = new HotelService();
                var orderRequest = new GetHotelOrderByOrderIdRequest()
                {
                    OrderId = OrderId
                };
                Order = BusHelper.Send<GetHotelOrderResponse>(orderRequest);

                var hotelRequest = new GetHotelRequest()
                {
                    HotelId = Order.HotelId
                };
                var hotel = BusHelper.Send<GetHotelResponse>(hotelRequest);

                using (var scope = new TransactionScope())
                {
                    var dto = new TuidanDto()
                    {

                        OrderId = Order.id,
                        hotelid = Order.hotelid.Value,
                        roomid = Order.roomid.Value,
                        openid = Order.openid,
                        wid = hotel.wid.Value,
                        operateUser = wxUserweixin.id,
                        refundAmount = money,
                        refundTime = DateTime.Now,
                        remarks = this.remarks.InnerText,
                        refundCode = "HT" + DateTime.Now.ToString("yyyyMMddHHmmssffff") + Utils.Number(5)

                    };
                    hotelService.AddTuidan(dto);

                    string return_msg = String.Empty;

                    if (WeChatRefund(Order, dto, hotel.wid.Value, out return_msg))//
                    {
                        new BLL.wx_hotel_dingdan().RefundComplete(Order.OrderNumber);

                        AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改酒店状态为" +
                    HotelStatusManager.OrderStatus.Refunding.StatusName
                    + HotelStatusManager.OrderStatus.Refunding.StatusId + ",主键为" + OrderId); //记录日志
                        JscriptMsg("退款成功!", "hotel_dingdan_manage.aspx?hotelid=" + hotelid + "", "Success");
                    }
                    else
                    {
                        Response.Write(return_msg);
                        GetData(OrderId);
                    }
                    //                    _hotelOrderService.Update(Order.id, HotelStatusManager.OrderStatus.Refunding.StatusId.ToString());



                    scope.Complete();
                }










            }
        }
示例#3
0
 public hotel_dingdan_cz()
 {
     Order = new GetHotelOrderResponse();
 }
示例#4
0
        private void GetUserMsg(GetHotelOrderResponse order)
        {

            //订单信息
            if (order != null)
            {
                var request = new GetHotelRequest()
                {
                    HotelId = order.HotelId
                };
                var hotel = BusHelper.Send<GetHotelResponse>(request);
                var createTime = string.Format("{0:yyyy/MM/dd HH:mm}", Order.CreateDate);
                
                Dingdanren += "<tr> <td>酒店商户或门店:" + hotel.Name + "</td></tr>";
                Dingdanren += "<tr> <td>商户或门店编号:" + hotel.Code + "</td></tr>";
                Dingdanren += "<tr><td width=\"70\">订单编号: " + order.OrderNum + "</td></tr>";
                Dingdanren += "<tr> <td>交易日期:" + createTime + "</td></tr>";
                Dingdanren += "<tr><td>预定人:" + order.OrderPersonName + "</td></tr>";
                Dingdanren += "<tr><td>电话:" + order.Tel + "</td></tr>";
                //                dingdanren += "<tr><td>地址:" + manage.address + "</td></tr>";
                //                dingdanren += "<tr><td>备注 :" + manage.oderRemark + "</td></tr>";

                status = HotelStatusManager.OrderStatus.GetStatusDict(order.OrderStatus);
                Dingdanren += "<tr><td>订单状态:<em  style='width:70px;' class='" + status.CssClass
                    + "'>" + status.StatusName + "</em></td></tr>";


            }
            else
            {
                Dingdanren += "<tr> <td>酒店商户或门店:</td></tr>";
                Dingdanren += "<tr> <td>商户或门店编号:</td></tr>";
                Dingdanren += "<tr><td width=\"70\">订单编号:</td></tr>";
                Dingdanren += "<tr> <td>交易日期:</td></tr>";
                Dingdanren += "<tr><td>预定人:</td></tr>";
                Dingdanren += "<tr><td>电话:</td></tr>";

                Dingdanren += "<tr><td>订单状态:<em  style='width:70px;' class='no'>未处理</em></td></tr>";
            }
        }
示例#5
0
        /// <summary>
        /// 获取最大可退价格
        /// </summary>
        /// <param name="order"></param>
        private decimal GetPrice(GetHotelOrderResponse order)
        {
            decimal result = 0;

            var dateSpan = order.LeaveDate - order.ArriveDate;
            result = order.Price * order.OrderNum * dateSpan.Days;//单位分 

            return result;
        }
示例#6
0
        /// <summary>
        /// 获取订单状态
        /// </summary>
        /// <param name="order"></param>
        private void GetOrderStatusMsg(GetHotelOrderResponse order)
        {
            orderStatus = order.OrderStatus;
            //支付状态下默认退款金额为订单总额
            if (orderStatus == HotelStatusManager.OrderStatus.Payed.StatusId)
            {
                var result = GetPrice(order);

                txtAmount.Text = result.ToString();
                if (isAdmin)
                {
                    hidConfirmStr.Value = "确定执行【退款】操作吗?";

//                    WHEN 0 THEN ''未支付''
//                    WHEN 1 THEN ''已支付''
//                    WHEN 2 THEN ''已使用''
//                    WHEN 3 THEN ''申请退款''
//                    WHEN 4 THEN ''已退款''
                    if (_listCode != null && _listCode.Any(c => c.Status == 2))//订单中有验证码已使用
                    {
                        hidConfirmStr.Value = string.Format("{0},{1}", "订单中有验证码已使用", hidConfirmStr.Value);
                    }
                }
            }
            else if (orderStatus == HotelStatusManager.OrderStatus.Refunding.StatusId
                     || orderStatus == HotelStatusManager.OrderStatus.Refunded.StatusId)
            {
                var request = new GetRefundOrderRequest()
                {
                    OrderId = order.Id,
                    HotelId = order.HotelId
                };
                var response = BusHelper.Send<GetRefundOrderResponse>(request);
                RefundOrder = response.RefundOrder;
                if (RefundOrder != null && RefundOrder.OperateUser > 0)
                {
                    var managerInfoService = new ManagerInfoService();
                    var manager = managerInfoService.GetModel(RefundOrder.OperateUser);
                    
                    uName = manager.RealName;
                    var managerRoleService = new ManagerRoleService();
                    roleName = managerRoleService.GetTitle(manager.RoleId); 
                }
            }
        }
        protected void btn_completed_OnClick(object sender, EventArgs e)
        {

            Order = _hotelOrderService.GetModel(dingdanid);
            _hotelOrderService.Update(Order.id, HotelStatusManager.OrderStatus.Completed.StatusId.ToString());

            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改酒店状态为" +
                   HotelStatusManager.OrderStatus.Completed.StatusName
                   + HotelStatusManager.OrderStatus.Completed.StatusId + ",主键为" + dingdanid); //记录日志
            JscriptMsg("修改成功!", "hotel_dingdan_manage.aspx?hotelid=" + hotelid + "", "Success");
        }
        /// <summary>
        /// 获取订单状态
        /// </summary>
        /// <param name="order"></param>
        private void GetOrderStatusMsg(GetHotelOrderResponse order)
        {
            orderStatus = order.OrderStatus;
            //支付状态下默认退款金额为订单总额
            if (orderStatus == HotelStatusManager.OrderStatus.Payed.StatusId)
            {
                var result = GetPrice(order);

                txtAmount.Text = result.ToString();
                if (isAdmin)
                {
                    hidConfirmStr.Value = "确定执行【退款】操作吗?";

//                    WHEN 0 THEN ''未支付''
//                    WHEN 1 THEN ''已支付''
//                    WHEN 2 THEN ''已使用''
//                    WHEN 3 THEN ''申请退款''
//                    WHEN 4 THEN ''已退款''
                    if (_listCode != null && _listCode.Any(c => c.Status == 2))//订单中有验证码已使用
                    {
                        hidConfirmStr.Value = string.Format("{0},{1}", "订单中有验证码已使用", hidConfirmStr.Value);
                    }
                }
            }
            else if (orderStatus == HotelStatusManager.OrderStatus.Refunding.StatusId
                     || orderStatus == HotelStatusManager.OrderStatus.Refunded.StatusId)
            {

              
                 
                tuidan = hotelService.GetModel(order.id, order.hotelid.Value);
                if (tuidan != null && tuidan.operateUser > 0)
                {
                    var manager = new BLL.manager().GetModel(tuidan.operateUser);
                    uName = manager.real_name;
                    roleName = new WeiXinPF.BLL.manager_role().GetTitle(manager.role_id);
                }
            }
        }