예제 #1
0
        //-----------------------------------------------------------------------------------------------
        //                                      C O M B O S
        //-----------------------------------------------------------------------------------------------
        private void cbtiponomina_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Util.p_inicbo == 1)
            {
                Utilerias.ControlNotificaciones(pnlmenssuid, menssuid, 2, "Espere por favor, buscando registros...");
                Cursor.Current = Cursors.WaitCursor;

                DataTable dtemplsinc = SincReg.cbsincsica(16, Int32.Parse(cbtiponomina.SelectedValue.ToString()));
                string    sdatos     = dtemplsinc.Rows[0][0].ToString();

                string icaracttotal = (sdatos.Length.ToString());
                int    ivalor       = Int32.Parse(icaracttotal) - 1;

                string sdatosbusq = sdatos.Substring(0, ivalor);


                DataTable dtfechas = ProcesaInc.dttiponomina(14, Int32.Parse(cbtiponomina.SelectedValue.ToString()));
                string    sfecini  = dtfechas.Rows[0][2].ToString();
                string    sfecfin  = dtfechas.Rows[0][3].ToString();

                DataTable dtregsica = SincReg.sincregsica(sfecini, sfecfin, sdatosbusq);
                dgvregistros.DataSource = dtregsica;

                dgvregistros.Columns[0].Width = 400; //empleado
                dgvregistros.Columns[1].Width = 140; //fecha
                dgvregistros.Columns[2].Width = 130; //reloj

                pnlmenssuid.Visible = false;
                Cursor.Current      = Cursors.Default;
            }
        }
예제 #2
0
        //-----------------------------------------------------------------------------------------------
        //                                      F U N C I O N E S
        //-----------------------------------------------------------------------------------------------



        private void MostrarNotificacion(DataTable response)
        {
            ckbEliminar.Checked = false;
            PanelEditar.Visible = false;

            if (response.Columns.Contains("INSERTAR"))
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 1, "Asignación Correcta");
                timer1.Start();
            }
            else if (response.Columns.Contains("EXISTE"))
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Esta Asignación ya existe");
                timer1.Start();
            }
            else if (response.Columns.Contains("ACTUALIZAR"))
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 1, "Actualización Correcta");
                timer1.Start();
            }
            else if (response.Columns.Contains("ESTATUS"))
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 1, "Cambio de Estatus Correcto");
                timer1.Start();
            }
        }
예제 #3
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            ckbheader.Checked = false;

            if (cbTipoNomina.SelectedIndex > 0)
            {
                IncCalificacion objInc = new IncCalificacion();
                objInc.fFechaInicio  = DateTime.Parse(lbFechaI.Text);
                objInc.fFechaTermino = DateTime.Parse(lbFechaT.Text);
                if (txtIdTrab.Text != String.Empty)
                {
                    objInc.sIdtrab = txtIdTrab.Text;
                }
                else
                {
                    objInc.sIdtrab = "%";
                }

                objInc.iStinc = Convert.ToInt32(cbTipoNomina.SelectedValue);


                LlenarGrid(objInc);
            }
            else if (cbTipoNomina.SelectedText.Contains("Sin Periodos Abiertos"))
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "No Existen Periodo Abiertos");
                timer1.Start();
            }
            else
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 2, "No se ha Seleccionado Algún Periodo Abierto");
                timer1.Start();
            }
        }
예제 #4
0
 public bool Connect_Net(string IPAdd, int Port)
 {
     try
     {
         if (objCZKEM.Connect_Net(IPAdd, Port))
         {
             if (objCZKEM.RegEvent(1, 65535))
             {
                 //objCZKEM.OnConnected += ObjCZKEM_OnConnected;
                 //objCZKEM.OnDisConnected += objCZKEM_OnDisConnected;
                 //objCZKEM.OnEnrollFinger += ObjCZKEM_OnEnrollFinger;
                 //objCZKEM.OnFinger += ObjCZKEM_OnFinger;
                 //objCZKEM.OnAttTransactionEx += new _IZKEMEvents_OnAttTransactionExEventHandler(zkemClient_OnAttTransactionEx);
                 objCZKEM.RegEvent(1, 32767);
             }
             return(true);
         }
         return(false);
     }
     catch {
         Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "No fue Posible conectar con el Dispositivo.");
         timer1.Start();
         return(false);
     }
 }
예제 #5
0
        private void button6_Click(object sender, EventArgs e)
        {
            string compania  = comboBox4.SelectedIndex > 0 ? comboBox4.SelectedValue.ToString() : "%";
            string tnomina   = cbTipoNomina.SelectedIndex > 0 ? cbTipoNomina.SelectedValue.ToString() : "%";
            string ubicacion = comboBox3.SelectedIndex > 0 ? comboBox3.SelectedValue.ToString() : "%";
            string area      = comboBox1.SelectedIndex > 0 ? comboBox1.SelectedValue.ToString() : "%";
            string depto     = comboBox2.SelectedIndex > 0 ? comboBox2.SelectedValue.ToString() : "%";
            int    status    = comboBox5.SelectedIndex == 0 ? 1 : 0;

            date = dpFechaInicio.Value;
            serializeClass(date);

            //llena combo de empleados
            SonaTrabajador CSonaTrab  = new SonaTrabajador();
            DataTable      dtEmpleado = CSonaTrab.obtenerempleadosxfiltros(9, "%", compania, area, "%", "%", ubicacion, tnomina, status, 1);

            Utilerias.llenarComboxDataTable(cb, dtEmpleado, "NoEmpleado", "Nombre");

            //***
            pnlMensaje.Enabled = true;
            Utilerias.ControlNotificaciones(panelTag, lbMensaje, 2, "Se encontraron " + (cb.Items.Count - 1) + " registros");
            pnlMensaje.Enabled = false;
            timer1.Start();
            //***
        }
예제 #6
0
        private void dgvPlantel_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (Permisos.dcPermisos["Actualizar"] == 1)
            {
                if (cvusuario != null)
                {
                    if (cbCompania.SelectedIndex != 0 && dgvUsuarios.SelectedRows.Count != 0)
                    {
                        if (dgvPlantel.SelectedRows.Count != 0)
                        {
                            //AsignarPlantel();
                            Utilerias.MultiSeleccionGridViewString(dgvPlantel, 3, ltArea, panelPermisos);

                            //DataGridViewRow row = this.dgvPlantel.SelectedRows[0];
                            //row.Cells[0].Value = Resources.ic_check_circle_green_400_18dp;
                            //idplanta = row.Cells[3].Value.ToString();

                            //panelPermisos.Enabled = true;

                            //ltArea.Add(idplanta);

                            //if (cbCompania.SelectedIndex > 0)
                            //{
                            //    temporal = cbCompania.SelectedValue.ToString();
                            //}

                            //if (ltArea.Count == 0)
                            //{ panelPermisos.Enabled = false; }
                            //else
                            //{ panelPermisos.Enabled = true; }

                            //if (row.Cells[0].Tag.ToString() == "check")
                            //{

                            //    row.Cells[0].Value = Resources.ic_lens_blue_grey_600_18dp;
                            //    row.Cells[0].Tag = "uncheck";

                            //}
                            //else
                            //{
                            //    row.Cells[0].Value = Resources.ic_check_circle_green_400_18dp;
                            //    row.Cells[0].Tag = "check";

                            //}
                        }
                    }
                    else
                    {
                        Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "No se ha Seleccionado a un Usuario y Compañia");
                        timer1.Start();
                    }
                }
                else
                {
                    Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "No se ha Seleccionado a un Usuario");
                    timer1.Start();
                }
            }
        }
예제 #7
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (ltReloj.Count > 0)
            {
                panelMensaje.Visible = true;
                int iCont = 0;
                prgb1.Value = 20;
                bool bBandera = false;
                foreach (Reloj obj in ltReloj)
                {
                    iCont += 1;
                    panelMensaje.Enabled = true;
                    Utilerias.ControlNotificaciones(panelTag, lbMensaje, 2, "Conectando con Dispositivo " + iCont + " de " + ltReloj.Count);
                    prgb1.Value          = 40;
                    panelMensaje.Enabled = false;
                    bool bConect = objCZKEM.Connect_Net(obj.IpReloj, 4370);

                    if (bConect != false)
                    {
                        prgb1.Value = prgb1.Value + (10 / ltReloj.Count);
                        switch (iOpcionAdmin)
                        {
                        case 0:
                            int iAnio   = Convert.ToInt32(cbAnio.SelectedItem.ToString());
                            int iMes    = cbMes.SelectedIndex + 1;
                            int iDia    = cbdia.SelectedIndex + 1;
                            int iHora   = cbHora.SelectedIndex;
                            int iMinuto = cbMinutos.SelectedIndex;
                            if (!objCZKEM.SetDeviceTime2(1, iAnio, iMes, iDia, iHora, iMinuto, 0))
                            {
                                bBandera = true;
                            }
                            break;

                        case 1:
                            if (!objCZKEM.SetDeviceTime(1))
                            {
                                bBandera = true;
                            }
                            break;
                        }

                        prgb1.Value = 90;
                    }
                }
                panelMensaje.Enabled = true;

                if (bBandera == true)
                {
                    Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Uno o más registros no pudieron ser Enviados. Repetir el proceso");
                }
                else
                {
                    Utilerias.ControlNotificaciones(panelTag, lbMensaje, 1, "Hora Asignada Correctamente.");
                }
                prgb1.Value = 100;
            }
            timer1.Start();
        }
예제 #8
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            //strIncidencia = cbIncidencia.SelectedValue.ToString();

            lblAccion.Text = "       Asignar Tipo Incapacidad";

            Incidencia objIncidencia = new Incidencia();

            objIncidencia.CVIncidencia   = Int32.Parse(cbIncidencia.SelectedValue.ToString());
            objIncidencia.CVTipo         = cvTipo;
            objIncidencia.Descripcion    = txtTipoEditar.Text;
            objIncidencia.Estatus        = "";
            objIncidencia.TipoIncidencia = txtTipoEditar.Text;

            objIncidencia.PrguMod = this.Name;
            objIncidencia.UsuuMod = LoginInfo.IdTrab;
            try
            {
                string Mensaje = "";
                if (strEstatus == "Activo")
                {
                    Mensaje = "¿Seguro que desea dar de BAJA el Registro?";
                }
                else
                {
                    Mensaje = "¿Seguro que desea dar de ALTA el Registro?";
                }

                DataTable response = new DataTable();
                switch (iOpcionAdmin)
                {
                case 3:
                    DialogResult result = MessageBox.Show(Mensaje, this.Name, MessageBoxButtons.YesNo);

                    if (result == DialogResult.Yes)
                    {
                        response = objIncidencia.ObtenerIncidenciaxTipo(objIncidencia, iOpcionAdmin);
                        MostrarNotificacion(response);
                    }
                    break;

                default:
                    response = objIncidencia.ObtenerIncidenciaxTipo(objIncidencia, iOpcionAdmin);
                    MostrarNotificacion(response);

                    break;
                }

                // LlenarComboRepresenta(cbIncidencia, 6);
                LlenarComboTipoIncidencia(cbTipo, "Tipo", "cvtipo", 5);
                LLenarGridIncapacidad(dgvIncidencia, "%", "%");
            }
            catch (Exception ex)
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Error de Comunicación con el Servidor. Intentarlo más tarde.");
                timer1.Start();
            }
        }
예제 #9
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (cbJusficacion.SelectedIndex != 0)
            {
                int       iStDir = 0;
                DataTable dt     = new DataTable();

                if (cbJusficacion.SelectedIndex == 1)
                {
                    iStDir = 0;
                }
                else
                {
                    iStDir = 1;
                }

                try
                {
                    for (int iCont = 0; iCont < ltUsuario.Count; iCont++)
                    {
                        Trab_Fecha      obj      = ltUsuario[iCont];
                        IncCalificacion objCalif = new IncCalificacion();

                        objCalif.fFechaRegistro = obj.fFechaRegistro;
                        objCalif.sIdtrab        = obj.IdTrab.ToString();
                        objCalif.iCvincidencia  = obj.cvincidencia;
                        objCalif.iStDirector    = iStDir;

                        dt = objCalif.ObtenerCalificacionIncidenciaDetalle(objCalif, 13);
                    }
                    ltUsuario.Clear();

                    if (dt.Columns.Contains("UPDATE"))
                    {
                        Utilerias.ControlNotificaciones(panelTag, lbMensaje, 1, "Asignaciones Correctas.");
                        timer1.Start();
                        btnBuscar_Click(sender, e);
                    }
                }
                catch {
                    Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Error de Comunicación. Favor de Intentarlo más tarde.");
                    timer1.Start();
                }
            }
            else
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "No se ha Seleccinado un Tipo de Asignación");
                timer1.Start();
            }

            pnlAsig.Visible   = false;
            ckbheader.Checked = false;
        }
예제 #10
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            strIncidencia = cbIncidencia.SelectedItem.ToString();


            lblAccion.Text = "       Selección";

            Incidencia objIncidencia = new Incidencia();

            //objIncidencia.CVIncidencia = cbIncidencia.SelectedIndex;
            objIncidencia.Descripcion  = strIncidencia;
            objIncidencia.CVRepresenta = cbRepresentaEditar.SelectedIndex;
            objIncidencia.Representa   = cbRepresentaEditar.SelectedItem.ToString();
            objIncidencia.PrguMod      = this.Name;
            // objIncidencia.FhuMod = DateTime.Now;
            objIncidencia.UsuuMod = "vjiturburuv";
            try
            {
                DataTable reponse = objIncidencia.ObtenerRepresentaxIncidencia(objIncidencia, iOpcionAdmin);
                ckbEliminar.Checked = false;
                panelTag.Visible    = true;
                if (iOpcionAdmin == 2)
                {
                    panelTag.BackColor = ColorTranslator.FromHtml("#439047");
                    lbMensaje.Text     = "Cambio Correcto";
                    timer1.Start();
                }
                else if (iOpcionAdmin == 3)
                {
                    panelTag.Visible   = true;
                    panelTag.BackColor = ColorTranslator.FromHtml("#439047");
                    lbMensaje.Text     = "Asignación Eliminada.";
                    timer1.Start();
                }
                else if (iOpcionAdmin == 4)
                {
                    panelTag.Visible   = true;
                    panelTag.BackColor = ColorTranslator.FromHtml("#439047");
                    lbMensaje.Text     = "Registro Completo.";
                    timer1.Start();
                }

                LlenarComboRepresenta(cbIncidencia, 6);


                btnBuscar_Click_1(sender, e);
            }
            catch (Exception ex)
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Error de Comunicación con el Servidor. Intentarlo más tarde.");
                timer1.Start();
            }
        }
예제 #11
0
        private void dgvProceso_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            pass = txtPassword.Text;

            if (Permisos.dcPermisos["Actualizar"] == 1)
            {
                if (dgvUsuario.SelectedRows.Count != 0)
                {
                    if (dgvProceso.SelectedRows.Count != 0)
                    {
                        //check palomeado
                        if (cbAsignaPassword.Checked == true)
                        {
                            if (dgvProceso.SelectedRows.Count != 0)
                            {
                                AsignarProcesos();
                                Utilerias.MultiSeleccionGridViewString(dgvProceso, 1, ltProceso, panelPermisos);
                            }
                        }
                        //checkbox vacio
                        else if (cbAsignaPassword.Checked == false)
                        {
                            DataGridViewRow row = this.dgvProceso.SelectedRows[0];
                            row.Cells[0].Value = Resources.ic_check_circle_green_400_18dp;
                            string cvpro = row.Cells[1].Value.ToString();

                            panelPermisos.Enabled = true;

                            ltProceso.Add(cvpro);

                            if (row.Cells[0].Tag.ToString() == "check")
                            {
                                row.Cells[0].Value = Resources.ic_lens_blue_grey_600_18dp;
                                row.Cells[0].Tag   = "uncheck";
                            }
                            else
                            {
                                row.Cells[0].Value = Resources.ic_check_circle_green_400_18dp;
                                row.Cells[0].Tag   = "check";
                            }
                        }
                    }
                }
                else
                {
                    Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Selecciona primero un Usuario");
                    timer1.Start();
                }
            }
        }
예제 #12
0
        private void CrearAsignacionesPerfil(string sUsuuMod, string sPrguMod)
        {
            Usuario objUsuario = new Usuario();

            foreach (int cv in ltPerfiles)
            {
                objUsuario.AsignarPerfilaUsuario(CVUsuario, cv, 1, sUsuuMod, sPrguMod);
            }

            ltPerfiles.Clear();

            Utilerias.ControlNotificaciones(panelTag, lbMensaje, 1, "Asignaciones Guardadas Correctamente");
            timer1.Start();
            AsignarPerfiles();
        }
예제 #13
0
 //-----------------------------------------------------------------------------------------------
 //                                      C O M B O S
 //-----------------------------------------------------------------------------------------------
 private void cbtiponomina_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (opcperiodo.Checked == true)
         {
             if (Util.p_inicbo == 1)
             {
                 dgvregistros.DataSource = null;
                 Cursor.Current          = Cursors.WaitCursor;
                 Utilerias.ControlNotificaciones(pnlmenssuid, menssuid, 2, "Espere por favor, buscando registros...");
                 fgregistros(6, Int32.Parse(cbtiponomina.SelectedValue.ToString()), 0);
                 Cursor.Current      = Cursors.Default;
                 pnlmenssuid.Visible = false;
             }
         }
         else if (opcempleado.Checked == true)
         {
             if (Util.p_inicbo == 1)
             {
                 //valida se seleccione un periodo
                 if (Int32.Parse(cbtiponomina.SelectedValue.ToString()) == 0)
                 {
                     cbotrab.DataSource = null;
                 }
                 else
                 {
                     //llena empleados
                     Util.p_inicbo = 0;
                     DataTable dttrab = ProcesaInc.cbincrp(13, Int32.Parse(cbtiponomina.SelectedValue.ToString()));
                     Utilerias.llenarComboxDataTable(cbotrab, dttrab, "clave", "descr");
                     Util.p_inicbo = 1;
                 }
                 dgvregistros.DataSource = null;
             }
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
         DialogResult result = MessageBox.Show(ex.Message + ex.StackTrace, "SIPAA");
     }
 }
예제 #14
0
        private void dpFechaFin_ValueChanged(object sender, EventArgs e)
        {
            if (dpFechaInicio.Value > dpFechaFin.Value)
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "La fecha de Inicio no puede ser MAYOR a la de Término");

                timer1.Start();

                dpFechaFin.Value           = dpFechaInicio.Value;
                btnImprimirDetalle.Enabled = false;
                //btnImprimirResumen.Enabled = false;
            }
            else
            {
                btnImprimirDetalle.Enabled = true;
                //btnImprimirResumen.Enabled = true;
            }
        }
예제 #15
0
        private void dgvPerfiles_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (Permisos.dcPermisos["Actualizar"] == 1)
            {
                if (CVUsuario != null)
                {
                    if (dgvPerfiles.SelectedRows.Count != 0)
                    {
                        Utilerias.MultiSeleccionGridView(dgvPerfiles, 1, ltPerfiles, panelPermisos);
                    }
                }

                else
                {
                    Utilerias.ControlNotificaciones(panelTag, lbMensaje, 2, "No se ha Seleccionado un Usuario");
                    timer1.Start();
                }
            }
        }
예제 #16
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            panelPermisos.Enabled = false;
            try
            {
                string UsuuMod = LoginInfo.IdTrab;
                string PrguMod = this.Name;

                FormaReg objFr = new FormaReg();
                LlenarGridPerfil("%", "%", 1);
                AsignarPerfiles();

                if (Utilerias.SinAsignaciones(dgvPerfiles, 0, 1, ltPerfiles) == true)
                {
                    CrearAsignacionesPerfil(UsuuMod, PrguMod);
                }
                else
                {
                    DialogResult result = MessageBox.Show("¿Seguro que desea quitar todas las Asignaciones?", "SIPAA", MessageBoxButtons.YesNo);

                    if (result == DialogResult.Yes)
                    {
                        CrearAsignacionesPerfil(UsuuMod, PrguMod);
                    }
                    else
                    {
                        AsignarPerfiles();
                        panelPermisos.Enabled = false;
                        ltPerfiles.Clear();
                    }
                }
            }
            catch (Exception ex)
            {
                Utilerias.ControlNotificaciones(panelTag, lbMensaje, 3, "Error de Comunicación con el servidor. Favor de Intentarlo más tarde.");
                timer1.Start();
                AsignarPerfiles();
                ltPerfiles.Clear();
            }
        }