Ejemplo n.º 1
0
        private void cboLoading_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboLoading.SelectedIndex == -1)
            {
                return;
            }

            ncc.Search = cboLoading.Text;
            cboSearch.Items.Clear();
            List <NhaCungCap> ncclist = nccbll.LocDanhSachNhaCungCap(ncc);

            if (cboLoading.Text == "Mã Cung Cấp")
            {
                cboSearch.Text = "";
                foreach (NhaCungCap nccs in ncclist)
                {
                    cboSearch.Items.Add(nccs.MaCC);
                }
            }
            else if (cboLoading.Text == "Tên Cung Cấp")
            {
                cboSearch.Text = "";
                foreach (NhaCungCap nccs in ncclist)
                {
                    cboSearch.Items.Add(nccs.TenCC);
                }
            }
            else if (cboLoading.Text == "Số Điện Thoại")
            {
                cboSearch.Text = "";
                foreach (NhaCungCap nccs in ncclist)
                {
                    cboSearch.Items.Add(nccs.Sdt);
                }
            }
            else
            {
                return;
            }
        }