示例#1
1
        async void Handle_Clicked(object sender, System.EventArgs e)
        {
            var x = new CloudData();

            GraphUser y = await x.GetDisplayName();


            Task <string> access_id = x.GetAccessID();

            System.Diagnostics.Debug.WriteLine("Debug: get access ID " + access_id.Result);

            //await DisplayAlert("Alert", "Welcome, " + y, "OK");

            var displayName = new Item
            {
                Name    = "Logged in as: " + y.displayName,
                Company = "Company: " + y.Company,
                Stand   = "Stand number: " + y.StandID
            };

            App.Current.Properties["LoginName"]   = "Logged in as: " + y.displayName;
            App.Current.Properties["StandName"]   = "Stand ID: " + y.StandID;
            App.Current.Properties["CompanyName"] = "Company: " + y.Company;



            await App.Current.SavePropertiesAsync();

            var Scanner = new Scanner.Scanner();

            Scanner.BindingContext = displayName;


            Application.Current.MainPage = Scanner;
        }
示例#2
0
        async void Handle_Clicked(object sender, System.EventArgs e)
        {
            var checkPasswordIsValid   = new CloudData();
            AuthenticationResult token = await checkPasswordIsValid.GetAccessToken("");


            string UserConferencePassword = App.Current.Properties["Password"].ToString();

            string PasswordFromAPI = checkPasswordIsValid.GetAccessID().Result;

            System.Diagnostics.Debug.WriteLine("Debug: Password must be " + PasswordFromAPI);

            if (PasswordFromAPI != "disable_conference_scanner_password")

            {
                if (UserConferencePassword != PasswordFromAPI)

                {
                    await DisplayAlert("Alert", "The password in your profile does not match the current Conference Password. Please contact Microlise to obtain the latest one, edit your profile, then try again", "OK");

                    return;
                }
            }

            var scanPage    = new FullScreenScanning();
            var resultsPage = new Views.SubmitResult();

            // Navigate to our scanner page
            //await Navigation.PushModalAsync(scanPage);

            if (App.IsEmuTest == false)

            {
                Application.Current.MainPage = scanPage;
            }

            else

            {
                var barCode = new Models.Item
                {
                    Id   = "12345678910",
                    Text = "Please click the button below to submit your scanned code to the Microlise database"
                };

                resultsPage.BindingContext = barCode;

                Application.Current.MainPage = resultsPage;
            }

            //NavigationPage.SetHasBackButton(this, false);
        }