Beispiel #1
0
        public static void Test_SpecialDays_01()
        {
            string logFile = zPath.Combine(XmlConfig.CurrentConfig.GetExplicit("DataDir"), @"control\ctrl_SpecialDays_01.txt");

            Trace.WriteLine("write to file \"{0}\"", logFile);
            //Trace.CurrentTrace.AddTraceFile(logFile, LogOptions.RazLogFile);
            Trace.CurrentTrace.AddOnWrite("Print_Exe", WriteToFile.Create(logFile, FileOption.RazFile).Write);

            //_wr.DisableMessage = true;
            CultureInfo culture = new CultureInfo("fr-FR");

            Trace.WriteLine("Mardi gras          Dimanche des        Dimanche de         Jeudi de            Dimanche de");
            Trace.WriteLine("                    Rameaux             Pâques              l'Ascension         Pentecôte");
            for (int year = 2013; year <= 2035; year++)
            {
                Date   dateMardiGras       = SpecialDayTools.GetMardiGrasDate(year);
                string dateMardiGrasString = string.Format(culture, "{0:dd}  {0,-7:MMMM} {0:yyyy}", dateMardiGras);

                Date   datePalmSunday       = SpecialDayTools.GetPalmSundayDate(year);
                string datePalmSundayString = string.Format(culture, "{0:dd}  {0,-7:MMMM} {0:yyyy}", datePalmSunday);

                Date   dateEasterSunday       = SpecialDayTools.GetEasterSundayDate(year);
                string dateEasterSundayString = string.Format(culture, "{0:dd}  {0,-7:MMMM} {0:yyyy}", dateEasterSunday);

                Date   dateAscensionThursday       = SpecialDayTools.GetAscensionThursdayDate(year);
                string dateAscensionThursdayString = string.Format(culture, "{0:dd}  {0,-7:MMMM} {0:yyyy}", dateAscensionThursday);

                Date   datePentecostSunday       = SpecialDayTools.GetPentecostSundayDate(year);
                string datePentecostSundayString = string.Format(culture, "{0:dd}  {0,-7:MMMM} {0:yyyy}", datePentecostSunday);

                Trace.WriteLine("{0}    {1}    {2}    {3}    {4}", dateMardiGrasString, datePalmSundayString, dateEasterSundayString, dateAscensionThursdayString, datePentecostSundayString);
            }
            //_wr.DisableMessage = false;
            //Trace.CurrentTrace.RemoveTraceFile(logFile);
            Trace.CurrentTrace.RemoveOnWrite("Print_Exe");
        }
Beispiel #2
0
 public static bool PrintExists(Date date)
 {
     // La croix - 2013-05-02 - no 39571.pdf
     // pas de journal le dimanche, pas de journal le 1er mai, le 8 mai, lundi de pentecote
     if (date.DayOfWeek != DayOfWeek.Sunday && (date.Month != 5 || date.Day != 1) && (date.Month != 5 || date.Day != 8) && date != SpecialDayTools.GetAscensionThursdayDate(date.Year) &&
         date != SpecialDayTools.GetPentecostMondayDate(date.Year))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }