Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Metodo para buscar todos los registros en el reloj local
- public void BuscarChecadasReloj()
- {
- try
- {
- dtChecadasReloj = objRelojChecador.RegistrosPersonal();
- if (dtChecadasReloj.Rows.Count != 0)
- {
- foreach (DataRow drChecadasReloj in dtChecadasReloj.Rows)
- {
- CNumeroEmpleado = Convert.ToInt32(drChecadasReloj[0]);
- CNombreEmpleado = Convert.ToString(drChecadasReloj[1]);
- CTipoChecada = Convert.ToString(drChecadasReloj[2]);
- CHoraChecada = Convert.ToString(drChecadasReloj[3]);
- CFechaChecada = Convert.ToString(drChecadasReloj[4]);
- CEstatus = "PENDIENTE";
- for (int i = 0; i <= dtChecadasReloj.Rows.Count; i++)
- {
- BuscarChecadasIntelisis();
- }
- }
- }
- }
- catch (Exception ex)
- {
- ex.ToString();
- }
- }
- //Método para buscar registros en SQL-Server
- public void BuscarChecadasIntelisis()
- {
- try
- {
- if (dtChecadasReloj.Rows.Count!=0)
- {
- dtChecadasIntelisis = objCosmetica.ChecadasPersonal(CNumeroEmpleado, CNombreEmpleado, CTipoChecada, CHoraChecada, CFechaChecada, CEstatus);
- }
- if (dtChecadasIntelisis.Rows.Count != 0)
- {
- foreach (DataRow drChecadasIntelisis in dtChecadasIntelisis.Rows)
- {
- INumeroEmpleado = Convert.ToInt32(drChecadasIntelisis[0]);
- INombreEmpleado = Convert.ToString(drChecadasIntelisis[1]);
- ITipoChecada = Convert.ToString(drChecadasIntelisis[2]);
- IHoraChecada = Convert.ToString(drChecadasIntelisis[3]);
- IFechaChecada = Convert.ToString(drChecadasIntelisis[4]);
- IEstatus = Convert.ToString(drChecadasIntelisis[5]);
- if (INumeroEmpleado != 0 && INombreEmpleado != "" && ITipoChecada != "" && IHoraChecada != "" && IFechaChecada != "" && IEstatus != "")
- {
- for (int i = 0; i <= dtChecadasReloj.Rows.Count; i++)
- {
- if (INumeroEmpleado == CNumeroEmpleado && INombreEmpleado == CNombreEmpleado && ITipoChecada == CTipoChecada && IHoraChecada == CHoraChecada && IFechaChecada == CFechaChecada && IEstatus == CEstatus)
- {
- RegistradoIntelisis = true;
- ProcesarChecadas();
- }
- else
- {
- GuardarRegistroIntelisis = true;
- ProcesarChecadas();
- }
- }
- }
- else
- {
- GuardarRegistroIntelisis = true;
- ProcesarChecadas();
- }
- }
- }
- else
- {
- GuardarRegistroIntelisis = true;
- ProcesarChecadas();
- }
- }
- catch (Exception ex)
- {
- ex.ToString();
- }
- }
- //Método para insertar registros del reloj en SQL-Server
- public void ProcesarChecadas()
- {
- try
- {
- if (RegistradoIntelisis)
- {
- objValidaciones.MostrarAviso("Todos los registros se encuentran actualizados en la base de datos", true, lblAviso);
- BuscarChecadasIntelisis();
- }
- if (GuardarRegistroIntelisis)
- {
- objCosmetica.InsertarAsistencias(CNumeroEmpleado, CNombreEmpleado, CTipoChecada, CHoraChecada, CFechaChecada, CEstatus);
- RegistradoIntelisis = true;
- BuscarChecadasReloj();
- }
- }
- catch (Exception ex)
- {
- ex.ToString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement