Solvberget.Domain.DTO.UserInfo.GetNotification C# (CSharp) Method

GetNotification() private method

private GetNotification ( UserInfo user ) : IEnumerable
user UserInfo
return IEnumerable
        private IEnumerable<Notification> GetNotification(UserInfo user)
        {
            var notifications = new List<Notification>();

            if (user.Loans != null)
            {
                foreach (var loan in user.Loans)
                {
                    var day = Convert.ToInt32(loan.DueDate.Substring(0, 2));
                    var month = Convert.ToInt32(loan.DueDate.Substring(3, 2));
                    var year = Convert.ToInt32(loan.DueDate.Substring(6, 4));

                    var dueDate = new DateTime(year, month, day);
                    var today = DateTime.Now;

                    TimeSpan span = dueDate.Subtract(today);
                    var timeLeft = span.Days;

                    if (timeLeft > 0 && timeLeft < 4)
                    {
                        notifications.Add(new Notification
                                              {
                                                  Type = "Loan",
                                                  Title = loan.DocumentTitle + " forfaller snart",
                                                  DocumentTitle = loan.DocumentTitle,
                                                  Content =
                                                      "Lånet forfaller om mindre enn " + timeLeft +
                                                      " dager. Lever eller forny " +
                                                      "lånet for å unngå å få gebyr."
                                              });
                    }
                    else if (timeLeft == 0)
                    {
                        notifications.Add(new Notification
                                              {
                                                  Type = "Loan",
                                                  Title = loan.DocumentTitle + " forfaller snart",
                                                  DocumentTitle = loan.DocumentTitle,
                                                  Content = "Lånet forfaller om mindre ett døgn. Lever eller forny " +
                                                            "lånet for å unngå å få gebyr."
                                              });
                    }
                    else if (timeLeft < 0)
                    {
                        notifications.Add(new Notification
                                              {
                                                  Type = "Fine",
                                                  Title = loan.DocumentTitle + " skulle vært levert",
                                                  DocumentTitle = loan.DocumentTitle,
                                                  Content =
                                                      "Lånet har forfalt. Ved å fornye eller levere tilbake innen forfallsdato unngår du gebyr."
                                              });

                    }

                }

            }

            if (user.Reservations != null)
            {
                foreach (var reservation in user.Reservations)
                {
                    if (reservation.HoldRequestEnd != "")
                    {
                        notifications.Add(new Notification
                                              {
                                                  Type = "Reservation",
                                                  Title = reservation.DocumentTitle + " er klar til henting.",
                                                  DocumentTitle = reservation.DocumentTitle,
                                                  Content = "Den kan hentes på " + reservation.PickupLocation + " innen " + reservation.HoldRequestEnd,
                                              });
                    }
                }
            }

            return notifications;
        }