コード例 #1
0
 private static bool HasSameSettingEntry(Kavuah a, Kavuah b)
 {
     return(a != b &&
            Onah.IsSameOnahPeriod(a.SettingOnah, b.SettingOnah));
 }
コード例 #2
0
        public string GetNextOnahText()
        {
            string nextProblemText = "";

            if (this.ProblemOnahList.Count > 0)
            {
                //We need to determine the earliest problem Onah, so we need to do a
                //special sort on the list where the night Onah is before the day one for the same date.
                this.ProblemOnahList.Sort(Onah.CompareOnahs);

                Onah nowProblem  = this.ProblemOnahList.FirstOrDefault(o => (!o.IsIgnored) && Onah.IsSameOnahPeriod(o, this.NowOnah));
                Onah nextProblem = this.ProblemOnahList.FirstOrDefault(o => (!o.IsIgnored) && (Onah.CompareOnahs(o, this.NowOnah) == 1));

                if (nowProblem != null)
                {
                    nextProblemText += "עכשיו הוא " + nowProblem.Name;
                }

                if (nextProblem != null)
                {
                    if (nextProblemText.Length > 0)
                    {
                        nextProblemText += " - ";
                    }
                    nextProblemText += "העונה הבאה בעוד " +
                                       ((nextProblem.DateTime - this.Today).Days + 1).ToString() +
                                       " ימים - בתאריך: " +
                                       nextProblem.DateTime.ToString("dd MMMM yyyy") +
                                       " (" +
                                       nextProblem.HebrewDayNight +
                                       ") שהוא " +
                                       nextProblem.Name;
                }
            }
            return(nextProblemText);
        }