Exemplo n.º 1
0
 private void AppBarButton_Click_2(object sender, RoutedEventArgs e)
 {
    
     ScheduledVisitTile thisTile = lvItems.SelectedItem as ScheduledVisitTile;
    if(thisTile!=null){
             VisitorManager vm = new VisitorManager();
             vm.parsePerson(thisTile.person);
             this.Frame.Navigate(typeof(VisitorProcessPage1), vm);
        }
 }
 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 txtName_Copy_KeyUp(object sender, KeyRoutedEventArgs e)
        //{
        //    StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync("logdata.xml");

        //    lvItems.Items.Clear();

        //    //   Debug.WriteLine("Attempting to read file  " + file.Path + " into xdocument");
        //    XDocument doc = XDocument.Load(file.Path);
        //    var ps = (
        //        from actions in doc.Root.Elements("Action").Elements("Person")
        //        select actions
        //    );

        //    if (txtName_Copy.Text.Count() > 0)
        //    {

        //        IEnumerable<XElement> persons = (
        //            from actions in doc.Root.Elements("Action")
        //            where (string)actions.Attribute("type") == "Scheduled Visit"
        //            from person in actions.Elements("Person")
        //            where (person.Element("Company-Represented").Value.ToUpper().Contains(txtName_Copy.Text.ToUpper()))
        //            from dates in person.Elements("Date")
        //            orderby DateTime.Parse(person.Element("Time-In").Value) ascending
        //            where Convert.ToDateTime(dates.Value).Date == DateTime.Now.Date
        //            select person
        //        );

        //        foreach (XElement signin in persons)
        //        {
        //            ScheduledVisitTile tile = new ScheduledVisitTile();
        //            tile.person = signin;
        //            tile.txtName.Text = signin.Element("Last-Name").Value.ToString() + ", " + signin.Element("First-Name").Value.ToString();
        //            tile.txtCompany.Text = signin.Element("Company-Represented").Value.ToString();
        //            var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("shortdate");
        //            var formatterTime = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("shorttime");
        //            DateTime dateToFormat = Convert.ToDateTime(signin.Element("Time-In").Value.ToString());
        //            var thedate = formatter.Format(dateToFormat);
        //            var thetime = formatterTime.Format(dateToFormat);
        //            tile.txtDate.Text = thedate + " " + thetime;
        //            lvItems.Items.Add(tile);


        //        }
        //    }

        //}

        private void AppBarButton_Click_2(object sender, RoutedEventArgs e)
        {

            ScheduledVisitTile thisTile = lvItems.SelectedItem as ScheduledVisitTile;
            if (thisTile != null)
            {
                VisitorManager vm = new VisitorManager();
                vm.parsePerson(thisTile.person);
               // this.Frame.Navigate(typeof(VisitorProcessPage1), vm);
                if (Convert.ToBoolean(App.appman.localSettings.Values["UsePrivacyStatement"]))
                {
                    this.Frame.Navigate(typeof(PrivacyStatement), vm);
                }
                else
                {
                    this.Frame.Navigate(typeof(VisitorProcessPage1), vm);
                }
                
            }
        }