private void QLXe_Load(object sender, EventArgs e) { dt = new DataSet(); dt = dbXe.LayDongXe(); List <string> t = new List <string>(); for (int i = 0; i < dt.Tables[0].Rows.Count; i++) { t.Add(dt.Tables[0].Rows[i]["TenDongXe"].ToString()); } cboDongXe.Items.AddRange(t.ToArray()); // thêm vào dòng lựa chọn dòng xe LoadData(); }
private void MuaXe_Load(object sender, EventArgs e) { dbXe = new BLXe(); dbHoaDon = new BLHoaDon(); lbMaNV.Text = SHAREVAR.MaNV_TK; lbTenNV.Text = SHAREVAR.TenNV_TK; dt = new DataSet(); dt = dbXe.LayDongXe(); List <string> t = new List <string>(); for (int i = 0; i < dt.Tables[0].Rows.Count; i++) { t.Add(dt.Tables[0].Rows[i]["TenDongXe"].ToString()); } LoadData(); }