private void button2_Click(object sender, EventArgs e) { if (user.Price < price) { MessageBox.Show("余额不足!!"); this.Close(); } else { float dp = user.Price - price; dp = float.Parse(dp.ToString("0.00")); int ret = UserServices.Pay_pro(dp, this.textBox1.Text); if (ret > 0) { for (int i = 0; i < blist.Count; i++) { blist[i].BuyFrom = this.textBox1.Text; BuyBkServices.AddByBk(blist[i]); } MessageBox.Show("支付成功,你的余额是" + dp.ToString("0.00") + "元"); this.Close(); fc.textBox1.Select(); fc.formclea(); } else { MessageBox.Show("支付失败!"); this.Close(); } } }
private void button1_Click(object sender, EventArgs e) { if (float.Parse(this.tex_out.Text) >= 0) { for (int i = 0; i < blist.Count; i++) { BuyBkServices.AddByBk(blist[i]); } MessageBox.Show("支付成功!"); try { if (this.checkBox1.Checked) { this.printDocument1.Print(); } } catch { MessageBox.Show("打印机出现异常!!"); } this.Close(); fd.formclea(); } else { MessageBox.Show("金额不足!"); this.tex_out.Text = ""; this.tex_in.Text = ""; this.tex_in.Select(); } try { //this.printDocument1.document // printDocument1.Print(); } catch { } }