private void b_buy_Click(object sender, EventArgs e) { if (Convert.ToInt32(b_nu) < Convert.ToInt32(buy_book_num)) //库存量不够,无法购买 { MessageBox.Show("当前库存不足"); } else { if (Convert.ToDouble(price) < Convert.ToDouble(un) * Convert.ToInt32(b_nu))//获取余额,金额不足充值 { MessageBox.Show("您的余额不足,无法购买,请先充值"); } else { MessageBox.Show("购买成功");//提示购买成功,(做三件事)在My_account里显示购买记录,在Login_in里修改库存,在My_account里修改我的余额 My_accont f = new My_accont(); f.history_of_buy = t_1.Text; Login_in f1 = new Login_in(); } } }
private void tool_7_Click(object sender, EventArgs e) { My_accont f7 = new My_accont(); f7.ShowDialog(); }