Example #1
0
        private async void SubmitBtn_Clicked(object sender, EventArgs e)
        {
            // write data to file
            SaveData();
            ep1.WriteToTempFile();

            bool allgood = ep1.app.CheckForCompletion();

            if (!allgood)
            {
                await DisplayAlert("Incomplete Form", "You have not entered values for some fields. Please go back and review your answers.", "OK");

                return;
            }

            bool phonegood = ep1.app.IsPhoneNumber(EmpPhoneNo.Text);

            if (!phonegood)
            {
                await DisplayAlert("Invalid Format", "A phone number is in an invalid format.", "OK");

                return;
            }

            await Navigation.PushAsync(new EntryPage4(ep1));
        }
Example #2
0
        private async void SubmitBtn_Clicked(object sender, EventArgs e)
        {
            // save data and move on
            SaveData();
            ep1.WriteToTempFile();

            bool allgood = ep1.app.CheckForCompletion();

            if (!allgood)
            {
                await DisplayAlert("Incomplete Form", "You have not entered values for some fields. Please go back and review your answers.", "OK");
                return;
            }

            if ((MoveDate1.Date > MoveOutDate1.Date) || (MoveDate2.Date > MoveOutDate2.Date))
            {
                await DisplayAlert("Incorrect Date", "Your move-out date cannot occur before your move-in date. Please go back and correct the date.", "OK");
                return;
            }

            bool phone1, phone2, phone3;

            phone1 = phone2 = phone3 = true;

            if (!string.IsNullOrWhiteSpace(LandlordPhone.Text))
            {
                phone1 = ep1.app.IsPhoneNumber(ep1.app.CurrLandlordPhone);
            }
            if (!string.IsNullOrWhiteSpace(LandlordPhone1.Text))
            {
                phone2 = ep1.app.IsPhoneNumber(ep1.app.PrevLandlordPhone1);
            }
            if (!string.IsNullOrWhiteSpace(LandlordPhone2.Text))
            {
                phone3 = ep1.app.IsPhoneNumber(ep1.app.PrevLandlordPhone2);
            }

            if (!phone1 || !phone2 || !phone3)
            {
                await DisplayAlert("Invalid Format", "One or more of your phone numbers are in an invalid format.", "OK");
                return;
            }

            await Navigation.PushAsync(new EntryPage3(ep1));
        }