Ejemplo n.º 1
0
 public static ObserverControladorApoderado getInstancia()
 {
     if (instancia == null)
     {
         instancia = new ObserverControladorApoderado();
         return(instancia);
     }
     return(instancia);
 }
Ejemplo n.º 2
0
 public override void agregarPersona(string[] contacto)
 {
     id      = getSiguienteId();
     dni     = Convert.ToInt32(contacto[0]);
     persona = new Alumno(id, dni, contacto[1], contacto[2],
                          contacto[3], contacto[4], contacto[5],
                          contacto[6], contacto[7], ObserverControladorApoderado.getInstancia().retornarApoderado(contacto[8])
                          );
     for (int i = 5; i < 10; i++)
     {
         if (alumnos[i] == null)
         {
             alumnos[i] = persona;
             MessageBox.Show("Agrego a: " + alumnos[i].Apellido);
             i = 10;
         }
     }
 }
 public static ObserverControladorApoderado getInstancia()
 {
     if (instancia == null)
     {
         instancia = new ObserverControladorApoderado();
         return instancia;
     }
     return instancia;
 }
        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();
        }