Example #1
0
        //Postulantes de las ofertas del usuario
        protected void OnVerPostulantesClicked(object sender, EventArgs e)
        {
            textview2.Buffer.Text = "";
            textview2.Editable    = false;
            string s = "";

            if (CodigoOferta3.Text != "")
            {
                int    ofert = Convert.ToInt32(CodigoOferta3.Text);
                Oferta ofer  = OLI.GetOferta(ofert);
                if (ofer != null)
                {
                    List <Postulacion> p = new List <Postulacion>();

                    s += ("Estos son los usuarios que postularon a su oferta:" + "\n ---------------------------------------\n");
                    foreach (Postulacion po in OLI.Postulaciones)
                    {
                        if (po.Oferta1.Codigo == ofer.Codigo)
                        {
                            if (po.Usuario1.GetType() == typeof(Profesor))
                            {
                                s += ("Nombre: " + po.Usuario1.Nombre + " " + po.Usuario1.Apellido +
                                      " \nRut: " + po.Usuario1.Rut +
                                      " \nRanking: " + po.Usuario1.RankingProm +
                                      " \nEdad: " + po.Usuario1.Edad + " " + "\nEs un profesor");
                            }

                            else if (po.Usuario1.GetType() == typeof(Alumno))
                            {
                                s += ("Nombre: " + po.Usuario1.Nombre + " " + po.Usuario1.Apellido +
                                      " \nRut: " + po.Usuario1.Rut +
                                      " \nRanking: " + po.Usuario1.RankingProm +
                                      " \nEdad: " + po.Usuario1.Edad + " " + "\nEs un alumno");
                            }

                            p.Add(po);

                            if ((po.Usuario1.Comentario.Count) > 0)
                            {
                                s += "Comentarios:\n";
                                foreach (string com in po.Usuario1.Comentario)
                                {
                                    s += com + "\n";
                                }
                            }

                            s += "\n ---------------------------------------\n";
                        }
                    }

                    if (p.Count != 0)
                    {
                        textview2.Buffer.Text = s;
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show("No se encuentran postulante en esa oferta");
                    }
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("El codigo ingresado no existe");
                }
            }
        }
Example #2
0
        //Ingresar Oferta
        protected void OnIngresarOfertaClicked(object sender, EventArgs e)
        {
            if (Titulo1.Text != "" &&
                Remuneracion1.Text != "" &&
                Vacantes1.Text != "" &&
                Descripcion1.Text != "" &&
                Lugar1.Text != "" &&
                Inicio1.Text != "" &&
                Termino1.Text != "")
            {
                string titulo       = Titulo1.Text;
                int    remuneracion = Convert.ToInt32(Remuneracion1.Text);
                int    vacantes     = Convert.ToInt32(Vacantes1.Text);
                string descripcion  = Descripcion1.Text;
                string lugar        = Lugar1.Text;
                string inicio       = Inicio1.Text;
                string termino      = Termino1.Text;
                Evento evento       = new Evento(inicio, termino, lugar);

                if (Invest == true && Area1.Text != "" &&
                    Especialidad1.Text != "")
                {
                    string area         = Area1.Text;
                    string especialidad = Especialidad1.Text;
                    Oferta oferta       = new Investigacion(CodOf, titulo, remuneracion, vacantes, descripcion, evento, Usuario, area, especialidad, true);
                    Usuario.IngresarOferta(OLI, oferta);
                    System.Windows.Forms.MessageBox.Show("Usuario Nº " + Usuario.Rut + " ingresó la investigación Nº " + CodOf);
                    ST.WriteLine("Usuario Nº " + Usuario.Rut + " ingresó la investigación Nº " + CodOf);
                    CodOf += 1;
                    OLI.SerializableCodOf(CodOf);

                    Titulo1.Text       = "";
                    Remuneracion1.Text = "";
                    Vacantes1.Text     = "";
                    Descripcion1.Text  = "";
                    Lugar1.Text        = "";
                    Inicio1.Text       = "DD/MM/AAAA";
                    Termino1.Text      = "DD/MM/AAAA";
                    Area1.Text         = "";
                    Especialidad1.Text = "";
                }

                else if (Invest == false)
                {
                    //Evento evento = new Evento(inicio, termino, lugar);
                    Oferta oferta = new Oferta(CodOf, titulo, remuneracion, vacantes, descripcion, evento, Usuario, true);
                    Usuario.IngresarOferta(OLI, oferta);
                    System.Windows.Forms.MessageBox.Show("Usuario Nº " + Usuario.Rut + " ingresó la oferta Nº " + CodOf);
                    ST.WriteLine("Usuario Nº " + Usuario.Rut + " ingresó la oferta Nº " + CodOf);

                    CodOf += 1;
                    OLI.SerializableCodOf(CodOf);

                    Titulo1.Text       = "";
                    Remuneracion1.Text = "";
                    Vacantes1.Text     = "";
                    Descripcion1.Text  = "";
                    Lugar1.Text        = "";
                    Inicio1.Text       = "DD/MM/AAAA";
                    Termino1.Text      = "DD/MM/AAAA";
                }
            }

            else
            {
                System.Windows.Forms.MessageBox.Show("No ha ingresado todo lo datos o marcado la casilla de investigacion");
            }
        }
Example #3
0
 public Postulacion(int codigo, Usuario usuario, Oferta oferta)
 {
     Codigo   = codigo;
     Usuario1 = usuario;
     Oferta1  = oferta;
 }
 //Sin Console.WriteLine
 public void IngresarOferta(OfertasLaboralesInfo OLI, Oferta oferta)
 {
     OLI.ListaOferta(oferta);
 }
 public void ListaOferta(Oferta oferta)
 {
     Ofertas.Add(oferta);
     SerializableOferta(Ofertas);
 }