private bool ValidarHora() { lcr = new LogicConfigRutinas(); DateTime horaInicio; DateTime horaFin; try { if (!lcr.GetEstadoRango()) //Si no está activado el rango de horario devuelvo true. { return(true); } horaInicio = DateTime.ParseExact(lcr.GetHoraInicioRango(), "HH:mm", CultureInfo.CurrentCulture); horaFin = DateTime.ParseExact(lcr.GetHoraFinRango(), "HH:mm", CultureInfo.CurrentCulture); if (horaInicio < DateTime.Now && horaFin > DateTime.Now) { return(true); } else { return(false); } } catch (AppException appex) { InformarError(appex.Message, "Ejecución de rutinas."); return(false); } catch (Exception ex) { InformarError(ex.Message, "Ejecución de rutinas."); return(false); } }
public override void LoadConfigs() { lcr = new LogicConfigRutinas(); try { // RECUPERO DESDE EL REGISTRO EL INICIO CON WINDOWS // if (rkApp.GetValue("SaftComm") == null) { chckIniciarWindows.Checked = false; } else { chckIniciarWindows.Checked = true; } // HASTA ACA // chckFicheroCopia.Checked = lcr.IsFicheroCopia(); // RUTINAS // chckBorrarRegs.Checked = lcr.IsBorradoRegs(); chckEjecutarRutina.Checked = lcr.IsDescarga(); chckActivarHora.Checked = lcr.GetEstadoRutinaHs(); chckActivarHorario.Checked = lcr.GetEstadoRango(); chckActivarRegs.Checked = lcr.GetEstadoRutinaRegs(); txtMinutosHora.Text = lcr.GetIntervaloHs(); txtMinutosRegs.Text = lcr.GetIntervaloRegs(); txtHoraFin.Text = lcr.GetHoraFinRango(); txtHoraInicio.Text = lcr.GetHoraInicioRango(); } catch (AppException appex) { base.InformarError(appex.Message, "Cargar Formatos."); } }