Example #1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            //saco la data del form

            ServicioJava.horaExtra hora_extra = new ServicioJava.horaExtra();

            hora_extra.personal    = new ServicioJava.personal();
            hora_extra.personal.id = var_usuario.id;

            hora_extra.fecha          = dtpFechaHE.Value;
            hora_extra.fechaSpecified = true;

            //la hora en time
            hora_extra.horaInicio = txtHIni_HE.Text;
            hora_extra.horaFin    = txtHFin_HE.Text;

            hora_extra.cantidadHoras = Int32.Parse(txtCantHoras_HE.Text);
            hora_extra.descripcion   = txtDescripcion_HE.Text;

            //llamamos al SERVICIO RESPECTIVO
            try
            {
                if (estadoForm == Estado.Nuevo)
                {
                    servTA.insertarHoraExtra(hora_extra);
                }
                else if (estadoForm == Estado.Modificar)
                {
                    hora_extra.justificado = -1;
                    servTA.actualizarHoraExtra(hora_extra);
                }
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex);
            }

            estadoForm = Estado.Inicial;
            estadoComponentes(estadoForm);

            //mostramos mensaje de registro exitoso
            this.muestraMensajeExitoso();
        }
Example #2
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            frmBuscarHE var_frmBuscarHe = new frmBuscarHE(var_usuario.id);

            if (var_frmBuscarHe.ShowDialog() == DialogResult.OK)
            {
                var_hora_extra_seleccionada = var_frmBuscarHe.HESeleccionada;

                dtpFechaHE.Value = var_hora_extra_seleccionada.fecha;

                //la hora en time
                txtHIni_HE.Text = var_hora_extra_seleccionada.horaInicio;
                txtHFin_HE.Text = var_hora_extra_seleccionada.horaFin;

                txtCantHoras_HE.Text   = var_hora_extra_seleccionada.cantidadHoras.ToString();
                txtDescripcion_HE.Text = var_hora_extra_seleccionada.descripcion;
            }

            estadoForm = Estado.Buscar;
            estadoComponentes(estadoForm);
        }
        private void dgvRespValida_HE_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            String validacion = "";

            ServicioJava.horaExtra _inasis = dgvRespValida_HE.Rows[e.RowIndex].DataBoundItem
                                             as ServicioJava.horaExtra;
            dgvRespValida_HE.Rows[e.RowIndex].Cells[0].Value = _inasis.descripcion;
            if (_inasis.justificado == -1)
            {
                validacion = "PENDIENTE";
            }
            else if (_inasis.justificado == 0)
            {
                validacion = "NO VALIDADO";
            }
            else if (_inasis.justificado == 1)
            {
                validacion = "VALIDADO";
            }

            dgvRespValida_HE.Rows[e.RowIndex].Cells[1].Value = validacion;
        }