public static void AddAppointment(SimpleAppointment appointment)
        {
            var dbPath = System.IO.Path.Combine(
                Windows.Storage.ApplicationData.Current.LocalFolder.Path, "db.sqlite");

            try
            {
                using (var db = new SQLiteConnection(dbPath))
                {
                    db.RunInTransaction(() =>
                    {
                        db.Insert(new SimpleAppointment()
                        {
                            Id        = appointment.Id,
                            Subject   = appointment.Subject,
                            Location  = appointment.Location,
                            StartDate = appointment.StartDate,
                            EndDate   = appointment.EndDate
                        });
                    }
                                        );
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        private async void LoadButton_Click(object sender, RoutedEventArgs e)
        {
            SimpleAppointment appointment = (await AzureMobileServicesHelper.GetDataFromAzureMobileSvc()).FirstOrDefault();

            SubjectTextBox.Text  = appointment.Subject;
            LocationTextBox.Text = appointment.Location;
            StartDatePicker.Date = appointment.StartDate;
            EndDatePicker.Date   = appointment.EndDate;
        }
Esempio n. 3
0
        private void LoadButton_Click(object sender, RoutedEventArgs e)
        {
            SimpleAppointment appointment = SQLiteHelper.GetAppointment(1);

            SubjectTextBox.Text  = appointment.Subject;
            LocationTextBox.Text = appointment.Location;
            StartDatePicker.Date = appointment.StartDate;
            EndDatePicker.Date   = appointment.EndDate;
        }
        public static void UpdateDataFromAzureMobileSvc(SimpleAppointment item)
        {
            try
            {
                IMobileServiceTable <SimpleAppointment> table = App.bw8agu_mobileserviceClient.GetTable <SimpleAppointment>();

                table.UpdateAsync(item);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public async static void InsertDataFromAzureMobileSvc(SimpleAppointment item)
 {
     await App.bw8agu_mobileserviceClient.GetTable <SimpleAppointment>()
     .InsertAsync(item);
 }