Пример #1
0
        private void btnxem_Click(object sender, EventArgs e)
        {
            using (quanlithucungEntities1 quanli = new quanlithucungEntities1())
            {
                DataTable table = new DataTable();
                table.Columns.Add("mahang");
                table.Columns.Add("tenhang");
                table.Columns.Add("slnhap");
                table.Columns.Add("slban");
                table.Columns.Add("tonkho");
                table.Columns.Add("ngaylap");

                List <Tonkho_Result> ds_hoadon = quanli.Tonkho(dtpthang.Value.Month, dtpthang.Value.Year).ToList();
                foreach (var item in ds_hoadon)
                {
                    table.Rows.Add(item.MaHang, item.TenHang, item.SlNhap, item.SLBan, item.TonKho, item.NgayLap);
                }
                bunifuCustomDataGrid1.DataSource = table;
            }
        }