Esempio n. 1
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();
                }










            }
        }
Esempio n. 2
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>";
            }
        }