public PasseggeroStatusChanger(Popup containerPopup, Spostamento partecipante, Geoposition location) { this.InitializeComponent(); this.containerPopup = containerPopup; this.partecipante = partecipante; this.location = location; dbMan = new DBManager(); }
public SpostamentoDTO New(SpostamentoDTO DTO) { using (CaronteContext caronteCtx = new CaronteContext()) { Spostamento tmp = DTO.ToEntity(); caronteCtx.Spostamento.Add(tmp); caronteCtx.SaveChanges(); return(this.Get(tmp.IDSpostamento)); } }
public SpostamentoDTO Update(SpostamentoDTO DTO) { using (CaronteContext caronteCtx = new CaronteContext()) { Spostamento tmpAna = caronteCtx.Spostamento.Find(DTO.IDSpostamento); DTO.ToEntity(tmpAna); caronteCtx.SaveChanges(); return(this.Get(tmpAna.IDSpostamento)); } }
public void PasseggeroSelected(Spostamento dataContext) { Popup pop = new Popup(); pop.Closed += pop_Closed; pop.Child = new PasseggeroStatusChanger(pop, dataContext, currentPosition); pop.HorizontalOffset = (Window.Current.Bounds.Width - 800) / 2; pop.VerticalOffset = (Window.Current.Bounds.Height - 500) / 2; pop.IsOpen = true; }
private async Task ReloadListaPartecipanti() { List <Partecipante> partTotali = await dbMan.cmDB.Table <Partecipante>().Where(part => part.FKIDViaggio == ViaggioInCorso.IDViaggio).ToListAsync(); ListaPasseggeri = new ObservableCollection <Spostamento>(partTotali.Where(p => p.FKIDStato < 3).Select(p => Spostamento.FromPartecipante(p)).OrderBy(x => (x.Orario - DateTime.Now)).ToList()); eventAggregator.PublishOnUIThread(ListaPasseggeri); }