private async void Go_Detail(object sender, SelectionChangedEventArgs e) { ListBox box = (ListBox)sender; if (box.SelectedIndex != -1) { ISpot geselecteerd = (ISpot)box.SelectedItem; //ophalen details btnSearch.Visibility = Visibility.Collapsed; prDetails.Visibility = Visibility.Visible; prDetails.IsActive = true; try { await dao.AddDetails(geselecteerd); prDetails.IsActive = false; prDetails.Visibility = Visibility.Collapsed; btnSearch.Visibility = Visibility.Visible; Frame.Navigate(typeof(Detail), geselecteerd); } catch (Exception ex) { prDetails.IsActive = false; prDetails.Visibility = Visibility.Collapsed; btnSearch.Visibility = Visibility.Visible; ErrorInternet(); } } }
public IBusiness GetBusinessWithSpot(ISpot spot) { var location = _locationRepository.GetWithId(spot.LocationId); var business = _businessRepository.GetWithId(location.BusinessId); return(business); }
public BusinessFeatureEventViewModel(IEvent @event, ILocation location, ISpot spot) { MongoId = @event.MongoId; Title = @event.Title; StartTime = @event.StartDateTime.ToLocalTime().ToString(DateService.GetBasicDateTimeFormat); FullAddress = location.FullAddress; SpotId = spot.MongoId; SpotName = spot.Name; Invited = @event.Invited.Count; }
public void LogAction(string action, ISpot s) { string log = $"{DateTime.Now.ToString("yyyy-dd-mm HH:mm:ss.ffffff")} |"; log += $" { action.PadRight(10)}"; log += $" { s.Call.PadRight(10)}"; log += $" on { s.Band.ToString().PadRight(17)}"; log += $" (Freq { s.Frequency.ToString("0.00").PadLeft(8)})"; ActionLog.Add(log); }
public BusinessFacade(IBusiness business, IGroup group, ILocation location, ISpot spot, ISpotUser user, IEvent @event, IBusinessResponse response, IAtomicBusinessWork atomicBusinessWork, IExceptionLogFacade exceptionLogFacade) { _business = business; _group = group; _location = location; _spot = spot; _user = user; _event = @event; _response = response; _atomicWork = atomicBusinessWork; _exceptionLogFacade = exceptionLogFacade; }
public bool IsSpotOccupied(ISpot spot, BsonDateTime starDateTime, BsonDateTime endDateTime) { var events = _eventRepository.GetEventsBySpotId(spot.Id); foreach (var @event in events) { if (IsThereOverlapping(@event, starDateTime, endDateTime)) { return(true); } } return(false); }
public IResponse GetCreateSpotResponse(ISpot model) { try { model.Id = ObjectId.GenerateNewId(); _spotWork.Add(model); _response.HasSucceeded("Spot was created successfully."); return(_response); } catch { _response.HasFailed("We apologize, spot could not be created."); return(_response); } }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { ISpot s = (ISpot)e.Parameter; current_spot = s; //instellen van de juiste gegevens if (s.Description != null) { TxtDiscription.Text = s.Description; } else { TxtDiscription.Text = "No Description found"; } DetailsPivot.Title = s.Naam; if (s.ImgLink != null) { try { ImgDetail.Source = new BitmapImage(new Uri(s.ImgLink)); } catch (Exception ex) { } } txtSummuray.Text = s.Summary; //instellen Contact Set_Contact(); Set_AddVisits(); Geopoint p = new Geopoint(new BasicGeoposition() { Latitude = current_spot.Latitude, Longitude = current_spot.Longitude }); Set_Map(p, current_spot.Naam); show_imgs(); }
public void Add(ISpot spot) { try { Lock(); _spotRepository.Add(spot); _locationRepository.AddSpot(spot.Id, spot.LocationId); } catch (Exception) { //TODO: Rollback logic throw new Exception("Failed to perform atomic action - " + Desc); } finally { Unlock(); } }
public WaitingArea(string input) { _permutations = new HashSet <string>(); var lines = input.SplitLines().ToList(); Height = lines.Count; Width = lines.First().Length; Grid = new ISpot[Height, Width]; for (var row = 0; row < Height; row++) { for (var col = 0; col < Width; col++) { Grid[row, col] = lines[row][col] switch { 'L' => new Seat(row, col), _ => new Floor() }; } } }
public Line(ISpot FirstSpot, ISpot SecondSpot, ISpot ThirdSpot) { Spot0 = new Spot(FirstSpot); Spot1 = new Spot(SecondSpot); Spot2 = new Spot(ThirdSpot); }
public Line(int FirstSpotValue, int SecondSpotValue, int ThirdSpotValue) { Spot0 = new Spot(FirstSpotValue); Spot1 = new Spot(SecondSpotValue); Spot2 = new Spot(ThirdSpotValue); }
public void Add(ISpot spot) { MongoContext.Collection.InsertOne(spot as Models.Spot.Spot); }
public void RemoveVisits(ISpot s) { s.IsVisists = false; }
public void AddVisits(ISpot s) { s.IsVisists = true; }
//hier niet nodig public void AddDetails(ISpot spot) { }
Task ISpotDAO.AddDetails(ISpot spot) { throw new NotImplementedException(); }
public bool IsSpotAvaible(BsonDateTime starDateTime, BsonDateTime endDateTime, ISpot spot) { if (starDateTime.ToLocalTime().Day == endDateTime.ToLocalTime().Day) { foreach (var daylyAvailableHour in spot.DaylyAvailableHours[starDateTime.ToLocalTime().ToString("dddd", new CultureInfo("en-US"))] ) { if (daylyAvailableHour.From.ToLocalTime().TimeOfDay <= starDateTime.ToLocalTime().TimeOfDay&& daylyAvailableHour.To.ToLocalTime().TimeOfDay >= endDateTime.ToLocalTime().TimeOfDay) { return(true); } } } else { foreach (var timeInterval in spot.DaylyAvailableHours[starDateTime.ToLocalTime().ToString("dddd", new CultureInfo("en-US"))]) { var date = starDateTime.ToLocalTime().AddDays(1); var mid = new DateTime(date.Year, date.Month, date.Day, 0, 0, 0); if (timeInterval.From.ToLocalTime().TimeOfDay > starDateTime.ToLocalTime().TimeOfDay || timeInterval.To.ToLocalTime().TimeOfDay != mid.TimeOfDay) { continue; } //check second day foreach (var interval in spot.DaylyAvailableHours[endDateTime.ToLocalTime().ToString("dddd", new CultureInfo("en-US"))]) { if (interval.From.ToLocalTime().TimeOfDay.Equals(mid.TimeOfDay) && interval.To.ToLocalTime().TimeOfDay >= endDateTime.ToLocalTime().TimeOfDay) { return(true); } } } } return(false); }
public bool IsSpotVisible(ISpot spot) { return(spot.Visible); }
public TimelineEventViewModel(ISpotUser user, IEvent myEvent, IUserEvent userEvent, ISpot spot, ILocation location, IBusiness business) { UserId = user.Id; EventId = myEvent.Id; SpotId = spot.Id; LocationId = location.Id; BusinessId = business.Id; FirstName = user.FirstName; EventTitle = myEvent.Title; EventStart = myEvent.StartDateTime.ToLocalTime().ToString(DateService.GetBasicDateTimeFormat); Joined = DateService.GetRelativeSpan(userEvent.Joined.ToUniversalTime() .ToString(DateService.GetBasicDateTimeFormat)); SpotName = spot.Name; Address = location.Address; City = location.City; Zip = location.Zip; Country = location.Country; BusinessName = business.Name; }
public Spot(ISpot newSpot) { this.Type = newSpot.Type; this.Position = newSpot.Position; }
public void DeleteSpot(ISpot spot) { Spots.RemoveAll(x => x.Call == spot.Call && x.Band == spot.Band); }