private async void JePropose1_Click(object sender, RoutedEventArgs e) { string message = ""; var dialog = new MessageDialog(""); dialog.Title = "Proposition d'évenement :"; dialog.Commands.Add(new UICommand("OK")); var eventSending = new EventGest(); if (await verifForm()) { var NewEvent = new Event(); NewEvent.TitreEvent = TextBoxTitre.Text; NewEvent.NbParticipEvent = int.Parse(TextBoxNbrPartMax.Text); NewEvent.ThemeEvent = ThemeCombo.SelectedItem.ToString(); NewEvent.AdresseEvent = adressSugest.Text; NewEvent.DateEvent = CalendarStart.Date.ToString(); NewEvent.DescripEvent = DescriptionTextboxTitre.Text; NewEvent.PhotoEvent = ImageTextBox.Text; NewEvent.IdUser = App.MobileService.CurrentUser.UserId.ToString(); NewEvent.TimeEvent = TimePicker.Time.Hours.ToString(); NewEvent.Duration = DurationPicker.Time.ToString(); eventSending.sendEvent(NewEvent); Frame.GoBack(); message = "Envoyé avec succé :D"; } else { message = "Champs invalide :("; } dialog.Content = message; await dialog.ShowAsync(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter is Event) { MenuItems = e.Parameter as Event; eventView.DataContext = MenuItems; } }
public async void supprEvent(Event sEvent) { try { await App.MobileService.GetTable<Event>().DeleteAsync(sEvent); } catch { } }
public async void updateEvent(Event sEvent) { try { await App.MobileService.GetTable<Event>().UpdateAsync(sEvent); } catch { } }
public async void sendEvent(Event sEvent) { try { await App.MobileService.GetTable<Event>().InsertAsync(sEvent); } catch { } }