Ejemplo n.º 1
0
        private bool?ExecYearWeeks(YearWeeks yearWeeks, DateTime dataAtt, ref string firmaEsecuzione)
        {
            if (yearWeeks == null)
            {
                Log.main.Add(new Mess(LogType.Warn, Log.main.warnUserText, "oggetto yearWeeks a null ma isYearWeeksEnabled a true"));
                return(null);
            }
            if (yearWeeks.Count == 0)
            {
                return(null);
            }

            Calendar calendario = DateTimeFormatInfo.CurrentInfo.Calendar;

            var nrSettimana = calendario.GetWeekOfYear(dataAtt, DateTimeFormatInfo.CurrentInfo.CalendarWeekRule, (DayOfWeek)WeekStartsDay);

            if ((from tmp in yearWeeks where tmp.Week == nrSettimana select tmp).Count() == 0)
            {
                return(false);
            }

            //if (yearWeeks.Contains(nrSettimana) == false) return false;
            firmaEsecuzione += "nrSettDellAnno:" + nrSettimana + "|";

            return(true);
        }
Ejemplo n.º 2
0
        private bool?ExecYearWeeks(YearWeeks yearWeeks, DateTime dataAtt)
        {
            string tmp = "";

            return(ExecYearWeeks(yearWeeks, dataAtt, ref tmp));
        }
Ejemplo n.º 3
0
        //Public Sub New() 'Questo costruttore serve per fare un nuovo ogg prima del deserializzatore?
        //End Sub

        /// <summary>
        /// </summary>
        /// <param name="periodicCycle">Se valorizzato verrà eseguita non più di una volta ogni unità di periodicita, es perdiocità settimanale = al massimo 1 volta a settimana</param>
        /// <param name="intervalloVerificaMs">Se 0 non verrà scatenato l'evento "Esegui" in automatico ma si dovrà richiamare il metodo Eseguibile per sapere se si ha il permesso dello scheduler</param>
        public SchedulerM(Periodicity periodicCycle = null, HourlyPeriods hourlyPeriods = null, WeekDays weekDays               = null, MonthsAndDays monthsAndDays = null, YearWeeks yearWeeks = null,
                          YearDays yearDays         = null, WeekDay weekStartsDay = WeekDay.Monday, UInt32 intervalloVerificaMs = 0)
        {
            //Creo gli oggetti per far in modo che i vari dataGrid abbiano gli oggetti su cui fare il binding
            this.PeriodicCycle   = periodicCycle;
            this.HourlyPeriods   = hourlyPeriods;
            this.WeekDays        = weekDays;
            this.MonthsAndDays   = monthsAndDays;
            this.YearWeeks       = yearWeeks;
            this.YearDays        = yearDays;
            this.WeekStartsDay   = weekStartsDay;
            this.CheckIntervalMs = intervalloVerificaMs;

            this.lastTimeExec          = DateTime.MinValue;
            this.firmeUltimeEsecuzione = new List <Tuple <DateTime, String> >();

            tmrCheckIfExecutable.Elapsed += TmrCheckIfExecutable_Elapsed;
        }