private void LoadCanHo(int tang) { cboCanHo.Items.Clear(); var danhSachCanHoTheoTang = context.layDanhSachCanHoTheoTang(tang); foreach (var canHo in danhSachCanHoTheoTang) { cboCanHo.Items.Add(canHo.ma.ToString().Trim()); } }
private void cboTang_SelectedIndexChanged(object sender, EventArgs e) { int indexChange = cboTang.SelectedIndex; var danhSachCanHoTheoTang = context.layDanhSachCanHoTheoTang(Convert.ToInt16(cboTang.Text.Trim())); cboMaCanHo.Items.Clear(); foreach (var ch in danhSachCanHoTheoTang) { cboMaCanHo.Items.Add(ch.ma.ToString().Trim()); } }