private void AddEvent() { var eventsModel = new EventsModel { Id = _eventsId, Title = entryTitle.Text, EventDate = dpEventDate.Date + tpEventTime.Time, Location = entryLocation.Text, IsDone = switchDone.IsToggled }; var eventsData = new EventsData(); eventsData.AddItems(eventsModel); if (_isUpdate) { DisplayAlert("Event", "Successfully updated!", "OK"); } else { DisplayAlert("Event", "Successfully created!", "OK"); } Navigation.PopAsync(); }
private void LoadItems() { var eventsData = new EventsData(); var result = eventsData.GetItemsList().Result; listViewEvent.ItemsSource = result; stackActionButtons.IsEnabled = false; }
private async void btnDelete_Clicked(object sender, EventArgs e) { var action = await DisplayAlert("Confirm", "Delete this item?", "Yes", "No"); if (action) { var eventsData = new EventsData(); await eventsData.DeleteItem(_selectedItemIndex); LoadItems(); } }
private void LoadEventsDetails() { var eventsData = new EventsData(); var eventDetails = eventsData.GetItemDetails(_eventsId).Result; foreach (var items in eventDetails) { entryTitle.Text = items.Title; dpEventDate.Date = items.EventDate.Date; tpEventTime.Time = items.EventDate.TimeOfDay; entryLocation.Text = items.Location; switchDone.IsToggled = items.IsDone; } }
private void EditEvent() { var eventsModel = new EventsModel { Title = entryTitle.Text, EventDate = dpEventDate.Date + tpEventTime.Time, Location = entryLocation.Text, IsDone = switchDone.IsToggled }; var eventsData = new EventsData(); eventsData.AddItems(eventsModel); DisplayAlert("Event", "Successfull updated!", "OK"); Navigation.PopAsync(); }