Пример #1
0
        public void CreateSaleOrder(string money)
        {
            var inputAmount = 0m;

            decimal.TryParse(money, out inputAmount);
            _currentShopCat.PayAmount = inputAmount;
            if (_currentShopCat.Items.Count == 0)
            {
                MessageBox.Show("商品明细为空", "系统信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            _saleOrderService.CreateOrder(_currentShopCat);
            this.lblOrderCode.Text = "订单号:" + _currentShopCat.OrderCode;
            this.txtBarCode.Text   = "";

            // 显示支付窗体
            if (_currentShopCat.CheckCanPay())
            {
                frmPay payForm = frmPay.CreateForm();
                payForm.CurrentOrder = _currentShopCat;
                payForm.PosForm      = this;
                payForm.ShowDialog(this);
            }
            else
            {
                MessageBox.Show("有商品项数量为0,不能支付!请调整数量或ESC作废订单。", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }