Example #1
0
        public void Handle(GetIdentifyingCodeRequest message)
        {
            Console.WriteLine("Receive GetIdentifyingCodeRequest MessageNumber is :{0}", message.Number);
            var info = IdentifyingCodeService.GetConfirmIdentifyingCodeInfo(message.ShopId, message.Number,
                                                                            message.ModuleName, message.Wid);

            var response = new GetIdentifyingCodeResponse()
            {
                CreateTime        = info.CreateTime,
                IdentifyingCode   = info.IdentifyingCode,
                IdentifyingCodeId = info.IdentifyingCodeId,
                ModifyTime        = info.ModifyTime,
                ModuleName        = info.ModuleName,
                OrderCode         = info.OrderCode,
                OrderId           = info.OrderId,
                ProductCode       = info.ProductCode,
                ProductId         = info.ProductId,
                ShopId            = info.ShopId,
                Wid    = info.Wid,
                Status = info.Status
            };

            bus.Reply(response);
            Console.WriteLine("Response GetIdentifyingCodeResponse Message");
        }
Example #2
0
        /// <summary>
        /// 获取验证码剩余数量
        /// </summary>
        /// <returns></returns>
        private int GetCodeCount(wx_hotel_dingdan dingdan)
        {
            var count = 0;

            var wxHotelsInfo = new BLL.wx_hotels_info().GetModel(dingdan.hotelid.Value);
            var listCodes    = IdentifyingCodeService.GetIdentifyingCodeInfoByOrderId
                                   (dingdan.hotelid.Value, "hotel",
                                   dingdan.id.ToString(), wxHotelsInfo.wid.Value);

            //查询状态为已使用的
            var usedCode = listCodes.Where(t => t.Status == 2);

            if (usedCode.Any())
            {
                count = dingdan.orderNum.Value - usedCode.Count();
            }
            else
            {
                count = dingdan.orderNum.Value;
            }

            if (count <= 0)
            {
                //                ordermsg = "房间已全部入住";
                //                ordermsg = string.Format(@"  <div class='alert alert-warning' role='alert'>
                //      <strong> 提示!</strong>  {0}
                //         </div>", ordermsg);
            }
            else
            {
            }
            return(count);
        }
Example #3
0
        public bool PayNotify(OneGulp.WeChat.MP.TenPayLibV3.TenPayV3.Model.PaymentNotify paymentNotify, out string message)
        {
            message = string.Empty;
            var Pay_Ready       = 1;
            var isModifySuccess = false;

            //完成支付后续操作
            try
            {
                using (var scope = new TransactionScope())
                {
                    new BLL.wx_hotel_dingdan().PaySuccess(paymentNotify.out_trade_no);
                    isModifySuccess = IdentifyingCodeService.ModifyIdentifyingCodeInfoStatus(paymentNotify.out_trade_no, Pay_Ready);

                    if (isModifySuccess)
                    {
                        scope.Complete();
                    }
                }

                return(isModifySuccess);
            }
            catch (Exception exception)
            {
                message = exception.Message;
                return(false);
            }
        }
Example #4
0
        protected void save_groupbase_Click(object sender, EventArgs e)
        {
            var status = StatusManager.DishStatus.Used.StatusID;

            Guid identifyingCodeId;

            if (Guid.TryParse(cid, out identifyingCodeId))
            {
                var identifyingCodeObject = IdentifyingCodeService.GetIdentifyingCodeInfoByIdentifyingCodeId(identifyingCodeId, ModuleName, wid);

                if (identifyingCodeObject != null && identifyingCodeObject.ShopId.Equals(shopid.ToString()))
                {
                    var order = new BLL.wx_diancai_dingdan_manage().GetModel(int.Parse(identifyingCodeObject.OrderId));

                    if (order != null && order.payStatus != null)
                    {
                        if (order.payStatus.Value.Equals(StatusManager.DishStatus.PreRefund.StatusID) ||
                            order.payStatus.Value.Equals(StatusManager.DishStatus.Refund.StatusID) ||
                            order.payStatus.Value.Equals(StatusManager.DishStatus.Used.StatusID) ||
                            order.IsFinish)
                        {
                            this.Response.Write(
                                "<script language='javascript' type='text/javascript'>alert('该订单已完成或进行退单处理,不能进行验证!')</script>");
                        }
                        else
                        {
                            identifyingCodeObject.Status     = StatusManager.DishStatus.Used.StatusID;
                            identifyingCodeObject.ModifyTime = DateTime.Now;

                            using (var scope = new TransactionScope())
                            {
                                IdentifyingCodeService.ModifyIdentifyingCodeInfo(identifyingCodeObject);
                                managebll.AfterVerification(wid, shopid, int.Parse(identifyingCodeObject.OrderId));

                                scope.Complete();
                            }
                            manage = managebll.GetModel(MyCommFun.Str2Int(id));
                            BLL.wx_diancai_member menbll = new BLL.wx_diancai_member();
                            if (status == StatusManager.DishStatus.Used.StatusID)
                            {
                                menbll.Update(manage.openid);
                            }
                            if (status == StatusManager.DishStatus.PreRefund.StatusID || status == StatusManager.DishStatus.Refund.StatusID)
                            {
                                menbll.Updatefail(manage.openid);
                            }


                            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改支付状态,主键为" + id); //记录日志
                            //JscriptMsg("修改成功!", "dingdan_confirm.aspx?shopid=" + shopid + "", "Success");
                            //Response.Redirect("dingdan_confirm.aspx?shopid=" + shopid + "");
                            Response.Write("<script language='javascript' type='text/javascript'>alert('核销成功!');location.href = 'dingdan_confirm.aspx?shopid=" + shopid + "';</script>");
                        }
                    }
                }
            }
        }
Example #5
0
        private IList <OrderDetailDTO> SearchData()
        {
            int    shopid     = MXRequest.GetQueryInt("shopid") == 0 ? GetShopId() : MXRequest.GetQueryInt("shopid");
            string condition  = "";
            var    moduleName = "restaurant";

            if (!String.IsNullOrEmpty(startDate.Text.Trim()))
            {
                condition += " FinishTime>='" + startDate.Text.Trim() + "' ";
            }
            if (!String.IsNullOrEmpty(endDate.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " FinishTime<='" + endDate.Text.Trim() + "' ";
            }
            if (!String.IsNullOrEmpty(dingdanId.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " orderNumber LIKE '%" + dingdanId.Text.Trim() + "%' ";
            }
            if (!String.IsNullOrEmpty(paidmin.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " payAmount>" + paidmin.Text.Trim() + " ";
            }
            if (!String.IsNullOrEmpty(paidmax.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " payAmount<" + paidmax.Text.Trim() + " ";
            }
            if (!String.IsNullOrEmpty(orderperson.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " customerName LIKE '%" + orderperson.Text.Trim() + "%' ";
            }

            var result = IdentifyingCodeService.GetOrderDetail(shopid, moduleName, condition);

            return(result);
        }
Example #6
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns></returns>
        private IList <OrderDetailDTO> GetData()
        {
            int    shopid     = MXRequest.GetQueryInt("hotelid") == 0 ? this.GetHotelId() : MXRequest.GetQueryInt("hotelid");
            string condition  = "";
            var    moduleName = "hotel";

            if (!String.IsNullOrEmpty(startDate.Text.Trim()))
            {
                condition += " modifytime>='" + startDate.Text.Trim() + "' ";
            }
            if (!String.IsNullOrEmpty(endDate.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " modifytime<='" + endDate.Text.Trim() + "' ";
            }
            if (!String.IsNullOrEmpty(dingdanId.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " orderNumber LIKE '%" + dingdanId.Text.Trim() + "%' ";
            }
            if (!String.IsNullOrEmpty(paidmin.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " payAmount>" + paidmin.Text.Trim() + " ";
            }
            if (!String.IsNullOrEmpty(paidmax.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " payAmount<" + paidmax.Text.Trim() + " ";
            }
            if (!String.IsNullOrEmpty(orderperson.Text.Trim()))
            {
                if (!String.IsNullOrEmpty(condition))
                {
                    condition += " and ";
                }
                condition += " customerName LIKE '%" + orderperson.Text.Trim() + "%' ";
            }

            var detail = IdentifyingCodeService.GetOrderDetail(shopid, moduleName, condition);

            return(detail);
        }
Example #7
0
        protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var moduleName = "hotel";

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Repeater rp   = e.Item.FindControl("rp") as Repeater;
                var      list = e.Item.DataItem as OrderDetailDTO;

                rp.DataSource = IdentifyingCodeService.GetIdentifyingCodeDTO(moduleName, list.Id); // gbll.GetCredentialsCommodityList(list.Id, moduleName);
                rp.DataBind();
            }
        }
Example #8
0
        /// <summary>
        /// 获取验证码
        /// todo:添加功能
        /// </summary>
        /// <param name="wxHotelDingdan"></param>
        private void GetVerificationCode(wx_hotel_dingdan wxHotelDingdan)
        {
            if (wxHotelDingdan.orderStatus == HotelStatusManager.OrderStatus.Payed.StatusId

                || wxHotelDingdan.orderStatus == HotelStatusManager.OrderStatus.Refunded.StatusId ||
                wxHotelDingdan.orderStatus == HotelStatusManager.OrderStatus.Refunding.StatusId
                )
            {
                var wxHotelsInfo = new BLL.wx_hotels_info().GetModel(wxHotelDingdan.hotelid.Value);
                var list         = IdentifyingCodeService.GetIdentifyingCodeInfoByOrderId
                                       (wxHotelDingdan.hotelid.Value, "hotel",
                                       wxHotelDingdan.id.ToString(), wxHotelsInfo.wid.Value);
                foreach (var code in list)
                {
                    //根据验证码状态, 显示在界面的状态
                    int showStatus = 0;
                    switch (code.Status)
                    {
                    case 0:
                    case 1:
                        showStatus = 1;
                        if (wxHotelDingdan.orderStatus == HotelStatusManager.OrderStatus.Payed.StatusId)
                        {
                            VerificationCode += string.Format(@"<div class='swiper-slide swiper-image'>
                                  <input type ='hidden' value='{0}' status='{1}' />
                                   </div>", code.IdentifyingCode, showStatus);
                        }
                        else
                        {
                            VerificationCode += string.Format(@"<div class='swiper-slide swiper-image'>
                                 <img class='img-ercode' src='../restaurant/images/orderRefunded.png' value='{0}' status='{1}'>
                                   </div>", code.IdentifyingCode, showStatus);
                        }

                        break;

                    case 2:
                        showStatus        = 2;
                        VerificationCode += string.Format(@"<div class='swiper-slide swiper-image'>
                                 <img class='img-ercode' src='../restaurant/images/orderUsed.png' value='{0}' status='{1}'>
                                   </div>", code.IdentifyingCode, showStatus);
                        break;

                    case 3:
                    case 4:
                        showStatus = 3;
                        break;
                    }
                }
            }
        }
Example #9
0
        public void List(int ids)
        {
            //订单
            Dingdanlist = "";
            dingdanren  = "";

            var identifyingCodeDetails = IdentifyingCodeService.GetIdentifyingCodeDetailById(cid, "hotel");

            if (identifyingCodeDetails != null && identifyingCodeDetails.Any())
            {
                decimal amount = 0;


                if (identifyingCodeDetails.FirstOrDefault().Status == 2)
                {
                    save_groupbase.Text        = "已验证";
                    save_groupbase.Enabled     = false;
                    save_groupbase.Style.Value = "";
                }
                Dingdanlist += "<tr><th>商品名称</th><th class=\"cc\">购买数量</th><th class=\"cc\">单价</th><th class=\"cc\">入住时间</th><th class=\"cc\">离店时间</th></tr>";
                foreach (var item in identifyingCodeDetails)
                {
                    Dingdanlist += " <tr><td class=\"cc\">" + item.ProductName + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + item.Number + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + item.Price + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + item.ArriveTime + "</td>";
                    Dingdanlist += "<td class=\"cc\">" + item.LeaveTime + "</td></tr>";
                    amount      += Convert.ToDecimal(item.TotelPrice);
                }
                Dingdanlist += "<tr><td></td><td ></td><td ></td><td ></td><td class=\"rr\" style=\"color: red; font-weight:bold;\">支付总计:¥" + amount + "</td></tr>";
            }

            var hotelOrder = new BLL.wx_hotel_dingdan().GetModel(int.Parse(id));

            //订单信息
            if (hotelOrder != null)
            {
                dingdanren += "<tr><td width=\"70\">订单编号: " + hotelOrder.OrderNumber + "</td></tr>";
                dingdanren += "<tr> <td>交易日期:" + hotelOrder.orderTime + "</td></tr>";
                dingdanren += "<tr><td>预定人:" + hotelOrder.oderName + "</td></tr>";
                dingdanren += "<tr><td>电话:" + hotelOrder.tel + "</td></tr>";
            }
            else
            {
                dingdanren += "<tr><td width=\"70\">订单编号:</td></tr>";
                dingdanren += "<tr> <td>交易日期:</td></tr>";
                dingdanren += "<tr><td>预定人:</td></tr>";
                dingdanren += "<tr><td>电话:</td></tr>";
            }
        }
Example #10
0
 public void AfterPaySuccess_ReturnTrue()
 {
     using (var scope = new TransactionScope())
     {
         string no = "H20151025221857350873926";
         new WeiXinPF.BLL.wx_hotel_dingdan().PaySuccess(no);
         var isModifySuccess = IdentifyingCodeService.ModifyIdentifyingCodeInfoStatus(no, 1);
         Assert.IsTrue(isModifySuccess);
         if (isModifySuccess)
         {
             scope.Complete();
         }
     }
 }
Example #11
0
        protected void save_groupbase_Click(object sender, EventArgs e)
        {
            Guid identifyingCodeId;

            if (Guid.TryParse(this.cid, out identifyingCodeId))
            {
                var identifyingCodeObject = IdentifyingCodeService.GetIdentifyingCodeInfoByIdentifyingCodeId(identifyingCodeId, ModuleName, this.wid);

                if (identifyingCodeObject != null)
                {
                    var order = new BLL.wx_hotel_dingdan().GetModel(int.Parse(identifyingCodeObject.OrderId));

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

                            IdentifyingCodeService.ModifyIdentifyingCodeInfo(identifyingCodeObject);

                            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改支付状态,主键为" + id); //记录日志
                                                                                                //JscriptMsg("修改成功!", "dingdan_confirm.aspx?shopid=" + shopid + "", "Success");
                                                                                                //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
                        {
                            this.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>");
                }
            }
        }
Example #12
0
        protected void confirm_dingdan_Click(object sender, EventArgs e)
        {
            var number = this.confirmnumber.Text.Trim();

            var identifyingCode = IdentifyingCodeService.GetConfirmIdentifyingCodeInfo(this.hotelid, number, ModuleName, wid);

            if (identifyingCode != null)
            {
                var order = new BLL.wx_hotel_dingdan().GetModel(int.Parse(identifyingCode.OrderId));

                if (order != null)
                {
                    if (order.orderStatus.Value.Equals(HotelStatusManager.OrderStatus.Refunded.StatusId) ||
                        order.orderStatus.Value.Equals(HotelStatusManager.OrderStatus.Refunding.StatusId) ||
                        order.orderStatus.Value.Equals(HotelStatusManager.OrderStatus.Completed))
                    {
                        this.Response.Write(
                            "<script language='javascript' type='text/javascript'>alert('该订单已完成或进行退单处理,不能进行验证!')</script>");
                    }
                    else
                    {
                        if (identifyingCode.Status != 1)
                        {
                            if (identifyingCode.Status == 0)
                            {
                                this.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.Redirect("commodity_detail.aspx?cid=" + identifyingCode.IdentifyingCodeId + "&shopid=" + identifyingCode.ShopId + "&id=" + identifyingCode.OrderId);
                        }
                    }
                }
                else
                {
                    this.Response.Write("<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");
                }
            }
            else
            {
                this.Response.Write("<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");
            }
        }
Example #13
0
        private bool CreateOrderProcess()
        {
            var hotel     = new BLL.wx_hotels_info().GetModel(Convert.ToInt32(MyCommFun.QueryString("hotelid")));
            var isSuccess = false;

            if (hotel == null)
            {
                return(false);
            }

            using (var scope = new TransactionScope())
            {
                var order = this.CreateOrder();

                if (order != null)
                {
                    for (var i = 0; i < order.orderNum; i++)
                    {
                        var iCode = new IdentifyingCodeInfo()
                        {
                            IdentifyingCodeId = Guid.NewGuid(),
                            CreateTime        = DateTime.Now,
                            IdentifyingCode   = string.Empty,
                            ModifyTime        = DateTime.Now,
                            ModuleName        = "hotel",
                            OrderCode         = order.OrderNumber,
                            OrderId           = order.id.ToString(),
                            ProductCode       = order.roomType,
                            ProductId         = order.roomid.ToString(),
                            ShopId            = order.hotelid.Value.ToString(),
                            Wid    = hotel.wid.Value,
                            Status = 0
                        };
                        IdentifyingCodeService.AddIdentifyingCode(iCode);
                    }

                    SendMsg(order, hotel);

                    scope.Complete();
                    isSuccess = true;
                }
            }

            return(isSuccess);
        }
        public void Handle(GetIdentifyingCodeDetailRequest message)
        {
            var obj = IdentifyingCodeService.GetIdentifyingCodeDetailById(message.IdentifyingCodeId, message.ModuleName);
            List <IdentifyingCodeDetailEntity> response = null;

            response = obj.MapTo <List <IdentifyingCodeDetailEntity> >();

            try
            {
                bus.Reply(new GetIdentifyingCodeDetailResponse()
                {
                    Details = response
                });
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #15
0
        public void Handle(GetIdentifyingCodeByOrderRequest message)
        {
            var order    = new HotelOrderService().GetModel(message.OrderId);
            var response = new GetIdentifyingCodeByOrderResponse();

            if (order != null)
            {
                if (order.orderStatus == HotelStatusManager.OrderStatus.Payed.StatusId ||
                    order.orderStatus == HotelStatusManager.OrderStatus.Refunded.StatusId ||
                    order.orderStatus == HotelStatusManager.OrderStatus.Refunding.StatusId
                    )
                {
                    response.Codes =
                        IdentifyingCodeService
                        .GetIdentifyingCodeByOrder(message.OrderId, "Hotel")
                        .MapTo <List <QrCodeDto> >();
                }
            }

            _bus.Reply(response);
        }
Example #16
0
        public void InsertIdentifyCode_Verification_ReturnTure()
        {
            var icode = new IdentifyingCodeInfo()
            {
                IdentifyingCodeId = Guid.NewGuid(),
                CreateTime        = DateTime.Now,
                IdentifyingCode   = "1256978741253",
                ModifyTime        = DateTime.Now,
                ModuleName        = "HotelTest",
                OrderCode         = "H201510221656123456789",
                OrderId           = "22222",
                ProductCode       = "大床房",
                ProductId         = "大床房",
                Status            = 0,
                ShopId            = "12",
                Wid = 12
            };

            var service = IdentifyingCodeService.AddIdentifyingCode(icode);

            //Assert.IsTrue(result);
        }
Example #17
0
 private void CreateIdentifyingCode(int wid, HotelOrderInfo order)
 {
     for (var i = 0; i < order.orderNum; i++)
     {
         var iCode = new IdentifyingCodeInfo()
         {
             IdentifyingCodeId = Guid.NewGuid(),
             CreateTime        = DateTime.Now,
             IdentifyingCode   = string.Empty,
             ModifyTime        = DateTime.Now,
             ModuleName        = "hotel",
             OrderCode         = order.orderNumber,
             OrderId           = order.id.ToString(),
             ProductCode       = order.roomType,
             ProductId         = order.roomid.ToString(),
             ShopId            = order.hotelid.ToString(),
             Wid    = wid,
             Status = 0
         };
         IdentifyingCodeService.AddIdentifyingCode(iCode);
     }
 }
Example #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var adminInfo = GetAdminInfo();

            if (adminInfo != null)
            {
                isAdmin = adminInfo.role_id == 13;//景区管理员
            }
            dingdanid = MyCommFun.RequestInt("id");
            hotelid   = MyCommFun.RequestInt("hotelid");
            if (Request.Form["__EVENTTARGET"] == "btn_completed")
            {
                // Fire event
                btn_completed_OnClick(this, new EventArgs());
            }
            listCode = IdentifyingCodeService.GetIdentifyingCodeDTO("hotel", dingdanid);
            GetData(dingdanid);

            if (!IsPostBack)
            {
                GetOrderStatusMsg(dingdan);
            }
        }
Example #19
0
        protected void confirm_dingdan_Click(object sender, EventArgs e)
        {
            var number = this.confirmnumber.Text.Trim();

            var identifyingCode = IdentifyingCodeService.GetConfirmIdentifyingCodeInfo(shopid, number, ModuleName, wid);

            if (identifyingCode == null)
            {
                Response.Write("<script language='javascript' type='text/javascript'>alert('该订单不存在或未付款,请确认!')</script>");
            }
            else if (identifyingCode.Status != StatusManager.DishStatus.NoUsed.StatusID &&
                     identifyingCode.Status != StatusManager.DishStatus.RefundFaild.StatusID)
            {
                Response.Write("<script language='javascript' type='text/javascript'>alert('该商品已消费或者退单,请确认!')</script>");
            }
            else
            {
                var order = new BLL.wx_diancai_dingdan_manage().GetModel(int.Parse(identifyingCode.OrderId));

                if (order != null && order.payStatus != null)
                {
                    if (order.payStatus.Value.Equals(StatusManager.DishStatus.PreRefund.StatusID) ||
                        order.payStatus.Value.Equals(StatusManager.DishStatus.Refund.StatusID) ||
                        order.payStatus.Value.Equals(StatusManager.DishStatus.Used.StatusID) ||
                        order.IsFinish)
                    {
                        this.Response.Write(
                            "<script language='javascript' type='text/javascript'>alert('该订单已完成或进行退单处理,不能进行验证!')</script>");
                    }
                    else
                    {
                        Response.Redirect("commodity_detail.aspx?cid=" + identifyingCode.IdentifyingCodeId + "&shopid=" + identifyingCode.ShopId + "&id=" + identifyingCode.OrderId);
                    }
                }
            }
        }
Example #20
0
 public void GetOrderDetailForSearch_IdentifyingCode_ReturnDTO()
 {
     var result = IdentifyingCodeService.GetOrderDetail(8, "restaurant", "");
 }
 public void Handle(MakeUseOfIdentifyingCode message)
 {
     Thread.Sleep(2000);
     bus.Return(IdentifyingCodeService.MakeUseOfIdentifyingCode(message.IdentifyingCodeId)?1:0);
 }
Example #22
0
        /// <summary>
        /// The save order.
        /// </summary>
        /// <returns>
        /// The <see cref="ProcessResult"/>.
        /// </returns>
        private ProcessResult SaveOrder()
        {
            var bll = new BLL.wx_diancai_dingdan_caiping();

            Model.wx_diancai_dingdan_manage order = null;

            try
            {
                using (var scope = new TransactionScope())
                {
                    order = this.CreateOrder();
                    if (order != null)
                    {
                        var goodsInOrder = this.CreateGoodsInOrder(order);

                        if (goodsInOrder == null)
                        {
                            return(new ProcessResult()
                            {
                                IsSuccess = false, Message = "所选择的商品有误"
                            });
                        }

                        foreach (var item in goodsInOrder)
                        {
                            bll.Add(item);

                            for (var i = 0; i < item.num; i++)
                            {
                                var iCode = new IdentifyingCodeInfo()
                                {
                                    IdentifyingCodeId = Guid.NewGuid(),
                                    CreateTime        = DateTime.Now,
                                    IdentifyingCode   = string.Empty,
                                    ModifyTime        = DateTime.Now,
                                    ModuleName        = "restaurant",
                                    OrderCode         = order.orderNumber,
                                    OrderId           = order.id.ToString(),
                                    ProductCode       = item.caiId.ToString(),
                                    ProductId         = item.caiId.ToString(),
                                    ShopId            = order.shopinfoid.ToString(),
                                    Wid    = order.wid,
                                    Status = 0
                                };
                                IdentifyingCodeService.AddIdentifyingCode(iCode);
                            }
                        }
                    }
                    else
                    {
                        return(new ProcessResult()
                        {
                            IsSuccess = false, Message = "所选择的商品有误"
                        });
                    }

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                return(new ProcessResult()
                {
                    IsSuccess = false, Message = "保存订单出错"
                });
            }

            return(new ProcessResult()
            {
                IsSuccess = true, Message = "订单提交成功!请到订单查看!", BusinessData = order
            });
        }