예제 #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
        protected void save_groupbase_Click(object sender, EventArgs e)
        {
            Guid identifyingCodeId;

            if (Guid.TryParse(this.cid, out identifyingCodeId))
            {
                GetIdentifyingCodeResponse identifyingCodeObject = null;

                var result = Global.Bus.Send<GetIdentifyingCodeResponse>(HotelServiceName,
                    new GetByIdnetifyingCodeIdRequest()
                    {
                        IdentifyingCodeId = identifyingCodeId,
                        ModuleName = ModuleName,
                        Wid = this.wid
                    });

                if (!result.IsSuccess)
                {
                    this.Response.Write("<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");

                    return;
                }
                else
                {
                    identifyingCodeObject = result.Data;
                }               


                var orderRequest = new GetHotelOrderByOrderIdRequest()
                                    {
                                        OrderId = int.Parse(identifyingCodeObject.OrderId)
                                    };
                GetHotelOrderResponse order = null;

              var orderResult = Global.Bus.Send<GetHotelOrderResponse>(HotelServiceName, orderRequest);               

                if (!orderResult.IsSuccess)
                {
                    this.Response.Write(
                        "<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");
                    return;
                }
                else
                {
                    order = orderResult.Data;
                }

                if (order != null)
                {
                    if (order.OrderStatus.Equals(HotelStatusManager.OrderStatus.Refunded.StatusId) ||
                        order.OrderStatus.Equals(HotelStatusManager.OrderStatus.Refunding.StatusId)
                        || order.OrderStatus.Equals(HotelStatusManager.OrderStatus.Completed))
                    {
                        this.Response.Write(
                            "<script language='javascript' type='text/javascript'>alert('该订单已完成或进行退单处理,不能进行验证!')</script>");
                        return;
                    }
                    else if (identifyingCodeObject.ShopId.Equals(this.hotelid.ToString(CultureInfo.InvariantCulture)))
                    {
                        var useIdentifyingCode = new MakeUseOfIdentifyingCode() {IdentifyingCodeId = identifyingCodeId};

                        Global.Bus.MyBus.Send(HotelServiceName, useIdentifyingCode)
                            .Register<int>(response =>
                            {
                                if (response == 1)
                                {
                                    AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改支付状态,主键为" + id);
                                        //记录日志                                                                                                   //Response.Redirect("dingdan_confirm.aspx?shopid=" + shopid + "");
                                    Response.Write(
                                        "<script language='javascript' type='text/javascript'>alert('核销成功!');location.href = 'dingdan_confirm.aspx?shopid=" +
                                        hotelid + "';</script>");
                                }
                                else
                                {
                                    AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改支付状态失败,主键为" + id);
                                        //记录日志                                                                                                   //Response.Redirect("dingdan_confirm.aspx?shopid=" + shopid + "");
                                    Response.Write(
                                        "<script language='javascript' type='text/javascript'>alert('核销失败');</script>");
                                }
                            });
                    }
                    else
                    {
                        this.Response.Write(
                            "<script language='javascript' type='text/javascript'>alert('核销失败。')</script>");
                    }
                }
                else
                {
                    this.Response.Write(
                        "<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");
                }                                    
            }
        }