public void DanhsachDoanhNghiep(GridControl dg, BindingNavigator bn, TextBoxX madoanhnghiep,
                                        TextBoxX ten, ComboBoxEx cmbhuyen, ComboBoxEx cmbxa, TextBoxX diachi, TextBoxX dienthoai, TextBoxX fax, TextBoxX email, TextBoxX trangweb)
        {
            BindingSource bs = new BindingSource();

            bs.DataSource    = data.Show_DoanhNghiep();
            bn.BindingSource = bs;
            dg.DataSource    = bs;

            Huyen_Thi_Ctrl huyen = new Huyen_Thi_Ctrl();

            huyen.ComboBoxHuyen(cmbhuyen);

            Xa_Phuong_CTrl xa = new Xa_Phuong_CTrl();

            xa.ComboBoxXa(cmbxa);

            if (madoanhnghiep.DataBindings.Count > 0)
            {
                madoanhnghiep.DataBindings.Clear();
                ten.DataBindings.Clear();
                cmbhuyen.DataBindings.Clear();
                cmbxa.DataBindings.Clear();
                diachi.DataBindings.Clear();
                dienthoai.DataBindings.Clear();
                fax.DataBindings.Clear();
                email.DataBindings.Clear();
                trangweb.DataBindings.Clear();
            }
            madoanhnghiep.DataBindings.Add("Text", bs, "MaDoanhNghiep");
            ten.DataBindings.Add("Text", bs, "TenDoanhNghiep");
            cmbhuyen.DataBindings.Add("SelectedValue", bs, "MaHuyen");
            cmbxa.DataBindings.Add("SelectedValue", bs, "MaXa");
            diachi.DataBindings.Add("Text", bs, "DiaChi");
            dienthoai.DataBindings.Add("Text", bs, "DienThoai");
            fax.DataBindings.Add("Text", bs, "Fax");
            email.DataBindings.Add("Text", bs, "Email");
            trangweb.DataBindings.Add("Text", bs, "TrangWeb");
        }
Example #2
0
        public void DanhsachDaiLyInternet(GridControl dg, BindingNavigator bn, TextBoxX madaily, TextBoxX tendaily, ComboBoxEx cmbhuyen, ComboBoxEx cmbxa, TextBoxX diachi, TextBoxX sohieu, ComboBoxEx cmbDn)
        {
            BindingSource bs = new BindingSource();

            bs.DataSource    = data.ChiTietDaiLyInternet();
            bn.BindingSource = bs;
            dg.DataSource    = bs;

            Huyen_Thi_Ctrl huyen = new Huyen_Thi_Ctrl();

            huyen.ComboBoxHuyen(cmbhuyen);

            Xa_Phuong_CTrl xa = new Xa_Phuong_CTrl();

            xa.ComboBoxXa(cmbxa);

            QL_DoanhNghiep_Ctrl dn = new QL_DoanhNghiep_Ctrl();

            dn.ComboBoxDN(cmbDn);

            if (madaily.DataBindings.Count > 0)
            {
                madaily.DataBindings.Clear();
                tendaily.DataBindings.Clear();
                cmbhuyen.DataBindings.Clear();
                cmbxa.DataBindings.Clear();
                diachi.DataBindings.Clear();
                sohieu.DataBindings.Clear();
                cmbDn.DataBindings.Clear();
            }
            madaily.DataBindings.Add("Text", bs, "MaDaiLyInt");
            cmbhuyen.DataBindings.Add("SelectedValue", bs, "MaHuyen");
            cmbxa.DataBindings.Add("SelectedValue", bs, "MaXa");
            tendaily.DataBindings.Add("Text", bs, "TenChuDaiLy");
            diachi.DataBindings.Add("Text", bs, "DiaChi");
            sohieu.DataBindings.Add("Text", bs, "SoHieuDaiLy");
            cmbDn.DataBindings.Add("SelectedValue", bs, "MaDoanhNghiep");
        }