Ejemplo n.º 1
0
        public static int DeleteLocation(int id)
        {
            var db = ApplicationContext.Current.DatabaseContext.Database;
            var location = GetLocation(id);

            var args = new LocationDeletionEventArgs { Location = location };
            OnDeleting(args);

            if (args.Cancel)
            {
                return id;
            }

            var response = db.Delete<EventLocation>(id);

            var args2 = new LocationDeletedEventArgs { Location = location };
            OnDeleted(args2);

            return response;
        }
Ejemplo n.º 2
0
 public static void OnDeleting(LocationDeletionEventArgs e)
 {
     EventHandler<LocationDeletionEventArgs> handler = Deleting;
     if (handler != null)
     {
         handler(null, e);
     }
 }