public void CreateOrderPayoff(OrderPayoff orderPayoff)
 {
     try
     {
         _daoManager.OpenConnection();
         _orderPayoffDao.CreateOrderPayoff(orderPayoff);
     }
     catch (Exception exception)
     {
         LogHelper.GetInstance().Error(string.Format("[CreateOrderPayoff]参数:orderPayoff_{0}", JsonConvert.SerializeObject(orderPayoff)), exception);
     }
     finally
     {
         _daoManager.CloseConnection();
     }
 }
Example #2
0
 private void CalculateAllPrice()
 {
     if (dic.ContainsKey(curPayoffWay.PayoffID.ToString()))
     {
         OrderPayoff orderPayoff = dic[curPayoffWay.PayoffID.ToString()];
         orderPayoff.Quantity = Convert.ToDecimal(m_InputNumber);
     }
     else
     {
         OrderPayoff orderPayoff = new OrderPayoff();
         orderPayoff.OrderPayoffID = Guid.NewGuid();
         orderPayoff.OrderID = m_SalesOrder.order.OrderID;
         orderPayoff.PayoffID = curPayoffWay.PayoffID;
         orderPayoff.PayoffName = curPayoffWay.PayoffName;
         orderPayoff.PayoffType = curPayoffWay.PayoffType;
         orderPayoff.AsPay = curPayoffWay.AsPay;
         orderPayoff.Quantity = Convert.ToDecimal(m_InputNumber);
         orderPayoff.CardNo = "";
         orderPayoff.EmployeeID = ConstantValuePool.CurrentEmployee.EmployeeID;
         dic.Add(curPayoffWay.PayoffID.ToString(), orderPayoff);
     }
     decimal totalPrice = Convert.ToDecimal(m_InputNumber) * curPayoffWay.AsPay;
     if (curPayoffWay.PayoffType == (int)PayoffWayMode.GiftVoucher || curPayoffWay.PayoffType == (int)PayoffWayMode.Coupon)
     {
         this.txtAmount.Text = string.Format("{0} 张(合 {1} 元)", m_InputNumber, totalPrice.ToString("f2"));
     }
     else
     {
         this.txtAmount.Text = string.Format("{0} 元", totalPrice.ToString("f2"));
     }
     DisplayPayoffWay();
 }
Example #3
0
 private void btnPayoff_Click(object sender, EventArgs e)
 {
     foreach (CrystalButton button in payoffButtonList)
     {
         PayoffWay payoffWay = button.Tag as PayoffWay;
         if (payoffWay !=null)
         {
             button.BackColor = dic.ContainsKey(payoffWay.PayoffID.ToString()) ? ConstantValuePool.PressedColor : button.DisplayColor;
         }
     }
     CrystalButton btn = sender as CrystalButton;
     if (btn == null) return;
     curPayoffWay = btn.Tag as PayoffWay;
     if (curPayoffWay == null) return;
     btn.BackColor = ConstantValuePool.PressedColor;
     
     if (curPayoffWay.PayoffType == (int) PayoffWayMode.MembershipCard)
     {
         //屏蔽数字键盘
         this.pnlNumericPad.Enabled = false;
     }
     else
     {
         this.pnlNumericPad.Enabled = true;
     }
     this.txtPayoff.Text = string.Format("{0}(1:{1})", curPayoffWay.PayoffName, curPayoffWay.AsPay.ToString("f2"));
     if (dic.ContainsKey(curPayoffWay.PayoffID.ToString()))
     {
         OrderPayoff orderPayoff = dic[curPayoffWay.PayoffID.ToString()];
         decimal totalPrice = orderPayoff.Quantity * orderPayoff.AsPay;
         if (curPayoffWay.PayoffType == (int)PayoffWayMode.GiftVoucher || curPayoffWay.PayoffType == (int)PayoffWayMode.Coupon)
         {
             this.txtAmount.Text = string.Format("{0} 张(合 {1} 元)", orderPayoff.Quantity, totalPrice.ToString("f2"));
         }
         else
         {
             this.txtAmount.Text = string.Format("{0} 元", totalPrice.ToString("f2"));
         }
     }
     else
     {
         if (curPayoffWay.PayoffType == (int)PayoffWayMode.GiftVoucher || curPayoffWay.PayoffType == (int)PayoffWayMode.Coupon)
         {
             this.txtAmount.Text = string.Format("{0} 张(合 {1} 元)", "0", "0.00");
         }
         else
         {
             this.txtAmount.Text = string.Format("{0} 元", "0.00");
         }
         if (curPayoffWay.PayoffType == (int)PayoffWayMode.MembershipCard)
         {
             decimal unPaidPrice = decimal.Parse(lbUnpaidAmount.Text.Substring(5));
             if (unPaidPrice > 0)
             {
                 Membership.FormVIPCardPayment formCardPayment = new Membership.FormVIPCardPayment(unPaidPrice);
                 formCardPayment.ShowDialog();
                 if (formCardPayment.CardPaidAmount > 0)
                 {
                     OrderPayoff orderPayoff = new OrderPayoff();
                     orderPayoff.OrderPayoffID = Guid.NewGuid();
                     orderPayoff.OrderID = m_SalesOrder.order.OrderID;
                     orderPayoff.PayoffID = curPayoffWay.PayoffID;
                     orderPayoff.PayoffName = curPayoffWay.PayoffName;
                     orderPayoff.PayoffType = curPayoffWay.PayoffType;
                     orderPayoff.AsPay = curPayoffWay.AsPay;
                     orderPayoff.Quantity = formCardPayment.CardPaidAmount / curPayoffWay.AsPay;
                     if (!string.IsNullOrEmpty(formCardPayment.CardNo))
                     {
                         orderPayoff.CardNo = formCardPayment.CardNo + "#" + formCardPayment.CardPassword;
                     }
                     orderPayoff.EmployeeID = ConstantValuePool.CurrentEmployee.EmployeeID;
                     dic.Add(curPayoffWay.PayoffID.ToString(), orderPayoff);
                 }
                 this.txtAmount.Text = string.Format("{0} 元", formCardPayment.CardPaidAmount.ToString("f2"));
                 DisplayPayoffWay();
             }
         }
     }
     m_InputNumber = "0";
 }
Example #4
0
 private void btnCheckOut_Click(object sender, EventArgs e)
 {
     decimal refundAmount = decimal.Parse(txtRefundAmount.Text);
     decimal realReturnAmount = 0;
     if (!string.IsNullOrEmpty(txtRealReturnAmount.Text))
     {
         realReturnAmount = decimal.Parse(txtRealReturnAmount.Text);
     }
     if (refundAmount == realReturnAmount)
     {
         //判断支付方式是否正确
         bool IsPayoffWayRight = true;
         IList<OrderPayoff> _orderPayoffList = new List<OrderPayoff>();
         foreach (KeyValuePair<string, OrderPayoff> item in dic)
         {
             if (item.Value.Quantity > 0)
             {
                 _orderPayoffList.Add(item.Value);
             }
         }
         foreach (OrderPayoff orderPayoff in _orderPayoffList)
         {
             bool IsContains = false;
             OrderPayoff temp = null;
             foreach (OrderPayoff item in m_SalesOrder.orderPayoffList)
             {
                 if (item.PayoffID.Equals(orderPayoff.PayoffID))
                 {
                     IsContains = true;
                     temp = item;
                     break;
                 }
             }
             if (IsContains)
             {
                 decimal tempAmount = temp.AsPay * temp.Quantity - temp.NeedChangePay;
                 decimal payAmount = orderPayoff.AsPay * orderPayoff.Quantity - orderPayoff.NeedChangePay;
                 if (tempAmount < payAmount)
                 {
                     IsPayoffWayRight = false;
                     break;
                 }
             }
             else
             {
                 IsPayoffWayRight = false;
                 break;
             }
         }
         if (IsPayoffWayRight)
         {
             IList<OrderPayoff> orderPayoffList = new List<OrderPayoff>();
             foreach (OrderPayoff item in m_SalesOrder.orderPayoffList)
             {
                 bool IsContains = false;
                 foreach (OrderPayoff orderPayoff in _orderPayoffList)
                 {
                     if (item.PayoffID.Equals(orderPayoff.PayoffID))
                     {
                         decimal remainQty = ((item.AsPay * item.Quantity - item.NeedChangePay) - (orderPayoff.AsPay * orderPayoff.Quantity - orderPayoff.NeedChangePay)) / orderPayoff.AsPay;
                         if (remainQty > 0)
                         {
                             OrderPayoff temp = new OrderPayoff();
                             temp.OrderPayoffID = Guid.NewGuid();
                             temp.OrderID = m_SalesOrder.order.OrderID;
                             temp.PayoffID = item.PayoffID;
                             temp.PayoffName = item.PayoffName;
                             temp.PayoffType = item.PayoffType;
                             temp.AsPay = item.AsPay;
                             temp.Quantity = remainQty;
                             temp.NeedChangePay = 0;
                             temp.CardNo = item.CardNo;
                             temp.EmployeeID = ConstantValuePool.CurrentEmployee.EmployeeID;
                             orderPayoffList.Add(temp);
                         }
                         IsContains = true;
                         break;
                     }
                 }
                 if (!IsContains)
                 {
                     OrderPayoff temp = CopyExtension.Clone<OrderPayoff>(item);
                     temp.OrderID = m_SalesOrder.order.OrderID;
                     temp.OrderPayoffID = Guid.NewGuid();
                     temp.EmployeeID = ConstantValuePool.CurrentEmployee.EmployeeID;
                     orderPayoffList.Add(temp);
                 }
             }
             List<DeletedOrderDetails> deletedOrderDetailsList = new List<DeletedOrderDetails>();
             for (int i = 0; i < dgvGoodsOrder.RowCount; i++)
             {
                 OrderDetails tempOrderDetails = dgvGoodsOrder.Rows[i].Cells["OrderDetailsID"].Tag as OrderDetails;
                 decimal tempGoodsNum = Convert.ToDecimal(dgvGoodsOrder.Rows[i].Cells["GoodsNum"].Value);
                 decimal tempGoodsDiscount = Convert.ToDecimal(dgvGoodsOrder.Rows[i].Cells["GoodsDiscount"].Value);
                 decimal tempDeletedNum = Convert.ToDecimal(dgvGoodsOrder.Rows[i].Cells["DelFlag"].Value);
                 if (Math.Abs(tempDeletedNum) > 0)
                 {
                     decimal remainQty = tempGoodsNum - Math.Abs(tempDeletedNum);
                     DeletedOrderDetails orderDetails = new DeletedOrderDetails();
                     orderDetails.OrderDetailsID = tempOrderDetails.OrderDetailsID;
                     orderDetails.DeletedQuantity = tempDeletedNum;
                     orderDetails.RemainQuantity = remainQty;
                     orderDetails.OffPay = Math.Round(-tempGoodsDiscount / tempGoodsNum * remainQty, 4);
                     orderDetails.AuthorisedManager = ConstantValuePool.CurrentEmployee.EmployeeID;
                     orderDetails.CancelEmployeeNo = ConstantValuePool.CurrentEmployee.EmployeeNo;
                     orderDetails.CancelReasonName = dgvGoodsOrder.Rows[i].Cells["DelReasonName"].Value.ToString(); ;
                     deletedOrderDetailsList.Add(orderDetails);
                 }
             }
             //构造DeletedPaidOrder对象
             decimal paymentMoney = 0;
             foreach (OrderPayoff item in orderPayoffList)
             {
                 paymentMoney += item.AsPay * item.Quantity;
             }
             Order order = new Order();
             order.OrderID = m_SalesOrder.order.OrderID;
             order.TotalSellPrice = m_TotalPrice;
             order.ActualSellPrice = m_ActualPayMoney;
             order.DiscountPrice = m_Discount;
             order.CutOffPrice = m_CutOff;
             order.ServiceFee = m_ServiceFee;
             order.PaymentMoney = paymentMoney;
             order.NeedChangePay = 0;
             order.EmployeeID = ConstantValuePool.CurrentEmployee.EmployeeID;
             DeletedPaidOrder deletedPaidOrder = new DeletedPaidOrder();
             deletedPaidOrder.order = order;
             deletedPaidOrder.deletedOrderDetailsList = deletedOrderDetailsList;
             deletedPaidOrder.orderPayoffList = orderPayoffList;
             if (DeletedOrderService.GetInstance().DeletePaidSingleOrder(deletedPaidOrder))
             {
                 m_IsChanged = true;
                 this.Close();
             }
             else
             {
                 MessageBox.Show("单品删除失败,请重新操作!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;
             }
         }
         else
         {
             MessageBox.Show("退款支付方式不属于原结账支付方式,请重新支付!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
     }
     else
     {
         MessageBox.Show("应退金额与实退金额不一致,请重新支付!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Example #5
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            decimal needChangePay = 0;  //找零
            decimal receMoney = decimal.Parse(lbReceMoney.Text);    //应收
            decimal paidInMoney = decimal.Parse(lbPaidInMoney.Text);    //实收
            if (paidInMoney == 0)
            {
                //判断是否直接支付
                if (DialogResult.No == MessageBox.Show("警告,当前未选择任何支付方式,是否以现金继续结账?", "信息提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) return;
            }
            if (receMoney + m_ServiceFee < paidInMoney)
            {
                decimal cash = 0, noCash = 0;
                List<OrderPayoff> noCashPayoff = new List<OrderPayoff>();
                foreach (KeyValuePair<string, OrderPayoff> item in dic)
                {
                    if (item.Value.PayoffType == (int)PayoffWayMode.Cash)
                    {
                        cash += item.Value.AsPay * item.Value.Quantity;
                    }
                    else
                    {
                        noCash += item.Value.AsPay * item.Value.Quantity;
                        noCashPayoff.Add(item.Value);
                    }
                }
                if (noCash > receMoney + m_ServiceFee)
                {
                    //非现金支付方式按单位价值从高到低排序
                    OrderPayoff[] noCashPayoffArr = noCashPayoff.ToArray();
                    for (int j = 0; j < noCashPayoffArr.Length; j++)
                    {
                        for (int i = noCashPayoffArr.Length - 1; i > j; i--)
                        {
                            if (noCashPayoffArr[j].AsPay < noCashPayoffArr[i].AsPay)
                            {
                                OrderPayoff temp = noCashPayoffArr[j];
                                noCashPayoffArr[j] = noCashPayoffArr[i];
                                noCashPayoffArr[i] = temp;
                            }
                        }
                    }
                    if (noCash - noCashPayoffArr[noCashPayoffArr.Length - 1].AsPay < receMoney + m_ServiceFee)
                    {
                        if (cash > 0)
                        {
                            MessageBox.Show("现金支付方式多余!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                    }
                    else
                    {
                        MessageBox.Show("非现金支付方式金额过多,请重新支付!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                else
                {
                    //由全部非现金及部分现金来支付
                    needChangePay = paidInMoney - (receMoney + m_ServiceFee);
                    foreach (KeyValuePair<string, OrderPayoff> item in dic)
                    {
                        if (item.Value.PayoffType == (int)PayoffWayMode.Cash)
                        {
                            item.Value.NeedChangePay = needChangePay;
                            break;
                        }
                    }
                }
            }
            if (receMoney + m_ServiceFee > paidInMoney)
            {
                // 支付的金额不足, 现金补足
                foreach (PayoffWay temp in ConstantValuePool.PayoffWayList)
                {
                    if (temp.PayoffType == (int)PayoffWayMode.Cash)
                    {
                        if (dic.ContainsKey(temp.PayoffID.ToString()))
                        {
                            OrderPayoff orderPayoff = dic[temp.PayoffID.ToString()];
                            orderPayoff.Quantity += (receMoney + m_ServiceFee - paidInMoney) / temp.AsPay;
                        }
                        else
                        {
                            OrderPayoff orderPayoff = new OrderPayoff();
                            orderPayoff.OrderPayoffID = Guid.NewGuid();
                            orderPayoff.OrderID = m_SalesOrder.order.OrderID;
                            orderPayoff.PayoffID = temp.PayoffID;
                            orderPayoff.PayoffName = temp.PayoffName;
                            orderPayoff.PayoffType = temp.PayoffType;
                            orderPayoff.AsPay = temp.AsPay;
                            orderPayoff.Quantity = (receMoney + m_ServiceFee - paidInMoney) / temp.AsPay;
                            orderPayoff.CardNo = "";
                            orderPayoff.EmployeeID = ConstantValuePool.CurrentEmployee.EmployeeID;
                            dic.Add(temp.PayoffID.ToString(), orderPayoff);
                        }
                        break;
                    }
                }
            }
            //计算支付的金额并填充OrderPayoff
            bool isContainsCash = false;
            bool isContainsVipCard = false;
            decimal paymentMoney = 0;
            List<OrderPayoff> orderPayoffList = new List<OrderPayoff>();
            foreach (KeyValuePair<string, OrderPayoff> item in dic)
            {
                if (item.Value.Quantity > 0)
                {
                    if (item.Value.PayoffType == (int)PayoffWayMode.Cash)
                    {
                        isContainsCash = true;
                    }
                    if (item.Value.PayoffType == (int)PayoffWayMode.MembershipCard)
                    {
                        isContainsVipCard = true;
                    }
                    OrderPayoff orderPayoff = item.Value;
                    paymentMoney += orderPayoff.AsPay * orderPayoff.Quantity;
                    orderPayoffList.Add(orderPayoff);
                }
            }
            if (isContainsCash)
            {
                //支付方式中包含现金,需要打开钱箱
                OpenCashBox();
            }
            bool paySuccess = false;
            if (isContainsVipCard)
            {
                Dictionary<string, VIPCardPayment> dicCardPayment;
                Dictionary<string, string> dicCardTradePayNo;
                if (IsVipCardPaySuccess(out dicCardPayment, out dicCardTradePayNo))
                {
                    //组合交易流水号,因为需要支持多张会员卡
                    string strTradePayNo = string.Empty;
                    foreach (KeyValuePair<string, string> item in dicCardTradePayNo)
                    {
                        strTradePayNo += "," + item.Value;
                    }
                    strTradePayNo = strTradePayNo.Substring(1);
                    //将支付方式中的卡号密码去掉
                    foreach (var orderPayoff in orderPayoffList)
                    {
                        if (orderPayoff.PayoffType == (int)PayoffWayMode.MembershipCard)
                        {
                            if (!string.IsNullOrEmpty(orderPayoff.CardNo))
                            {
                                orderPayoff.CardNo = orderPayoff.CardNo.Split('#')[0];
                            }
                        }
                    }
                    // 支付服务尝试三次
                    int times = 0;
                    while (times < 3 && !paySuccess)
                    {
                        paySuccess = PayForOrder(orderPayoffList, paymentMoney, needChangePay, strTradePayNo);
                        times++;
                        Thread.Sleep(500);
                    }
                    if (!paySuccess)
                    { 
                        //取消会员卡支付
                        foreach (KeyValuePair<string, VIPCardPayment> item in dicCardPayment)
                        {
                            string cardNo = item.Value.CardNo;
                            //将支付成功的会员卡取消支付
                            int returnValue = VIPCardTradeService.GetInstance().RefundVipCardPayment(cardNo, item.Value.CardPassword, dicCardTradePayNo[cardNo]);
                            if (returnValue == 1) continue;
                            if (returnValue == 2)
                            {
                                MessageBox.Show(string.Format("交易流水号'{0}'不存在或者已作废", dicCardTradePayNo[cardNo]), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                            else if (returnValue == 99)
                            {
                                MessageBox.Show(string.Format("'{0}'的会员卡号或者密码错误!", cardNo), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                            else
                            {
                                MessageBox.Show("服务器出现错误,请重新操作!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                            //保存到本地Sqlite
                            CardRefundPay cardRefundPay = new CardRefundPay
                            {
                                CardNo = cardNo, 
                                ShopID = ConstantValuePool.CurrentShop.ShopID.ToString(), 
                                TradePayNo = dicCardTradePayNo[cardNo], 
                                PayAmount = item.Value.PayAmount, 
                                EmployeeNo = item.Value.EmployeeNo, 
                                DeviceNo = item.Value.DeviceNo
                            };
                            CardRefundPayService refundPayService = new CardRefundPayService();
                            refundPayService.AddRefundPayInfo(cardRefundPay);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("会员卡支付操作失败,请稍后再试!");
                    return;
                }
            }
            else
            {
                paySuccess = PayForOrder(orderPayoffList, paymentMoney, needChangePay, string.Empty);
            }
            if (paySuccess)
            {
                //打印小票
                PrintData printData = new PrintData();
                printData.ShopName = ConstantValuePool.CurrentShop.ShopName;
                printData.DeskName = m_CurrentDeskName;
                printData.PersonNum = m_SalesOrder.order.PeopleNum.ToString();
                printData.PrintTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                printData.EmployeeNo = ConstantValuePool.CurrentEmployee.EmployeeNo;
                printData.TranSequence = m_SalesOrder.order.TranSequence.ToString();
                printData.ShopAddress = ConstantValuePool.CurrentShop.RunAddress;
                printData.Telephone = ConstantValuePool.CurrentShop.Telephone;
                printData.ReceivableMoney = this.lbReceMoney.Text;
                printData.ServiceFee = m_ServiceFee.ToString("f2");
                printData.PaidInMoney = paymentMoney.ToString("f2");
                printData.NeedChangePay = needChangePay.ToString("f2");
                printData.GoodsOrderList = new List<GoodsOrder>();
                printData.PayingOrderList = new List<PayingGoodsOrder>();
                foreach (OrderDetails item in m_SalesOrder.orderDetailsList)
                {
                    string strLevelFlag = string.Empty;
                    int levelCount = item.ItemLevel * 2;
                    for (int i = 0; i < levelCount; i++)
                    {
                        strLevelFlag += "-";
                    }
                    GoodsOrder goodsOrder = new GoodsOrder();
                    goodsOrder.GoodsName = strLevelFlag + item.GoodsName;
                    goodsOrder.GoodsNum = item.ItemQty.ToString("f1");
                    goodsOrder.SellPrice = item.SellPrice.ToString("f2");
                    goodsOrder.TotalSellPrice = item.TotalSellPrice.ToString("f2");
                    goodsOrder.TotalDiscount = item.TotalDiscount.ToString("f2");
                    goodsOrder.Unit = item.Unit;
                    printData.GoodsOrderList.Add(goodsOrder);
                }
                foreach (OrderPayoff orderPayoff in orderPayoffList)
                {
                    PayingGoodsOrder payingOrder = new PayingGoodsOrder();
                    payingOrder.PayoffName = orderPayoff.PayoffName;
                    payingOrder.PayoffMoney = (orderPayoff.AsPay * orderPayoff.Quantity).ToString("f2");
                    payingOrder.NeedChangePay = orderPayoff.NeedChangePay.ToString("f2");
                    printData.PayingOrderList.Add(payingOrder);
                }
                string paperWidth = ConstantValuePool.BizSettingConfig.printConfig.PaperWidth;
                if (ConstantValuePool.BizSettingConfig.printConfig.PrinterPort == PortType.DRIVER)
                {
                    string printerName = ConstantValuePool.BizSettingConfig.printConfig.Name;
                    string paperName = ConstantValuePool.BizSettingConfig.printConfig.PaperName;
                    DriverOrderPrint printer = DriverOrderPrint.GetInstance(printerName, paperName, paperWidth);
                    printer.DoPrintPaidOrder(printData);
                }
                if (ConstantValuePool.BizSettingConfig.printConfig.PrinterPort == PortType.COM)
                {
                    string port = ConstantValuePool.BizSettingConfig.printConfig.Name;
                    if (port.Length > 3)
                    {
                        if (port.Substring(0, 3).ToUpper() == "COM")
                        {
                            string portName = port.Substring(0, 4).ToUpper();
                            InstructionOrderPrint printer = new InstructionOrderPrint(portName, 9600, Parity.None, 8, StopBits.One, paperWidth);
                            printer.DoPrintPaidOrder(printData);
                        }
                    }
                }
                if (ConstantValuePool.BizSettingConfig.printConfig.PrinterPort == PortType.ETHERNET)
                {
                    string ipAddress = ConstantValuePool.BizSettingConfig.printConfig.Name;
                    InstructionOrderPrint printer = new InstructionOrderPrint(ipAddress, 9100, paperWidth);
                    printer.DoPrintPaidOrder(printData);
                }
                if (ConstantValuePool.BizSettingConfig.printConfig.PrinterPort == PortType.USB)
                {
                    string vid = ConstantValuePool.BizSettingConfig.printConfig.VID;
                    string pid = ConstantValuePool.BizSettingConfig.printConfig.PID;
                    string endpointId = ConstantValuePool.BizSettingConfig.printConfig.EndpointID;
                    InstructionOrderPrint printer = new InstructionOrderPrint(vid, pid, endpointId, paperWidth);
                    printer.DoPrintPaidOrder(printData);
                }

                m_IsPaidOrder = true;
                //更新桌况为空闲状态
                int status = (int)DeskButtonStatus.IDLE_MODE;
                if (!DeskService.GetInstance().UpdateDeskStatus(m_CurrentDeskName, string.Empty, status))
                {
                    DeskService.GetInstance().UpdateDeskStatus(m_CurrentDeskName, string.Empty, status);
                }
                //更新第二屏信息
                if (Screen.AllScreens.Length > 1 && ConstantValuePool.BizSettingConfig.SecondScreenEnabled)
                {
                    if (ConstantValuePool.SecondScreenForm != null && ConstantValuePool.SecondScreenForm is FormSecondScreen)
                    {
                        ((FormSecondScreen)ConstantValuePool.SecondScreenForm).DisplayOrderInfoSum(receMoney + m_ServiceFee, needChangePay, orderPayoffList);
                    }
                }
                FormConfirm form = new FormConfirm(receMoney + m_ServiceFee, needChangePay, orderPayoffList);
                form.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("账单支付失败!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public void CreateOrderPayoff(OrderPayoff orderPayoff)
 {
     ExecuteInsert("InsertOrderPayoff", orderPayoff);
 }