Пример #1
0
        public void ThongKe()
        {
            dvwTotal.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            StatisDAL stDAL = new StatisDAL();

            dvwTotal.DataSource = stDAL.LoadDS(DtFrom.Value, DtTo.Value);
            int total = 0;

            foreach (DataRow row in dvwTotal.Rows)
            {
                total += Convert.ToInt32(row.ItemArray[4].ToString());
            }
            txtTotal.Text = total.ToString();
        }
Пример #2
0
        private void btThongKe_Click(object sender, EventArgs e)
        {
            dvwTotal.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            StatisDAL stDAL = new StatisDAL();

            dvwTotal.DataSource = stDAL.LoadDS(dtFrom.Value, dtTo.Value);
            int total = 0;

            foreach (DataRow row in dvwTotal.Rows)
            {
                total += Convert.ToInt32(row.ItemArray[4].ToString());
            }
            lblTotal.Text = total.ToString();
        }