Beispiel #1
0
        private void btn_Savedrobot_Click(object sender, EventArgs e)
        {
            RN_Utilitario uti = new RN_Utilitario();

            uti.RN_Actualizar_RobotFalta(5, "Si");
            if (BD_Utilitario.falta == true)
            {
                Msm_Bueno ok = new Msm_Bueno();
                ok.Lbl_msm1.Text = "El Robot fue Actualizado";
                ok.ShowDialog();

                elTab1.SelectedTabPageIndex = 0;
                elTabPage9.Visible          = false;
            }
            else if (rdb_Desact_Robot.Checked == true)
            {
                uti.RN_Actualizar_RobotFalta(5, "No");

                if (BD_Utilitario.falta == true)
                {
                    Msm_Bueno ok = new Msm_Bueno();
                    ok.Lbl_msm1.Text = "El Robot fue Actualizado";
                    ok.ShowDialog();

                    elTab1.SelectedTabPageIndex = 0;
                    elTabPage9.Visible          = false;
                }
            }
        }
Beispiel #2
0
        private void btn_SaveHorario_Click(object sender, EventArgs e)
        {
            try
            {
                RN_Horario      hor   = new RN_Horario();
                EN_Horario      por   = new EN_Horario();
                Frm_Filtro      fil   = new Frm_Filtro();
                Msm_Bueno       ok    = new Msm_Bueno();
                Frm_Advertencia adver = new Frm_Advertencia();

                por.Idhora    = lbl_idHorario.Text;
                por.HoEntrada = dtp_horaIngre.Value;
                por.HoTole    = dtp_hora_tolercia.Value;
                por.HoLimite  = Dtp_Hora_Limite.Value;
                por.HoSalida  = dtp_horaSalida.Value;

                hor.RN_Actualizar_Horario(por);

                if (BD_Horario.saved == true)
                {
                    fil.Show();
                    ok.Lbl_msm1.Text = "El horario Fue actualizado";
                    ok.ShowDialog();
                    fil.Hide();

                    elTabPage9.Visible          = false;
                    elTab1.SelectedTabPageIndex = 0;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #3
0
        private void bt_desaprobarJustificacion_Click(object sender, EventArgs e)
        {
            Frm_Advertencia  adv  = new Frm_Advertencia();
            Frm_Sino         sino = new Frm_Sino();
            Msm_Bueno        ok   = new Msm_Bueno();
            Frm_Filtro       fil  = new Frm_Filtro();
            RN_Justificacion obj  = new RN_Justificacion();

            if (lsv_justifi.SelectedIndices.Count == 0)
            {
                fil.Show();
                MessageBox.Show("Seleccione un item que desea desaprobar", "Advertencia de Seguridad", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                fil.Hide();
            }
            else
            {
                var    lsv       = lsv_justifi.SelectedItems[0];
                string xidjus    = lsv.SubItems[0].Text;
                string xidper    = lsv.SubItems[1].Text;
                string xstadojus = lsv.SubItems[6].Text;

                if (xstadojus.Trim() == "Falta Aprobado")
                {
                    fil.Show(); adv.Lbl_Msm1.Text = "La Justificacion Seleccionada, aun no fue aprobada"; adv.ShowDialog(); fil.Hide(); return;
                }
                ;

                sino.Lbl_msm1.Text = "¿estas Seguro que desea  desaprobar la Justificacion?" + "\n\r" + " -Recuerda que este proceso esta bajo tu responsabilidad";
                fil.Show();
                sino.ShowDialog();
                fil.Hide();


                if (Convert.ToString(sino.Tag) == "Si")
                {
                    obj.RN_Desaprobar_Justificacion(xidjus, xidper);
                    if (BD_Justificacion.tryed == true)
                    {
                        fil.Show();
                        ok.Lbl_msm1.Text = "Justificacion Desaprobada";
                        ok.ShowDialog();
                        fil.Hide();


                        BuscarJustificacion_porValor(xidjus);
                    }
                }
            }
        }
Beispiel #4
0
        // editar

        private void Editar_Personal()
        {
            Msm_Bueno   ok  = new Msm_Bueno();
            Frm_Filtro  fil = new Frm_Filtro();
            RN_Personal obj = new RN_Personal();
            EN_Persona  per = new EN_Persona();

            try
            {
                per.Idpersonal    = txt_IdPersona.Text;
                per.Dni           = txt_Dni.Text;
                per.Nombres       = txt_nombres.Text;
                per.anoNacimiento = dtp_fechaNaci.Value;
                per.Sexo          = cbo_sexo.Text;
                per.Direccion     = txt_direccion.Text;
                per.Correo        = txt_correo.Text;
                per.Celular       = Convert.ToInt32(txt_NroCelular.Text);
                per.IdRol         = Convert.ToString(cbo_rol.SelectedValue);
                per.xImagen       = xfotoruta;
                per.IdDistrito    = Convert.ToString(cbo_Distrito.SelectedValue);

                obj.RN_Editar_Personal(per);


                if (BD_Personal.edited == true)
                {
                    fil.Show();
                    ok.Lbl_msm1.Text = "Los datos del Personal se han editado correctamente";
                    ok.ShowDialog();
                    fil.Hide();


                    this.Tag = "B";
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Beispiel #5
0
        private void bt_ElimiJusti_Click(object sender, EventArgs e)
        {
            Frm_Advertencia  adv  = new Frm_Advertencia();
            Frm_Sino         sino = new Frm_Sino();
            Msm_Bueno        ok   = new Msm_Bueno();
            Frm_Filtro       fil  = new Frm_Filtro();
            RN_Justificacion obj  = new RN_Justificacion();

            if (lsv_justifi.SelectedIndices.Count == 0)
            {
                fil.Show();
                adv.Lbl_Msm1.Text = "Seleccione el item que desea Eliminar";
                adv.ShowDialog();
                fil.Hide(); return;
            }
            else
            {
                var    lsv    = lsv_justifi.SelectedItems[0];
                string xidjus = lsv.SubItems[0].Text;

                sino.Lbl_msm1.Text = "Estas Seguro de Eliminar la Justificacion?" + "\n\r" + "- Recuerda que este proceso esta bajo tu responsabilidad";
                fil.Show();
                sino.ShowDialog();
                fil.Hide();

                if (Convert.ToString(sino.Tag) == "Si")
                {
                    obj.RN_Eliminar_Justificacion(xidjus);
                    fil.Show();
                    ok.Lbl_msm1.Text = "Justificacion Desaprobada";
                    ok.ShowDialog();
                    fil.Hide();


                    BuscarJustificacion_porValor(xidjus);
                }
            }
        }
        private void Editar_Justificacion()
        {
            RN_Justificacion obj = new RN_Justificacion();
            EN_Justificacion jus = new EN_Justificacion();

            Frm_Filtro fil = new Frm_Filtro();
            Msm_Bueno  ok  = new Msm_Bueno();

            try
            {
                jus.IdJusti         = txt_idjusti.Text.Trim();
                jus.Id_Personal     = txt_IdPersona.Text;
                jus.PrincipalMotivo = cbo_motivJusti.Text;
                jus.Detalle         = txt_DetalleJusti.Text;
                jus.Fecha           = Dtp_FechaJusti.Value;

                obj.RN_Editar_Justificacion(jus);

                if (BD_Justificacion.edited == true)
                {
                    RN_Utilitario.RN_Actualizar_Tipo_Doc(4);

                    fil.Show();
                    ok.Lbl_msm1.Text = "La solicitud de la justificacion fue registrada con exito";
                    ok.ShowDialog();
                    fil.Hide();

                    LimpiarPiso();
                    this.Tag = "A";
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Revisa el erro: " + ex.Message, "Advertencia de Seguridad", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #7
0
        private void timerFalta_Tick(object sender, EventArgs e)
        {
            RN_Asistencia   obj     = new RN_Asistencia();
            Frm_Filtro      fis     = new Frm_Filtro();
            Frm_Advertencia adver   = new Frm_Advertencia();
            Msm_Bueno       ok      = new Msm_Bueno();
            DataTable       dataper = new DataTable();
            RN_Personal     objper  = new RN_Personal();

            int HoLimite = Dtp_Hora_Limite.Value.Hour;
            int MiLimite = Dtp_Hora_Limite.Value.Minute;

            int    horaCaptu      = DateTime.Now.Hour;
            int    minutoCaptu    = DateTime.Now.Minute;
            string Dniper         = "";
            int    Cant           = 0;
            int    TotalItem      = 0;
            string xidpersona     = "";
            string IdAsistencia   = "";
            string xjustificacion = "";

            if (horaCaptu >= HoLimite)
            {
                if (minutoCaptu >= MiLimite)
                {
                    dataper = objper.RN_Leer_todoPersona();
                    if (dataper.Rows.Count <= 0)
                    {
                        return;
                    }
                    TotalItem = dataper.Rows.Count;  // obtenemos el total de personas registradas

                    foreach (DataRow Registro in dataper.Rows)
                    {
                        Dniper     = Convert.ToString(Registro["DNIPR"]);
                        xidpersona = Convert.ToString(Registro["Id_Pernl"]);

                        if (obj.RN_Checar_SiPersonal_TieneAsistencia_Registrada(xidpersona.Trim()) == false)
                        {
                            if (obj.RN_Checar_SiPersonal_YaMarco_suFalta(xidpersona.Trim()) == false)
                            {
                                // llamar registrar falta
                                RN_Asistencia objA = new RN_Asistencia();
                                EN_Asistencia asi  = new EN_Asistencia();
                                IdAsistencia = RN_Utilitario.RN_NroDoc(3);

                                // verificar si el personal tiene justificacion
                                if (objA.RN_Verificar_Justificacion_Aprobada(xidpersona) == true)
                                {
                                    xjustificacion = "Falta tiene justificativo";
                                }
                                else
                                {
                                    xjustificacion = "No tiene Justificactivo";
                                }

                                obj.RN_Registrar_Falta_Personal(IdAsistencia, xidpersona, xjustificacion);
                                if (BD_Asistencia.faltasaved == true)
                                {
                                    RN_Utilitario.RN_Actualizar_Tipo_Doc(3); // actualizamos el numero correlativo de asistencia
                                    // contador: almacena la cantidad de faltas registradas
                                    Cant += 1;
                                }
                            }
                        }
                    }// fin foreach

                    if (Cant > 1)
                    {
                        timerFalta.Stop();
                        fis.Show();
                        ok.Lbl_msm1.Text = "un total de: " + Cant.ToString() + "/" + TotalItem + "faltas se han registrado exitosamente";
                        ok.ShowDialog();
                        fis.Hide();
                    }
                    else
                    {
                        timerFalta.Stop();
                        fis.Show();
                        ok.Lbl_msm1.Text = "el dia de hoy no falto nadie al trabajo, las " + TotalItem + "Pesonas Marcaron si Asistencia";
                        ok.ShowDialog();
                        fis.Hide();
                    }
                }
            }
        }