//确定 private void btnOk_Click(object sender, EventArgs e) { int money = 0; int money_a = MConvert <int> .ToTypeOrDefault(m_Seat.deposit, 0); if (!int.TryParse(deposit.Text, out money)) { BathClass.printErrorMsg("押金应输入整数"); return; } if (money + money_a <= Convert.ToDouble(moneyExpense.Text)) { deposit.Focus(); BathClass.printErrorMsg("押金金额必须大于消费金额!"); return; } string cmd_str = @"update [Seat] set deposit=" + (money_a + money).ToString() + ", status=7 where text='" + m_Seat.text + "'"; if (!dao.execute_command(cmd_str)) { BathClass.printErrorMsg("押金离场失败,请重试!"); return; } m_Seat.deposit = money_a + money; //m_Seat.status = 7; PrintDepositReceipt.Print_DataGridView(m_Seat, m_Seat.deposit.ToString(), moneyExpense.Text, db.Options.FirstOrDefault().companyName); //db.SubmitChanges(); this.DialogResult = DialogResult.OK; }
//确定 private void btnOk_Click(object sender, EventArgs e) { int money = 0; if (!int.TryParse(deposit.Text, out money)) { BathClass.printErrorMsg("押金应输入整数"); return; } if (money <= Convert.ToDouble(moneyExpense.Text)) { BathClass.printErrorMsg("押金金额必须大于消费金额!"); return; } m_Seat.note += "\n交离场押金" + money.ToString() + "元"; m_Seat.status = 7; PrintDepositReceipt.Print_DataGridView(m_Seat, deposit.Text, moneyExpense.Text, db.Options.FirstOrDefault().companyName); db.SubmitChanges(); this.DialogResult = DialogResult.OK; }