public async void findSmartBuyer() { string content = await _client.GetStringAsync(url); List <Dictionary <string, object> > posts = JsonConvert.DeserializeObject <List <Dictionary <string, object> > >(content); bool isJobSeekerCheck; foreach (Dictionary <string, object> i in posts) { Dictionary <string, object> post = JsonConvert.DeserializeObject <Dictionary <string, object> >(Convert.ToString(i["properties"])); isJobSeekerCheck = Convert.ToBoolean(post["isJobSeeker"]); if (isJobSeekerCheck == true) { bool isJob = Convert.ToBoolean(post["isJobSeeker"]); string name = Convert.ToString(post["fullName"]); string sim = Convert.ToString(post["simNumber"]); IsJobOnlineSeeker ob = new IsJobOnlineSeeker { isJobSeeker = Convert.ToString(isJob), fullName = name, simNumber = sim }; smartBuyer.Add(ob); } } // listView.ItemsSource = null; // listView.ItemsSource = smartBuyer; }
public async void IsJobOnlineSeeker(IsJobOnlineSeeker ob) { try { await _client.PostAsync("https://trolli-194513.appspot.com/isOnlineJobSeeker?fullName=" + ob.fullName + "&simNumber=" + ob.simNumber + "&isJobSeeker=" + ob.isJobSeeker, null); } catch (Exception ex) { Log.Warning("Error", ex.ToString()); } }
public void ToggledHandler(object sender, ToggledEventArgs e) { try { Dictionary <string, object> userData = SharedUserData.getUserData; bool isOnlineSeeker = e.Value; if (globalValue) { string fullName = Convert.ToString(userData["fullName"]); string simNumber = Convert.ToString(userData["simNumber"]); IsJobOnlineSeeker bean = new IsJobOnlineSeeker { fullName = fullName, simNumber = simNumber, isJobSeeker = "false" }; ApiCalling callApi = new ApiCalling(); callApi.IsJobOnlineSeeker(bean); Application.Current.Properties["isOnlineJobSeeker"] = false; globalValue = false; // OneSignal.Current.SetSubscription(false); DisplayAlert("Notification Msg", "Notification Off", "Ok"); } else { string fullName = Convert.ToString(userData["fullName"]); string simNumber = Convert.ToString(userData["simNumber"]); IsJobOnlineSeeker bean = new IsJobOnlineSeeker { fullName = fullName, simNumber = simNumber, isJobSeeker = "true" }; ApiCalling callApi = new ApiCalling(); callApi.IsJobOnlineSeeker(bean); Application.Current.Properties["isOnlineJobSeeker"] = true; globalValue = true; // OneSignal.Current.SetSubscription(true); DisplayAlert("Notification Msg", "Notification On", "Ok"); } }catch (Exception ex) { DisplayAlert("", ExceptionManagement.LogException(ex), "Ok"); } }
public async void SignUpButton(object sender, EventArgs e) { String UUIDs = Guid.NewGuid().ToString(); if (CheckTextField()) { activIndicator.IsRunning = true; var deviceIds = CrossDeviceInfo.Current.Id; //Can't find Actual Object of CrossDeviceInfo // string simNumber = ""; // string deviceIdJson = ""; // var content = await _client.GetStringAsync(url); // List<Dictionary<string, object>> posts = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(content); // foreach (Dictionary<string, object> i in posts) // { // Dictionary<string, object> post = JsonConvert.DeserializeObject<Dictionary<string, object>>(Convert.ToString(i["properties"])); // deviceIdJson = Convert.ToString(post["deviceId"]); // if (deviceIdJson == deviceId) // { // simNumber = Convert.ToString(post["simNumber"]); // } // } // await Navigation.PushModalAsync(new TermAndService()); try { string oneSignalId = ""; OneSignal.Current.IdsAvailable((playerID, pushToken) => { oneSignalId = playerID; // App.Current.MainPage.DisplayAlert("playerId", id.ToString(), "OK"); }); string names = name; string emailId = email; string subrubs = subrub.Text; var statesPickers = statesPicker.Items[statesPicker.SelectedIndex]; //Can't find actual return type string statess = statesPickers; string postCodee = postCode.Text; string countrys = "Australia"; string userTypes = "C"; string latitude = "45"; string longitude = "45"; var locator = CrossGeolocator.Current; if (!locator.IsGeolocationAvailable || !locator.IsGeolocationEnabled) { await DisplayAlert("", "Trolli app requires access to location services, in order to function properly. If you do not allow location access, some features may not work as expected.", "Ok"); } else { locator.DesiredAccuracy = 100; if (Device.RuntimePlatform == Device.iOS) { var position = await locator.GetPositionAsync(); //Can't find actual return type latitude = "" + position.Latitude; longitude = "" + position.Longitude; } else if (Device.RuntimePlatform == Device.Android) { var position = await locator.GetPositionAsync(); //Can't find actual return type latitude = "" + position.Latitude; longitude = "" + position.Longitude; } string folderID = GoogleDriveAPI.CreateUserFolder("User_" + UUIDs); SignupBean bean = new SignupBean { name = names, email = emailId, subrub = subrubs, states = statess, postCodes = postCodee, country = countrys, userType = userTypes, phoneNumber = phoneNumbers, deviceId = deviceIds, latitude = latitude, longitude = longitude, UUID = UUIDs, folderId = folderID, imageId = "", rewardCard1 = "", rewardCard2 = "", oneSignalId = oneSignalId }; IsJobOnlineSeeker bean2 = new IsJobOnlineSeeker { fullName = name, simNumber = phoneNumbers, isJobSeeker = "true" }; Application.Current.Properties["phoneNumber"] = phoneNumbers; Application.Current.Properties["isOnlineJobSeeker"] = true; Application.Current.Properties["checkTrolli"] = "showAlert"; reloadData.Add("country", countrys); reloadData.Add("UniqueID", UUIDs); reloadData.Add("fullName", names); reloadData.Add("deviceId", deviceIds); reloadData.Add("suburb", subrubs); reloadData.Add("postCode", postCodee); reloadData.Add("state", statess); reloadData.Add("userType", userTypes); reloadData.Add("simNumber", phoneNumbers); reloadData.Add("gdFolderId", folderID); reloadData.Add("gdRewardCard1", ""); reloadData.Add("gdRewardCard2", ""); reloadData.Add("email", emailId); reloadData.Add("gdProfileImageId", ""); reloadData.Add("oneSignalId", oneSignalId); SharedUserData.getUserData = reloadData; ApiCalling callApi = new ApiCalling(); // GlobalVaribles golbalVarible = new GlobalVaribles(); // golbalVarible.setData(bean); callApi.SignupPost(bean); callApi.IsJobOnlineSeeker(bean2); // animationView.Play(); // // string folderID = GoogleDriveAPI.createUserFolder("User_"+UUIDs); userReferral referralObject = new userReferral { userId = phoneNumbers, availReward = true, referredByCode = referred, rewardBalance = 0, referralCode = "Furqan_xw7e" }; callApi.CreateReferralCode(referralObject); await Navigation.PushAsync(new MenuPage()); } } catch (Exception ex) { await DisplayAlert("", ExceptionManagement.LogException(ex), "Ok"); } } }
public async void signUp_button(object sender, EventArgs e) { String UUIDs = Guid.NewGuid().ToString(); if (checkTextField()) { var deviceIds = CrossDeviceInfo.Current.Id; // string simNumber = ""; // string deviceIdJson = ""; // var content = await _client.GetStringAsync(url); // List<Dictionary<string, object>> posts = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(content); // foreach (Dictionary<string, object> i in posts) // { // Dictionary<string, object> post = JsonConvert.DeserializeObject<Dictionary<string, object>>(Convert.ToString(i["properties"])); // deviceIdJson = Convert.ToString(post["deviceId"]); // if (deviceIdJson == deviceId) // { // simNumber = Convert.ToString(post["simNumber"]); // } // } // await Navigation.PushModalAsync(new TermAndService()); try { string names = name; string emailId = email; string subrubs = subrub.Text; var statesPickers = statesPicker.Items[statesPicker.SelectedIndex]; string statess = statesPickers; string postCodee = postCode.Text; string countrys = "Australia"; string userTypes = "C"; string latitude = "45"; string longitude = "45"; var locator = CrossGeolocator.Current; locator.DesiredAccuracy = 100; if (Device.RuntimePlatform == Device.iOS) { var position = await locator.GetPositionAsync(); latitude = "" + position.Latitude; longitude = "" + position.Longitude; } else if (Device.RuntimePlatform == Device.Android) { var position = await locator.GetPositionAsync(); latitude = "" + position.Latitude; longitude = "" + position.Longitude; } string folderID = GoogleDriveAPI.createUserFolder("User_" + UUIDs); SignupBean bean = new SignupBean { name = names, email = emailId, subrub = subrubs, states = statess, postCodes = postCodee, country = countrys, userType = userTypes, phoneNumber = phoneNumbers, deviceId = deviceIds, latitude = latitude, longitude = longitude, UUID = UUIDs, folderId = folderID, imageId = "", rewardCard1 = "", rewardCard2 = "" }; IsJobOnlineSeeker bean2 = new IsJobOnlineSeeker { fullName = name, simNumber = phoneNumbers, isJobSeeker = "true" }; Application.Current.Properties["phoneNumber"] = phoneNumbers; Application.Current.Properties["isOnlineJobSeeker"] = true; reloadData.Add("country", countrys); reloadData.Add("UniqueID", UUIDs); reloadData.Add("fullName", names); reloadData.Add("deviceId", deviceIds); reloadData.Add("suburb", subrubs); reloadData.Add("postCode", postCodee); reloadData.Add("state", statess); reloadData.Add("userType", userTypes); reloadData.Add("simNumber", phoneNumbers); reloadData.Add("gdFolderId", folderID); reloadData.Add("gdRewardCard1", ""); reloadData.Add("gdRewardCard2", ""); reloadData.Add("email", emailId); reloadData.Add("gdProfileImageId", ""); ShareUserData.getUserData = reloadData; ApiCalling callApi = new ApiCalling(); // GlobalVaribles golbalVarible = new GlobalVaribles(); // golbalVarible.setData(bean); callApi.signupPost(bean); callApi.isJobOnlineSeeker(bean2); // // string folderID = GoogleDriveAPI.createUserFolder("User_"+UUIDs); await Navigation.PushAsync(new MenuPage()); } catch (Exception ex) { await DisplayAlert("Alert", "" + ex, "ok"); } } }