private async void ReferNowClicked(object sender, EventArgs e) { var page = new RecruitsArmoryPage(); if (EmailEntry.TextColor == Color.Red) { await DisplayAlert("Invalid Data", "Invalid Email Format", "OK"); } else if (string.IsNullOrEmpty(FirstnameEntry.Text) || string.IsNullOrEmpty(LastnameEntry.Text) || string.IsNullOrEmpty(BusinessNameEntry.Text) || string.IsNullOrEmpty(EmailEntry.Text) || string.IsNullOrEmpty(PhoneNumberEntry.Text) || string.IsNullOrEmpty(MobileNumberEntry.Text) || string.IsNullOrEmpty(Editor.Text) || string.IsNullOrEmpty(Dropdown.Label) || Editor.Text == "What have you told them so far? What can you tell us that will help us bring them on board?" || Dropdown.Label == "Select...") { await DisplayAlert("Submission Failed", "Please fill up all the entry", "OK"); } else { var credential = DependencyService.Get <ICredentialRetriever>().GetCredential(); var contact_id = await DependencyService.Get <IOntraportContactIdRetriever>().GetOntraportContactId(credential.User.Email); var isSucess = await _referralService.SubmitOntraportContactApiArmy(new OntraportContactArmy() { Firstname = FirstnameEntry.Text, Lastname = LastnameEntry.Text, Company = BusinessNameEntry.Text, Email = EmailEntry.Text, OfficePhone = PhoneNumberEntry.Text, CellPhone = MobileNumberEntry.Text, Message = Editor.Text, LeadInfo = ConvertLeadToId(DropdownInterest.Label), ReferralPage = "Recruits Armory", PhoneUsed = Device.RuntimePlatform == Device.Android ? 522 : 521, Relationship = ConvertRelationshipToId(Dropdown.Label), AccountUsed = contact_id, }); if (isSucess) { await DisplayAlert("Success", "Submission Complete!", "OK"); await Navigation.PushAsync(page); } else { await DisplayAlert("Failed", "Submission Failed!", "OK"); } } }
async void OnRecruitsArmoryTapped(object sender, EventArgs args) { var page = new RecruitsArmoryPage(); await Navigation.PushAsync(page); }