Example #1
0
        public static string inicializar(MySqlConnection conn)
        {
            string sql = "Select * from profesor;";

            try
            {
                MySqlCommand command = new MySqlCommand(sql, conn);
                MySqlDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {
                    int codigo = reader.GetInt32("codigo");
                    string nombre = reader.GetString("nombre");
                    int dni = reader.GetInt32("Dni");
                    string correo = reader.GetString("correo");
                    int telefono = reader.GetInt32("telefono");
                    double sueldo = reader.GetDouble("sueldo");
                    string fechaContratacion = reader.GetString("fechaContratacion");
                    int estado = reader.GetInt32("estado");
                    Profesor p = new Profesor(nombre, dni, correo, telefono, sueldo, fechaContratacion, estado);
                    Profesores.Add(p);

                }
                reader.Close();
                command.Dispose();
                return Profesores.Count.ToString();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                return ex.ToString();
            }
        }
Example #2
0
        private async Task <bool> CargarEstudiante(int idEstudianteACargar)
        {
            //Cargar profesor en base a un id...
            try
            {
                string jsonEstudiante = tools.DataTableToJSONWithStringBuilder(profesor.SProfesor(idEstudianteACargar.ToString()));
                profesor = JsonConvert.DeserializeObject <Profesor>(jsonEstudiante);

                txtCodigo.Text    = profesor.id_profe.ToString();
                txtNombre.Text    = profesor.nombre;
                txtApellido.Text  = profesor.apellido;
                txtEmail.Text     = profesor.email;
                txtContacto.Text  = profesor.contacto;
                chkEstado.Checked = profesor.estado.ToUpper() == "A" ? true : false;

                isNuevoRegistro = false;
                tools.DeshabilitarControles(this);
                FormatearBotones(ProcesoBotones.CancelarRegistroExistente);
            }
            catch (Exception ex)
            {
                tools.MensajeNormal(ex.Message);
            }
            return(true);
        }
Example #3
0
 public Reunion(Alumno a,Profesor p, DateTime t,string tem,string sug)
 {
     alumno=a;
     profesor=p;
     fecha=t;
     tema=tem;
     sugerencias=sug;
 }
Example #4
0
        /// <summary>
        /// Evento que permite agregar tutor
        /// </summary>
        /// <param name="sender">Generador de evento</param>
        /// <param name="e">Argumentos del evento</param>
        private void button1_Click(object sender, EventArgs e)
        {
            int codigo                = Int32.Parse(textBoxCodigo.Text);
            string nombre             = textBoxNombre.Text;
            int dni                   = Int32.Parse(textBoxDNI.Text);
            string correo             = textBoxCorreo.Text;
            int telefono              = Int32.Parse(textBoxTelefono.Text);
            string regimen            = comboBoxDedicacion.SelectedText;
            int idioma                = comboBoxIdioma.SelectedIndex;
            DateTime fechaInicio      = dateTimePickerInicio.Value;
            DateTime fechaFin         = dateTimePickerFin.Value;
            int anio                  = fechaInicio.Year;
            string gradoAcademico     = comboBoxGrado.SelectedText ;
            Especialidad especialidad = new Especialidad(comboBoxEspecialidad.SelectedIndex, comboBoxEspecialidad.SelectedText);
            string FechaFin           = fechaInicio.ToString("yyyy-MM-dd");
            string FechaIinicio       = fechaFin.ToString("yyyy-MM-dd");

            if (comboBoxCategoria.SelectedIndex == 0)
            {
                ProfesorContratado newProfesor = new ProfesorContratado(codigo,  nombre,  dni, correo, telefono,
                    regimen, idioma, anio, gradoAcademico, especialidad,FechaIinicio, FechaFin);
                ProfesorAgregado = newProfesor;
            }
            else
            {
                string categoria ="";
                if (comboBoxCategoria.SelectedIndex == 1)
                {
                    categoria = "Auxiliar";
                }
                else if(comboBoxCategoria.SelectedIndex == 2)
                {
                    categoria = "Asociado";
                }
                else if (comboBoxCategoria.SelectedIndex == 3)
                {
                    categoria = "Principal";
                }
                ProfesorOrdinario newProfesor = new ProfesorOrdinario( codigo, nombre, dni, correo, telefono,  regimen, idioma, anio,
                    gradoAcademico, especialidad,FechaIinicio, FechaIinicio, FechaFin, categoria);
                ProfesorAgregado = newProfesor;
            }

            MessageBox.Show("Profesor agregado");
            this.Close();
        }
Example #5
0
        public static string agregarProfesor(Profesor profesor, MySqlConnection conn)
        {
            profesores.Add(profesor);;
            string sql = "Insert into alumno(idprofesor,nombre,dni,correo,telefono,sueldo,fechaContratacion,estado) values('"
                + profesor.Codigo + "','" + profesor.Nombre + "','" + profesor.Dni + "','" + profesor.Correo + "','" + profesor.Telefono + "','" + profesor.Sueldo
                + "','" + profesor.FechaContratacion + "','" + profesor.Estado + "');";

            try
            {
                MySqlCommand command = new MySqlCommand(sql, conn);
                command.ExecuteNonQuery();
                command.Dispose();
                return "0";
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            return "-1";
        }
Example #6
0
 public MateriasCurso()
 {
     Curso    = new Curso();
     Materia  = new Materia();
     Profesor = new Profesor();
 }
 public ProfesorMaterias(Materia materia, Profesor profesor)
 {
     Materia  = materia;
     Profesor = profesor;
 }
 public ProfesorMaterias()
 {
     Materia  = new Materia();
     Profesor = new Profesor();
 }
 public ProfesorTutor(Profesor profesor)
 {
     this.profesor = profesor;
 }
Example #10
0
 public CrearReunion(Alumno a, Profesor p)
 {
     this.alumno = a;
     this.profesor = p;
     InitializeComponent();
 }
Example #11
0
 public void agregarProfesorTutor(Profesor profesor)
 {
     ProfesorTutor prof=new ProfesorTutor(profesor);
     Tutores.Add(prof);
 }