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");
        }
        private void QL_DichVu_BuuChinh_VT_Load(object sender, EventArgs e)
        {
            CTRL.DanhsachDichVuBuuChinhVT(gridControl1, bindingNavigator1);

            gridView1.OptionsBehavior.Editable = false;

            this.repositoryItemLookUpEdit1.DataSource    = DNdata.Show_DoanhNghiep();
            this.repositoryItemLookUpEdit1.DisplayMember = "TenDoanhNghiep";
            this.repositoryItemLookUpEdit1.ValueMember   = "MaDoanhNghiep";

            //to vang cot ma
            GridColumn unbColumn = gridView1.Columns["MaDichVuBuuChinhVT"];

            // Disable editing.
            unbColumn.OptionsColumn.AllowEdit  = false;
            unbColumn.AppearanceCell.BackColor = Color.LemonChiffon;
        }
Exemplo n.º 3
0
        public void DanhsachVanHoaXa(GridControl dg, BindingNavigator bn, TextBoxX mabuudien, TextBoxX tendiem, ComboBoxEx cmbhuyen, ComboBoxEx cmbxa, TextBoxX diachi, ComboBoxEx cmbDN)
        {
            BindingSource bs = new BindingSource();

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

            Huyen_Thi_Data db = new Huyen_Thi_Data();

            cmbhuyen.DataSource    = db.HienThiDanhSachHuyen();
            cmbhuyen.DisplayMember = "TenHuyen";
            cmbhuyen.ValueMember   = "MaHuyen";

            Xa_Phuong_Data dbxa = new Xa_Phuong_Data();

            cmbxa.DataSource    = dbxa.DanhSach_Xa_Phuong();
            cmbxa.DisplayMember = "TenXa";
            cmbxa.ValueMember   = "MaXa";

            QL_DoanhNghiep_Data dbDN = new QL_DoanhNghiep_Data();

            cmbDN.DataSource    = dbDN.Show_DoanhNghiep();
            cmbDN.DisplayMember = "TenDoanhNghiep";
            cmbDN.ValueMember   = "MaDoanhNghiep";

            if (mabuudien.DataBindings.Count > 0)
            {
                mabuudien.DataBindings.Clear();
                tendiem.DataBindings.Clear();
                cmbhuyen.DataBindings.Clear();
                cmbxa.DataBindings.Clear();
                diachi.DataBindings.Clear();
                cmbDN.DataBindings.Clear();
            }
            mabuudien.DataBindings.Add("Text", bs, "MaDaiLyBuuDienVHX");
            tendiem.DataBindings.Add("Text", bs, "TenDaiLyBuuDienVHX");
            cmbhuyen.DataBindings.Add("SelectedValue", bs, "MaHuyen");
            cmbxa.DataBindings.Add("SelectedValue", bs, "MaXa");
            diachi.DataBindings.Add("Text", bs, "DiaChi");
            cmbDN.DataBindings.Add("SelectedValue", bs, "MaDoanhNghiep");
        }
        private void QL_DaiLyBuuDienVHX_Load(object sender, EventArgs e)
        {
            CTRL.DanhsachVanHoaXa(gridControl1, bindingNavigator1, txtMaBDVHX, txtTenBDVHX, cmbHuyen, cmbXa, txtDiaChi, cmDoanhNghiep);

            gridView1.OptionsBehavior.Editable = false;

            Huyen_Thi_Ctrl ctrl_huyen = new Huyen_Thi_Ctrl();

            ctrl_huyen.ComboBoxHuyen(cmbHuyen);

            Xa_Phuong_CTrl ctrl_xa = new Xa_Phuong_CTrl();

            ctrl_xa.ComboBoxXa(cmbXa);

            QL_DoanhNghiep_Ctrl ctrl_dn = new QL_DoanhNghiep_Ctrl();

            ctrl_dn.ComboBoxDN(cmDoanhNghiep);

            //
            this.repositoryItemLookUpEdit1.DataSource    = hd.HienThiDanhSachHuyen();
            this.repositoryItemLookUpEdit1.DisplayMember = "TenHuyen";
            this.repositoryItemLookUpEdit1.ValueMember   = "MaHuyen";

            //
            this.repositoryItemLookUpEdit2.DataSource    = Dn.Show_DoanhNghiep();
            this.repositoryItemLookUpEdit2.DisplayMember = "TenDoanhNghiep";
            this.repositoryItemLookUpEdit2.ValueMember   = "MaDoanhNghiep";

            //
            this.repositoryItemLookUpEdit3.DataSource    = X.DanhSach_Xa_Phuong();
            this.repositoryItemLookUpEdit3.DisplayMember = "TenXa";
            this.repositoryItemLookUpEdit3.ValueMember   = "MaXa";

            //to vang cot ma
            GridColumn unbColumn = gridView1.Columns["MaDaiLyBuuDienVHX"];

            // Disable editing.
            unbColumn.OptionsColumn.AllowEdit  = false;
            unbColumn.AppearanceCell.BackColor = Color.LemonChiffon;
        }
Exemplo n.º 5
0
        private void QL_CongTrinhVienThong_Load(object sender, EventArgs e)
        {
            CTRL.DanhsachCongTrinhVienThong(gridControl1, bindingNavigator1);

            this.repositoryItemLookUpEdit1.DataSource    = ctrinh.Show_LoaiCongTrinh();
            this.repositoryItemLookUpEdit1.DisplayMember = "TenLoaiCongTrinh";
            this.repositoryItemLookUpEdit1.ValueMember   = "MaLoaiCongTrinh";

            this.repositoryItemLookUpEdit2.DataSource    = dn.Show_DoanhNghiep();
            this.repositoryItemLookUpEdit2.DisplayMember = "TenDoanhNghiep";
            this.repositoryItemLookUpEdit2.ValueMember   = "MaDoanhNghiep";
            //khoa luoi
            gridView1.OptionsBehavior.Editable = false;


            //to vang cot ma
            GridColumn unbColumn = gridView1.Columns["MaCongTrinh"];

            // Disable editing.
            unbColumn.OptionsColumn.AllowEdit  = false;
            unbColumn.AppearanceCell.BackColor = Color.LemonChiffon;
        }