Beispiel #1
0
		public static bool CanBeConnectedToStatic(Model.Entities.ObjectType o)
		{
			if (o.Equals(Model.Entities.ObjectType.Venue) ||
				o.Equals(Model.Entities.ObjectType.Brand))
				return true;

			if (Brand.CanBeConnectedToStatic(o))
				return true;

			if (Venue.CanBeConnectedToStatic(o))
				return true;

			return false;
		}
Beispiel #2
0
		public bool IsConnectedTo(Model.Entities.ObjectType objectType, int objectK)
		{
			if (objectType.Equals(Model.Entities.ObjectType.Event) && this.K == objectK)
				return true;

			if (objectType.Equals(Model.Entities.ObjectType.Venue) && this.VenueK == objectK)
				return true;

			bool brandCanBeConnected = Brand.CanBeConnectedToStatic(objectType);
			if (objectType.Equals(Model.Entities.ObjectType.Brand) || brandCanBeConnected)
			{
				foreach (Brand b in this.Brands)
				{
					if (objectType.Equals(Model.Entities.ObjectType.Brand) && b.K == objectK)
						return true;

					if (brandCanBeConnected && b.IsConnectedTo(objectType, objectK))
						return true;
				}
			}

			if (Venue.CanBeConnectedToStatic(objectType) && this.Venue.IsConnectedTo(objectType, objectK))
				return true;

			return false;

		}