Exemple #1
0
        public void Fire(string eventName)
        {
            var userEvent = UserEvents.SingleOrDefault(e => e.Name == eventName);

            if (userEvent == null)
            {
                userEvent = new UserEvent {
                    Name = eventName
                };
                userEvent.Occurrrences.Add(DateTime.Now);

                UserEvents.Add(userEvent);
            }
            else
            {
                userEvent.Occurrrences.Add(DateTime.Now);
            }
        }
Exemple #2
0
        public void AddUserEvent(int eventType, System.Security.Claims.ClaimsPrincipal user, string searchText = "", string searchResults = "", int movieID = 0)
        {
            if (eventType == 0)
            {
                UserEvents.Add(new UserEvent
                {
                    UserName     = user.FindFirst(System.Security.Claims.ClaimTypes.Name).Value,
                    SearchTerms  = searchText,
                    SearchResult = searchResults,
                    EventDate    = System.DateTime.Now
                });
            }
            if (eventType == 1)
            {
                UserEvents.Add(new UserEvent
                {
                    UserName    = user.FindFirst(System.Security.Claims.ClaimTypes.Name).Value,
                    MovieRental = movieID,
                    EventDate   = System.DateTime.Now
                });
            }

            SaveChanges();
        }
Exemple #3
0
 protected void AddEvent(UserEventType userEventType)
 {
     UserEvents.Add(new UserEvent(this, userEventType));
 }