Ejemplo n.º 1
0
        private static void CheckForReservations()
        {
            var user = new User("mircea.nistor", "Mircea Nistor", "*****@*****.**");

            var reservation = new Reservation(user, "Daily LPL Meeting", new DateTime(2013, 9, 13), new DateTime(2013, 9, 13).AddHours(1));
            reservation.AddParticipant(user);
            NotificationEmail.Send(reservation);
        }
Ejemplo n.º 2
0
        public Comment(User user, string comment)
        {
            Check.NotNull(user, "user");
            Check.NotEmpty(comment, "comment");

            this.By = user;
            this.Says = comment;
            this.Timestamp = DateTime.Now;
        }
Ejemplo n.º 3
0
        //public Reservation(User requestedBy, string title, DateTime startsAt, DateTime endsAt)
        //    : this(requestedBy, title, startsAt, endsAt, null) { }
        public Reservation(User requestedBy, string title, DateTime startsAt, DateTime endsAt)
        {
            Check.NotNull(requestedBy, "requestedBy");
            Check.NotEmpty(title, "title");
            Check.NotEmpty(startsAt, "startsAt");
            Check.NotEmpty(endsAt, "endsAt");
            Check.Condition(endsAt > startsAt, "Start time must be prior to end time");

            this.RequestedBy = requestedBy;
            this.Title = title;
            this.StartsAt = startsAt;
            this.EndsAt = endsAt;
            this.LastsFor = endsAt - startsAt;
        }
Ejemplo n.º 4
0
 public void AddParticipant(User participant)
 {
     Check.NotNull(participant, "participant");
     participants.Add(participant);
 }
Ejemplo n.º 5
0
 public void AddComment(User by, string comment)
 {
     Check.NotNull(by, "by");
     Check.NotEmpty(comment, "comment");
     comments.Add(new Comment(by, comment));
 }
Ejemplo n.º 6
0
 public bool Authenticate(Guid token, out User authenticatedUser)
 {
     authenticatedUser = store.Load(token) as User;
     return authenticatedUser != null;
 }