Exemple #1
0
        private void lbOK_Click(object sender, EventArgs e)
        {
            tbOrTabName.Text = orTabName;
            string billkey = BillInfoService.GetNotCheckOutBillkeyByTabName(orTabName);
            BillInfoService service = new BillInfoService();
            BillInfo billInfo = service.GetBillInfoByBillkey(billkey);
            string newTabName = cbNewTabName.Text;

            TabInfoService tService = new TabInfoService();
            string tabStatus = TabInfoService.GetTabStatusByTabName(orTabName);
            // 原餐桌号状态改为空闲
            tService.UpdateTabInfoStatus(orTabName, "空闲");
            // 新餐桌号状态改为原餐桌状态
            tService.UpdateTabInfoStatus(newTabName, tabStatus);
            // 账单对应的餐桌号改为新餐桌号
            billInfo.tabName = newTabName;
            service.UpdateBillInfo(billInfo);
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Exemple #2
0
        private void CheckOut(int type)
        {
            BillInfoService bService = new BillInfoService();
            BillInfo billInfo = bService.GetBillInfoByBillkey(billkey);
            billInfo.billMoney = float.Parse(lbBillmoney.Text);
            //billInfo.billtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            billInfo.checktime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            billInfo.checkUsername = App.userName;
            billInfo.discount = cbDiscount.Text;
            billInfo.mark = tbMark.Text.Trim();
            billInfo.paymethod = cbPaymethod.Text;
            if (cbPaymethod.Text.Equals("现金"))
            {
                billInfo.SHcash = float.Parse(tbSHMoney.Text);
            }
            else
            {
                billInfo.SHvesa = float.Parse(tbSHMoney.Text);
            }

            billInfo.SHmoney = float.Parse(tbSHMoney.Text);
            billInfo.status = 1;
            billInfo.tabName = tabName;
            billInfo.zl = float.Parse(tbZL.Text);
            billInfo.preMoney = float.Parse(tbPre.Text);
            float canDisMoney = float.Parse(lbDisMoney.Text);
            float dicValue = float.Parse(cbDiscount.SelectedValue.ToString());
            float disMoney = canDisMoney * (1 - dicValue);
            billInfo.disMoney = disMoney;
            BillInfoService service = new BillInfoService();
            service.UpdateBillInfo(billInfo);

            // 打印账单
            BillDetailInfoService dService = new BillDetailInfoService();
            List<BillDetailInfo> billDetailInfos = dService.GetBillDetailInfoByBillkey(billkey);
            CheckoutPrinter printer = new CheckoutPrinter(billInfo, type, billDetailInfos);
            printer.pdDocument.Print();
            if (type == 1)
            {
                TabInfoService tService = new TabInfoService();
                tService.UpdateTabInfoStatus(tabName, "结账");

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }
Exemple #3
0
        private void lbRunBill_Click(object sender, EventArgs e)
        {
            BillInfoService bService = new BillInfoService();
            BillInfo billInfo = bService.GetBillInfoByBillkey(billkey);
            billInfo.billMoney = float.Parse(lbBillmoney.Text);
            billInfo.status = 2;
            billInfo.checktime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            billInfo.checkUsername = App.userName;
            billInfo.discount = "无";
            billInfo.paymethod = "挂账";
            bService.UpdateBillInfo(billInfo);
            TabInfoService tService = new TabInfoService();
            tService.UpdateTabInfoStatus(tabName, "结账");

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }