private async void btnSave_Click(object sender, RoutedEventArgs e)
 {
     //record the sign out
     VisitorManager vm = new VisitorManager();
     vm.parsePerson(this.person);
     await vm.record("Sign Out");
     this.Frame.Navigate(typeof(VisitorSignOutConfirmation2));
 }
        private async void btnSave_Click_1(object sender, RoutedEventArgs e)
        {
            if (String.IsNullOrEmpty(txtFirstName.Text) || String.IsNullOrEmpty(txtLastName.Text) || String.IsNullOrEmpty(txtHost.Text))
            {
                MessageDialog msgbox = new MessageDialog("All fields are required.", "Problem...");
                msgbox.Commands.Clear();
                msgbox.Commands.Add(new UICommand { Label = "Ok", Id = 0 });
                var res = await msgbox.ShowAsync();
            }
            else
            {
                VisitorManager vm = new VisitorManager();
                vm.firstname = txtFirstName.Text; vm.lastname = txtLastName.Text;  vm.boeinghostname = txtHost.Text;

                TimeSpan ts = dpTime.Time;
                Debug.WriteLine("the time is " + ts);
                DateTimeOffset dto = dpDate.Date;
                DateTime dt = dto.DateTime;
                DateTime date = new DateTime(dpDate.Date.Year, dpDate.Date.Month, dpDate.Date.Day, dpTime.Time.Hours, dpTime.Time.Minutes, 00);

               // Debug.WriteLine("the date is " + date);

                vm.timein = date;
                vm.EnteredByAdminDate = DateTime.Now;
                vm.EnteredByAdmin = 1;
                vm.prerecorded = true;


                if (!alreadyEntered)
                {
                   // Debug.WriteLine("adding the node");
                    await vm.record("Scheduled Visit");

                }
                else
                {
                    vm.ID = thisID;
                    vm.bemsid = thisBEMS;
                    vm.companyrepresented = company;
                    vm.PreScreenedByInitials = screenedby;
                    Debug.WriteLine("updating bemsid: " + vm.bemsid);
                   // Debug.WriteLine("updating node" + vm.ID);
                    await vm.update("Scheduled Visit");
                }


                this.Frame.Navigate(typeof(ScheduleVisit2), vm);
            }
        }