private async Task LoadMoreVacancies() { IsBusy = true; _currentPageVacancies += 1; AccountJobs AJ = new AccountJobs { AccountID = _accountID, CurrentPage = _currentPageVacancies, PageSize = PageSize }; dynamic obj = await _employerJobService.GetRelatedJobs(AJ); if (obj["Jobs"] != null) { List <AccountJobs> listMore = JsonConvert.DeserializeObject <List <AccountJobs> >(obj["records"].ToString()); if (listMore.Count > 0) { foreach (var item in listMore) { Vacancies.Add(item); } if (obj["hasMore"] == false) { VacancisLoadMoreIsVisible = false; } } else { VacancisLoadMoreIsVisible = false; } } IsBusy = false; }
public override async Task InitializeAsync(object navigationData) { var pop = await _dialogService.OpenLoadingPopup(); _accountID = (Guid)navigationData; dynamic obj = await _employerJobService.GetEmployerDetails(_accountID); if (obj["EmployerDetails"] != null) { string aboutUs = ""; if (obj["EmployerDetails"]["AboutUs"] != null) { aboutUs = Utilities.HtmlToPlainText(obj["EmployerDetails"]["AboutUs"].ToString()); } Company = new Models.Account { AccountID = _accountID, AboutUs = aboutUs, AccountName = obj["EmployerDetails"]["AccountName"], WebSite = obj["EmployerDetails"]["WebSite"], Address = obj["EmployerDetails"]["Address"], VideoLink = obj["EmployerDetails"]["VideoLink"], FavouriteEmployerID = obj["EmployerDetails"]["FavouriteEmployerID"] }; ShorlistText = obj["EmployerDetails"]["FavouriteEmployerID"] == null ? "♡ Shortlist" : "♡ Remove Shortlist"; } AccountJobs AJ = new AccountJobs { AccountID = _accountID, CurrentPage = _currentPageVacancies, PageSize = PageSize }; Dictionary <string, object> objVacancies = await _employerJobService.GetRelatedJobs(AJ); if (objVacancies["records"] != null) { Vacancies = JsonConvert.DeserializeObject <ObservableCollection <AccountJobs> >(objVacancies["records"].ToString()); } VacancisLoadMoreIsVisible = true; if (objVacancies["hasMore"].ToString() == "false") { VacancisLoadMoreIsVisible = false; } if (Company.VideoLink != null) { VideoHeight = Application.Current.MainPage.Width / 16 * 9; VideoUrl = GetYoutubeEmbed(Company.VideoLink); } await _dialogService.CloseLoadingPopup(pop); }
public async Task <dynamic> GetRelatedJobs(AccountJobs AJ) { var result = await _requestService.postDataFromServiceAuthority("api/EmployerJob/GetRelatedJobs", AJ); return(result); }