コード例 #1
0
        void RunTasks()
        {
            //setup button events
            Task.Run(() => ApplyButtonListeners());

            //setup checkbox listeners
            Task.Run(() => ApplyCheckBoxListeners());

            //query the config file & log into API
            Task.Run(() => BayonetChat.QueryConfig());

            //permission request
            Task.Run(() => GetPhonePermissionsAsync());
        }
コード例 #2
0
        public async Task OnSubmitClickedAsync()
        {
            CheckBox hudsonCheckBox  = FindViewById <CheckBox>(Resource.Id.hudsonCheckBox);
            CheckBox tampaCheckBox   = FindViewById <CheckBox>(Resource.Id.tampaCheckBox);
            CheckBox orlandoCheckBox = FindViewById <CheckBox>(Resource.Id.orlandoCheckBox);

            CheckBox androidCheckBox = FindViewById <CheckBox>(Resource.Id.androidCheckBox);
            CheckBox appleCheckBox   = FindViewById <CheckBox>(Resource.Id.appleCheckBox);

            EditText empName  = FindViewById <EditText>(Resource.Id.nameText);
            EditText issueBox = FindViewById <EditText>(Resource.Id.issueText);

            //no location
            if (!hudsonCheckBox.Checked && !tampaCheckBox.Checked && !orlandoCheckBox.Checked)
            {
                await DisplayFailureNotice("No location checked.");

                return;
            }

            //no device type
            if (!appleCheckBox.Checked && !androidCheckBox.Checked)
            {
                await DisplayFailureNotice("No device type checked.");

                return;
            }

            //no name
            string name = empName.Text;

            if (name.Equals(""))
            {
                await DisplayFailureNotice("No employee name specified.");

                return;
            }

            string issue = issueBox.Text;

            //no issue
            if (issue.Equals(""))
            {
                await DisplayFailureNotice("No issue entered.");

                return;
            }

            string location = DetermineLocation(hudsonCheckBox, tampaCheckBox, orlandoCheckBox);
            string device   = DetermineDevice(androidCheckBox, appleCheckBox);
            string number   = await GetPhoneNumberAsync();

            string ticket = "";

            ticket += "Name: " + name + "\n";
            ticket += "Number: " + number + "\n";
            ticket += "Location: " + location + "\n";
            ticket += "Device: " + device + "\n";
            ticket += "Issue: " + issue + "\n";

            await Task.Run(() => BayonetChat.PostMessageToChat(ticket, name));

            await DisplayNotification();

            Analytics.TrackEvent("Ticket Submitted");

            Task.Run(() => ClearForm());

            GoToActivity(typeof(Calendly));
        }