Example #1
0
        public bool IsGolfAvailable(Golf golf, DateTime startTime, DateTime endTime)
        {
            var isMainGolfBooked = BookedGolfs.Where(x => !x.EventGolf.Event.IsDeleted && x.Golf == golf).Any(x => IsDateBetweenAnotherTwo(startTime, endTime, x.TimeEx)
                || IsDateBetweenAnotherTwo(x.TimeEx, x.EndTimeEx, startTime) || IsDateBetweenAnotherTwo(x.TimeEx, x.EndTimeEx, endTime.Add(new TimeSpan(0, 0, -1, 0)))
                || IsDateBetweenAnotherTwo(startTime, endTime, x.EndTimeEx.Add(new TimeSpan(0, 0, -1, 0))));

            return !isMainGolfBooked;
        }
Example #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Golfs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGolfs(Golf golf)
 {
     base.AddObject("Golfs", golf);
 }
Example #3
0
 /// <summary>
 /// Create a new Golf object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="color">Initial value of the Color property.</param>
 /// <param name="hasNineHoles">Initial value of the HasNineHoles property.</param>
 /// <param name="hasEighteenHoles">Initial value of the HasEighteenHoles property.</param>
 /// <param name="turnTime">Initial value of the TurnTime property.</param>
 /// <param name="isBuggiesAvailable">Initial value of the IsBuggiesAvailable property.</param>
 /// <param name="nineHolesTime">Initial value of the NineHolesTime property.</param>
 /// <param name="eighteenHolesTime">Initial value of the EighteenHolesTime property.</param>
 /// <param name="isEnabled">Initial value of the IsEnabled property.</param>
 /// <param name="includeInForwardBook">Initial value of the IncludeInForwardBook property.</param>
 /// <param name="allowOnlineBooking">Initial value of the AllowOnlineBooking property.</param>
 /// <param name="adminAuthorisation">Initial value of the AdminAuthorisation property.</param>
 /// <param name="startTime">Initial value of the StartTime property.</param>
 /// <param name="endTime">Initial value of the EndTime property.</param>
 /// <param name="timeInterval">Initial value of the TimeInterval property.</param>
 public static Golf CreateGolf(global::System.Guid id, global::System.String name, global::System.String color, global::System.Boolean hasNineHoles, global::System.Boolean hasEighteenHoles, global::System.TimeSpan turnTime, global::System.Boolean isBuggiesAvailable, global::System.TimeSpan nineHolesTime, global::System.TimeSpan eighteenHolesTime, global::System.Boolean isEnabled, global::System.Boolean includeInForwardBook, global::System.Boolean allowOnlineBooking, global::System.Boolean adminAuthorisation, global::System.TimeSpan startTime, global::System.TimeSpan endTime, global::System.TimeSpan timeInterval)
 {
     Golf golf = new Golf();
     golf.ID = id;
     golf.Name = name;
     golf.Color = color;
     golf.HasNineHoles = hasNineHoles;
     golf.HasEighteenHoles = hasEighteenHoles;
     golf.TurnTime = turnTime;
     golf.IsBuggiesAvailable = isBuggiesAvailable;
     golf.NineHolesTime = nineHolesTime;
     golf.EighteenHolesTime = eighteenHolesTime;
     golf.IsEnabled = isEnabled;
     golf.IncludeInForwardBook = includeInForwardBook;
     golf.AllowOnlineBooking = allowOnlineBooking;
     golf.AdminAuthorisation = adminAuthorisation;
     golf.StartTime = startTime;
     golf.EndTime = endTime;
     golf.TimeInterval = timeInterval;
     return golf;
 }
Example #4
0
        public EventGolfModel(EventGolf golf)
        {
            EventGolf = golf;
            EventBookedProducts = new ObservableCollection<EventBookedProductModel>();

            _golfHole = EventGolf.GolfHole;
            _golf = EventGolf.Golf;

        }
Example #5
0
 public GolfModel(Golf golf)
 {
     _golf = golf;
 }
Example #6
0
        public bool IsGolfAvailable(Golf golf, DateTime time)
        {
            var isGolfBooked = BookedGolfs.Where(x => !x.EventGolf.Event.IsDeleted && x.Golf == golf).Any(x => IsDateBetweenAnotherTwo(x.TimeEx, x.EndTimeEx, time));

            return !isGolfBooked;
        }