Exemplo n.º 1
0
        private void button_actualizar_Click(object sender, EventArgs e)
        {
            DateTime fechaActual = DateTime.Now.Date;
            DateTime fechaInicio = new DateTime();
            DateTime fechaFin    = new DateTime();

            try
            {
                int indiceFilaSeleccionada = dataGridView_vacaciones.CurrentRow.Index;
                fechaInicio = Convert.ToDateTime(dataGridView_vacaciones.Rows[indiceFilaSeleccionada].Cells[3].Value);
                fechaFin    = Convert.ToDateTime(dataGridView_vacaciones.Rows[indiceFilaSeleccionada].Cells[4].Value);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error, ha seleccionado una fila no existente");
            }

            if (fechaActual < fechaInicio)
            {
                FundacionTalitaKumi.Modelo.Vacacion vacacion = new Modelo.Vacacion(identificacion, fechaInicio, fechaFin);
                VacacionesPersonal vp = new VacacionesPersonal(vacacion, pbd.retornarObjetoPersonal(identificacion), true);
                vp.Show();
            }
            else
            {
                MessageBox.Show("No puede modificar las fechas. Ya ha sobrepasado la fecha de Inicio");
            }
        }
Exemplo n.º 2
0
        private void button_pdf_Click(object sender, EventArgs e)
        {
            GeneraPDF      genera = new GeneraPDF();
            AreaBD         area   = new AreaBD();
            InformePAINABD pabd   = new InformePAINABD();
            PersonalBD     perBD  = new PersonalBD();
            BeneficiariaBD benBD  = new BeneficiariaBD();

            Modelo.Area            areaPDF  = area.retornarArea(Program.IdBeneficiaria);
            Modelo.InformePAINA    painaPDF = pabd.retornarPAINA(Program.IdBeneficiaria);
            Modelo.Personal        perPDF   = perBD.retornarObjetoPersonal(Program.IdPersonal);
            Modelo.DatosFamiliares famPDF   = benBD.retornarObjetoDatosFamiliares(Program.IdBeneficiaria);

            DialogResult dr = MessageBox.Show("¿Está seguro que desea generar el PDF del informe?", "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                if (guardarPDF.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        MessageBox.Show("Espere mientras se genera el PDF");
                        genera.GenerarPDF(guardarPDF.FileName, beneficiaria, painaPDF, areaPDF, perPDF, famPDF);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("No se ha podido generar el PDF");
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void dataGridView_Personal_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            String idPersonalConsulta = dataGridView_Personal.CurrentRow.Cells[0].Value.ToString();

            dataGridView_Personal.DataSource = null;
            dataGridView_Personal.Refresh();
            panel_datos.Controls.Clear();
            VacacionesPersonal vp = new VacacionesPersonal(null, pbd.retornarObjetoPersonal(idPersonalConsulta), false);

            vp.Dock = DockStyle.Fill;
            panel_datos.Controls.Add(vp);
            vp.Show();
            //setear datos personales
        }
        private void dataGridView_Personal_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //panel de datos
            String idPersonalConsulta = dataGridView_Personal.CurrentRow.Cells[0].Value.ToString();

            dataGridView_Personal.DataSource = null;
            dataGridView_Personal.Refresh();
            panel_datos.Controls.Clear();
            DatosPersonalAdministrativo dpa = new DatosPersonalAdministrativo("C", pbd.retornarObjetoPersonal(idPersonalConsulta));

            dpa.Dock = DockStyle.Fill;
            panel_datos.Controls.Add(dpa);
            dpa.Show();
            //setear valores desde BD
        }
Exemplo n.º 5
0
 private void buttonIngresar_Click(object sender, EventArgs e)
 {
     //verifica BD
     if (pbd.iniciarSesion(textBox_usuario.Text, validar.obtenerMD5(textBox_contrasena.Text)))
     {
         VentanaPrincipal vp = new VentanaPrincipal(pbd.retornarObjetoPersonal(textBox_usuario.Text));
         vp.Visible = true;
         Hide();
     }
     else
     {
         MessageBox.Show("Usuario o Contraseña Incorrectos");
         textBox_usuario.Text            = "Ingrese su Identificación";
         textBox_usuario.ForeColor       = Color.DimGray;
         textBox_contrasena.Text         = "Ingrese su Contraseña";
         textBox_contrasena.PasswordChar = '\0';
         textBox_contrasena.ForeColor    = Color.DimGray;
     }
 }
Exemplo n.º 6
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     personal           = pbd.retornarObjetoPersonal(textBox_id.Text);
     Program.IdPersonal = textBox_id.Text;
     cargarALista(personal);
 }