コード例 #1
0
 private void btnAgregar(object sender, EventArgs e)
 {
     fechaNacimi = fechaNacimiento.Value.Year.ToString() + "/" + fechaNacimiento.Value.Month.ToString() + "/" + fechaNacimiento.Value.Day.ToString();
     if (cbTipoPero.Text == "Alumno")
     {
         valores     = new string[9];
         valores[0]  = txbDni.Text;
         valores[1]  = txbNombre.Text;
         valores[2]  = txbApelliPa.Text + " " + txbApelliMa.Text;
         valores[3]  = txbDireccion.Text;
         valores[4]  = fechaNacimi;
         valores[5]  = "institucio";
         valores[6]  = txbTelefono.Text;
         valores[7]  = "institucioFutuo";
         valores[8]  = panelTipoPersona.getApoderado();
         controlador = ObserverControladorAlumno.getInstancia();
         controlador.agregarPersona(valores);
     }
     if (cbTipoPero.Text == "Apoderado")
     {
         valores     = new string[6];
         valores[0]  = txbDni.Text;
         valores[1]  = txbNombre.Text;
         valores[2]  = txbApelliPa.Text + " " + txbApelliMa.Text;
         valores[3]  = txbDireccion.Text;
         valores[4]  = fechaNacimi;
         valores[5]  = txbTelefono.Text;
         controlador = ObserverControladorApoderado.getInstancia();
         controlador.agregarPersona(valores);
     }
 }
コード例 #2
0
        private void iniciarComponentes()
        {
            bntBuscar       = new Button();
            combBusApoder   = new ComboBox();
            lblApo          = new Label();
            lblInsFu        = new Label();
            txbAgregarUniFu = new TextBox();
            txbAgregarIns   = new TextBox();
            btnAgreInsFutu  = new Button();
            btnAgrInstPro   = new Button();
            lstbInstFutu    = new ListBox();
            lstbInstitu     = new ListBox();
            lblInstitucion  = new Label();
            //
            // lblInstitucion
            //
            this.lblInstitucion.AutoSize = true;
            this.lblInstitucion.Location = new System.Drawing.Point(0, 19);
            this.lblInstitucion.Name     = "label1";
            this.lblInstitucion.Size     = new System.Drawing.Size(55, 13);
            this.lblInstitucion.TabIndex = 0;
            this.lblInstitucion.Text     = "Institucion";
            //
            // lstbInstitu
            //
            this.lstbInstitu.FormattingEnabled = true;
            this.lstbInstitu.Location          = new System.Drawing.Point(83, 19);
            this.lstbInstitu.Name     = "listBox1";
            this.lstbInstitu.Size     = new System.Drawing.Size(120, 43);
            this.lstbInstitu.TabIndex = 1;
            //
            // lstbInstFutu
            //
            this.lstbInstFutu.FormattingEnabled = true;
            this.lstbInstFutu.Location          = new System.Drawing.Point(83, 77);
            this.lstbInstFutu.Name     = "listBox2";
            this.lstbInstFutu.Size     = new System.Drawing.Size(120, 43);
            this.lstbInstFutu.TabIndex = 2;
            //
            // btnAgrInstPro
            //
            this.btnAgrInstPro.Location = new System.Drawing.Point(226, 39);
            this.btnAgrInstPro.Name     = "button1";
            this.btnAgrInstPro.Size     = new System.Drawing.Size(75, 23);
            this.btnAgrInstPro.TabIndex = 3;
            this.btnAgrInstPro.Text     = "Agregar";
            this.btnAgrInstPro.UseVisualStyleBackColor = true;
            this.btnAgrInstPro.Click += new EventHandler(btnAInPro);
            //
            // txbNueInstPro
            //
            this.txbAgregarIns.Location = new System.Drawing.Point(226, 19);
            this.txbAgregarIns.Name     = "textBox1";
            this.txbAgregarIns.Size     = new System.Drawing.Size(74, 20);
            this.txbAgregarIns.TabIndex = 5;
            this.txbAgregarIns.Enabled  = false;
            //
            // txbAgregarUniFu
            //
            this.txbAgregarUniFu.Location = new System.Drawing.Point(226, 77);
            this.txbAgregarUniFu.Name     = "textBox2";
            this.txbAgregarUniFu.Size     = new System.Drawing.Size(74, 20);
            this.txbAgregarUniFu.TabIndex = 6;
            this.txbAgregarUniFu.Enabled  = false;
            //
            // label2
            //
            this.lblInsFu.Location = new System.Drawing.Point(0, 80);
            this.lblInsFu.Name     = "label2";
            this.lblInsFu.Size     = new System.Drawing.Size(55, 29);
            this.lblInsFu.TabIndex = 7;
            this.lblInsFu.Text     = "Institucion Futura:";
            //
            // label3
            //
            this.lblApo.AutoSize = true;
            this.lblApo.Location = new System.Drawing.Point(0, 144);
            this.lblApo.Name     = "label3";
            this.lblApo.Size     = new System.Drawing.Size(62, 13);
            this.lblApo.TabIndex = 8;
            this.lblApo.Text     = "Apoderado:";
            //
            // comboBox2
            //
            this.combBusApoder.Location              = new System.Drawing.Point(83, 141);
            this.combBusApoder.Name                  = "comboBox2";
            this.combBusApoder.Size                  = new System.Drawing.Size(121, 21);
            this.combBusApoder.TabIndex              = 9;
            this.combBusApoder.SelectedIndexChanged += CombBusApoder_SelectedIndexChanged;
            this.combBusApoder.Click                += CombBusApoder_Click;

            //
            // button2
            //
            this.btnAgreInsFutu.Location = new System.Drawing.Point(226, 97);
            this.btnAgreInsFutu.Name     = "button2";
            this.btnAgreInsFutu.Size     = new System.Drawing.Size(75, 23);
            this.btnAgreInsFutu.TabIndex = 4;
            this.btnAgreInsFutu.Text     = "Agregar";
            this.btnAgreInsFutu.UseVisualStyleBackColor = true;
            this.btnAgreInsFutu.Click += new EventHandler(btnAgreInFut);
            //
            // button3
            //
            this.bntBuscar.Location = new System.Drawing.Point(226, 141);
            this.bntBuscar.Name     = "button3";
            this.bntBuscar.Size     = new System.Drawing.Size(75, 23);
            this.bntBuscar.TabIndex = 10;
            this.bntBuscar.Text     = "Buscar";
            this.bntBuscar.UseVisualStyleBackColor = true;
            this.bntBuscar.Click += new EventHandler(btnbuscar);
            agregarControles();
            controlador = ObserverControladorApoderado.getInstancia();

            listaApo = controlador.listaApoderado();
        }