예제 #1
0
        private void btnThongKe_Click(object sender, EventArgs e)
        {
            dgvDoanhThuBanVe.DataSource = tkbus.DoanhThuBanVe(dateNgayBan1.Value.Date.ToString(), dateNgayBan2.Value.Date.ToString());

            int index     = dgvDoanhThuBanVe.Rows.Count;
            int thanhtien = 0;

            for (int i = 0; i < index - 1; i++)
            {
                thanhtien += int.Parse(dgvDoanhThuBanVe.Rows[i].Cells["TongTien"].Value.ToString());
            }
            lblTongTien.Text = thanhtien.ToString();
        }