コード例 #1
0
        public void RateUser(string userToRateId, string fromUserId, int rating, TripNotification tripNotification)
        {
            Rating ratingToBeSaved = new Rating()
            {
                RatedUserId = userToRateId,
                FromUserId = fromUserId,
                Value = rating,
            };

            this.ratingRepos.Add(ratingToBeSaved);
            this.ratingRepos.Save();

            this.tipNotificationServices.SetTripFinishActionHasBeenTakenToTrue(tripNotification);
        }
コード例 #2
0
        public TripNotification Create(
            int tripId,
            string fromUserId,
            string forUserId,
            string title,
            string message,
            NotificationKey keyType,
            DateTime dueTo)
        {
            NotificationType type = this.notificationTypeRepos
                .All()
                .Where(t => t.Key == keyType)
                .FirstOrDefault();

            if (type == null)
            {
                throw new Exception("No such type, given key type " + keyType);
            }

            TripNotification tripNotification = new TripNotification()
            {
                TripId = tripId,
                FromUserId = fromUserId,
                ForUserId = forUserId,
                Title = title,
                Message = message,
                Seen = false,
                AvailableAfter = DateTime.Now,
                DueTo = dueTo,
                Type = type
            };

            this.tripNotificationRepos.Add(tripNotification);
            this.tripNotificationRepos.Save();
            return tripNotification;
        }
コード例 #3
0
 public void SetTripFinishActionHasBeenTakenToTrue(TripNotification tripNotification)
 {
     tripNotification.ActionHasBeenTaken = true;
     this.tripNotificationRepos.Save();
 }