private async void RegisterButton_Click(object sender, EventArgs e) { progressBar.Visibility = ViewStates.Visible; imm.HideSoftInputFromWindow(cfID.WindowToken, 0); string dbPath_attributes = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "attributes.db3"); var db_attributes = new SQLiteConnection(dbPath_attributes); bool cfExists = false; var firebase = new FirebaseClient(FirebaseURL); var cfItems = await firebase.Child("cfids").OnceAsync <Cfid>(); string cfName = ""; foreach (var item in cfItems) { string cfid = item.Object.cfid; if (cfID.Text == cfid) { cfExists = true; cfName = item.Object.name; break; } } int myCFID = db_attributes.Get <MyAttributes>(1).cfid; if (myCFID.ToString() == cfID.Text) { Toast.MakeText(this.Activity, "You Are Already Registered for This Career Fair", ToastLength.Short).Show(); progressBar.Visibility = ViewStates.Invisible; } else { if (cfExists == true) { progressBar.Visibility = ViewStates.Invisible; Toast.MakeText(Activity, "Career Fair Found!", ToastLength.Short).Show(); confirmCF fragment = new confirmCF(); Bundle arguments = new Bundle(); arguments.PutString("CFID", cfID.Text); arguments.PutString("cfName", cfName); fragment.Arguments = arguments; Android.Support.V4.App.FragmentTransaction trans = FragmentManager.BeginTransaction(); trans.Replace(Resource.Id.register_root_frame, fragment); trans.Commit(); } else { progressBar.Visibility = ViewStates.Invisible; Toast.MakeText(Activity, "No Career Fair Found :(", ToastLength.Short).Show(); } } }
public static confirmCF newInstance() { confirmCF fragment = new confirmCF(); return(fragment); }