Beispiel #1
0
        private void PrayerForDate(DateTime date)
        {
            PrayerModel prayerModel = FreshIOC.Container.Resolve <IPrayerModel>() as PrayerModel;
            string      htmlText    = prayerModel.MakePrayer(date, true);

            WriteFile("Prayer", date, date, htmlText);
        }
        public void DisplayPrayer(DateTime date)
        {
#if DEBUG
            //_testMode = true;
#endif
            string prayerHtml = _prayerModel.MakePrayer(date, _testMode);
            DisplayOnScreen(prayerHtml);
        }
Beispiel #3
0
        public string MakePrayers(PrayerModel prayerModel, DateTime startDate, DateTime endDate, PrayerSeason.PrayerSect prayerSect, bool headingsOnly = false)
        {
            Debug.WriteLine($"PrayerModel.MakeTestPrayer( {startDate.ToString()}, {endDate.ToString()}, {prayerSect.ToString()} )");

            string             htmlText  = "";
            DateTime           date      = startDate;
            SortedSet <string> NotFounds = new SortedSet <string>();

            try
            {
                while (date <= endDate)
                {
                    htmlText += (prayerSect == PrayerSeason.PrayerSect.AllSections) ?
                                prayerModel.MakePrayer(date, true, headingsOnly) :
                                prayerModel.MakePrayerSection(date, prayerSect);
                    if (prayerModel.NotFounds.Count > 0)
                    {
                        NotFounds.UnionWith(prayerModel.NotFounds);
                    }

                    date = date.AddHours(12);
                }
            }
            catch (Exception ex)
            {
                htmlText += string.Format($"<p>Error : {ex.Message}<p>on {date.ToString()}");
            }

            if (NotFounds.Count > 0)
            {
                string notFounds = "<big>Not founds:</big><br/>";
                foreach (string filename in NotFounds)
                {
                    notFounds += filename + "<br/>";
                }
                htmlText = notFounds + "<p/>" + htmlText;
            }

            return(htmlText);
        }