Exemple #1
0
        public Sectores()
        {
            InitializeComponent();

            sta = new CADINDataSetTableAdapters.SectoresTableAdapter();
            sdt = new CADINDataSet.SectoresDataTable();
            bds = new BindingSource();
            sdt = sta.GetData();
            bds.DataSource = sdt;

                dataGridViewX1.DataSource = bds;
                textBoxX1.DataBindings.Add("Text", bds, "nombre");
                textBoxX2.DataBindings.Add("Text", bds, "descripcion");
        }
Exemple #2
0
        private void EnlazarControlesBasicos()
        {
            emprAgrupTableA = new CADINDataSetTableAdapters.Empresa_AgrupacionTableAdapter();
            ta2 = new CADINDataSetTableAdapters.DepartamentosTableAdapter();
            ta3 = new CADINDataSetTableAdapters.SectoresTableAdapter();
            ta4 = new CADINDataSetTableAdapters.Tipo_MembresiaTableAdapter();
            ta5 = new CADINDataSetTableAdapters.Tipo_TarifaTableAdapter();
            ta6 = new CADINDataSetTableAdapters.Tipo_EmpresaTableAdapter();
            taPagoMembresia = new CADINDataSetTableAdapters.Pago_MembresiaTableAdapter();

            s2 = new BindingSource();
            s3 = new BindingSource();
            s4 = new BindingSource();
            s5 = new BindingSource();
            s6 = new BindingSource();
            s8 = new BindingSource();

            dt2 = ta2.GetData();
            dt3 = ta3.GetData();
            dt4 = ta4.GetData();
            dt5 = ta5.GetData();
            dt6 = ta6.GetData();
            emprAgrupDataT = emprAgrupTableA.GetData();

            s2.DataSource = dt2;
            s3.DataSource = dt3;
            s4.DataSource = dt4;
            s5.DataSource = dt5;
            s6.DataSource = dt6;
            s8.DataSource = emprAgrupDataT;

            ta1 = new CADINDataSetTableAdapters.EmpresaTableAdapter();

            ta7 = new CADINDataSetTableAdapters.Contacto_EmpresaTableAdapter();

            s1 = new BindingSource();

            s7 = new BindingSource();

            dt1 = ta1.GetDataByEmpresasActivas();
            dt7 = ta7.GetData();

            s1.DataSource = dt1;
            s7.DataSource = dt7;

            comboBoxEx1.DataSource = s2;
            comboBoxEx1.DisplayMember = "nombre";
            comboBoxEx1.ValueMember = "cod_dept";

            comboBoxEx2.DataSource = s3;
            comboBoxEx2.DisplayMember = "nombre";
            comboBoxEx2.ValueMember = "cod_sect";

            cboAgrupacion.DataSource = s8;
            cboAgrupacion.DisplayMember = "nombre";
            cboAgrupacion.ValueMember="cod_gremio";

            comboBoxEx3.DataSource = s4;
            comboBoxEx3.DisplayMember = "nombre";
            comboBoxEx3.ValueMember = "cod_memb";

            comboBoxEx4.DataSource = s5;
            comboBoxEx4.DisplayMember = "nombre";
            comboBoxEx4.ValueMember = "cod_tari";

            comboBoxEx5.DataSource = s6;
            comboBoxEx5.DisplayMember = "nombre";
            comboBoxEx5.ValueMember = "cod_tipo_empr";

            //Controles de eventos de los combobox de los contactos supleantes
            this.comboBoxEx6.Click += new EventHandler(comboBoxEx6_Click);
            this.comboBoxEx7.Click += new EventHandler(comboBoxEx7_Click);
            this.comboBoxEx8.Click += new EventHandler(comboBoxEx8_Click);
            this.comboBoxEx9.Click += new EventHandler(comboBoxEx9_Click);

            //eventos del datagrid
            this.comboBoxEx4.SelectedIndexChanged += new EventHandler(comboBoxEx4_SelectedIndexChanged);
        }