private void button1_Click(object sender, EventArgs e) { // MessageBox.Show(); //0012582922 if (this.tex_begin.Text.Length > 0 && this.tex_end.Text.Length > 0) { List <BuyBk> list = BuyBkServices.GetAllBuyBkByTime(this.tex_begin.Text, this.tex_end.Text + " 23:59"); dataGridView1.DataSource = list; float sun = 0f; float disp = 0f; float user = 0f; for (int i = 0; i < list.Count; i++) { sun += float.Parse(list[i].Buyprice); if (list[i].BuyFrom == "system") { disp += float.Parse(list[i].Buyprice); } else { user += float.Parse(list[i].Buyprice); } } this.lab_dis.Text = disp.ToString("0.00"); this.lab_sun.Text = sun.ToString("0.00"); this.lab_user.Text = user.ToString("0.00"); } }
// public List<BuyBk> blist; public Form_dispPk() { InitializeComponent(); CenterToParent(); List <BuyBk> list = BuyBkServices.GetAllBuyBk(); dataGridView1.DataSource = list; // blist = list; float sun = 0f; float disp = 0f; float user = 0f; for (int i = 0; i < list.Count; i++) { sun += float.Parse(list[i].Buyprice); if (list[i].BuyFrom == "system") { disp += float.Parse(list[i].Buyprice); } else { user += float.Parse(list[i].Buyprice); } } this.lab_dis.Text = disp.ToString("0.00"); this.lab_sun.Text = sun.ToString("0.00"); this.lab_user.Text = user.ToString("0.00"); }
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 textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) { ScoInfo1 sco = ScoServices.GetScorByUser(this.tex_Card.Text); float f = BuyBkServices.GetAllBuyBkByUser(this.tex_Card.Text); if (f <= 0) { MessageBox.Show("此会员没有消费过!!"); } else { this.tex_His.Text = sco.ScoHis; this.tex_Sco.Text = sco.Sco; f = f / 100 * 3; f = f - float.Parse(this.tex_His.Text); this.tex_scort.Text = f.ToString(); } } }
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 { } }
private void button1_Click(object sender, EventArgs e) { // MessageBox.Show(); //0012582922 dataGridView1.DataSource = BuyBkServices.GetAllBuyBkByTime(this.tex_begin.Text, this.tex_end.Text); }
public Form_dispbk() { InitializeComponent(); this.dataGridView1.DataSource = BuyBkServices.GetAllBuyBk(); CenterToParent(); }