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"); } }
private void button1_Click(object sender, EventArgs e) { // MessageBox.Show(); //0012582922 dataGridView1.DataSource = BuyBkServices.GetAllBuyBkByTime(this.tex_begin.Text, this.tex_end.Text); }