Ejemplo n.º 1
0
        public static EventLocation CreateLocation(EventLocation location, int creator)
        {
            var db = ApplicationContext.Current.DatabaseContext.Database;

            var args = new LocationCreatingEventArgs {
                Location = location
            };

            OnCreating(args);

            if (args.Cancel)
            {
                return(location);
            }

            db.Save(location);

            //Update usersettings and add the newly created calendar to the allowed calendar
            SecurityService.AddLocationToUser(creator, location.Id);

            var args2 = new LocationCreatedEventArgs {
                Location = location
            };

            OnCreated(args2);

            return(location);
        }
Ejemplo n.º 2
0
        public static void OnCreated(LocationCreatedEventArgs e)
        {
            EventHandler <LocationCreatedEventArgs> handler = Created;

            if (handler != null)
            {
                handler(null, e);
            }
        }