Exemplo n.º 1
0
        private void dgvHorarios_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int index = dgvHorarios.CurrentRow.Index;

            horario = horarios[index];
            //Console.WriteLine(horario.idHorario+horario.numVacantes);
            frmGestionarHorario formGestionarHorario = new frmGestionarHorario(horario, curso);

            if (formGestionarHorario.ShowDialog() == DialogResult.OK)
            {
                horarios[index] = formGestionarHorario.HorarioSeleccionado;
                //Console.WriteLine(horarios[index].idHorario+ horarios[index].numVacantes);
                DataGridViewRow row = dgvHorarios.CurrentRow;
                row.Cells[0].Value = horarios[index].clase;
                row.Cells[1].Value = horarios[index].horaIni.ToShortTimeString();
                row.Cells[2].Value = horarios[index].horaFin.ToShortTimeString();
                if (horario.colaborador != null)
                {
                    row.Cells[3].Value = horarios[index].colaborador.nombre;
                }
                else
                {
                    row.Cells[3].Value = '-';
                }
                row.Cells[4].Value = horarios[index].fecha.ToShortDateString();
                row.Cells[5].Value = horarios[index].sede.direccion;
                row.Cells[6].Value = horarios[index].numVacantes;
            }
        }
Exemplo n.º 2
0
        private void btnAddHorario_Click(object sender, EventArgs e)
        {
            if (curso == null)
            {
                frmMensaje mensaje = new frmMensaje("Seleccione un curso", "Error", ""); if (mensaje.ShowDialog() == DialogResult.OK)
                {
                }
                return;
            }
            frmGestionarHorario formGestionarHorario = new frmGestionarHorario(curso);

            if (formGestionarHorario.ShowDialog() == DialogResult.OK)
            {
                horario = formGestionarHorario.HorarioSeleccionado;
                Service.asistencia a = new Service.asistencia();
                horarios.Add(horario);
                Object[] filaHorario = new Object[7];
                filaHorario[0] = horario.clase;
                filaHorario[1] = horario.horaIni.ToShortTimeString();
                filaHorario[2] = horario.horaFin.ToShortTimeString();
                if (horario.colaborador.idPersona != 0)
                {
                    filaHorario[3] = horario.colaborador.nombre;
                }
                else
                {
                    filaHorario[3] = "-";
                }

                filaHorario[4] = horario.fecha.ToShortDateString();
                filaHorario[5] = horario.sede.direccion;
                filaHorario[6] = horario.numVacantes;
                dgvHorarios.Rows.Add(filaHorario);
            }
        }
Exemplo n.º 3
0
        private void dgvHorarios_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Console.WriteLine(horarios[dgvHorarios.CurrentRow.Index].sede.direccion);
            horario = horarios[dgvHorarios.CurrentRow.Index];
            frmGestionarHorario formGestionarHorario = new frmGestionarHorario(horario);

            if (formGestionarHorario.ShowDialog() == DialogResult.OK)
            {
                Console.WriteLine("entra al gestionar horario con un horario");
            }
        }
        private void btnRegistrarHorario_Click_1(object sender, EventArgs e)
        {
            frmGestionarHorario formRegistrarHorario = new frmGestionarHorario();

            formRegistrarHorario.Visible = true;
        }