private async Task ApplyJob() { if (SwipedJobItem.VacancyID.HasValue) { var pop = await _dialogService.OpenLoadingPopup(); Dictionary <string, object> obj = await _candidateJobService.ApplyVacancy(SwipedJobItem.VacancyID); try { if (obj["Success"].ToString() == "true") //success { CandidateMainViewModel.Current.IsJobPageRendered = false; await _dialogService.PopupMessage("Apply Job Successefully", "#52CD9F", "#FFFFFF"); Vacancies.FirstOrDefault(x => x.VacancyID == SwipedJobItem.VacancyID).Status = "Applied"; } else if (obj["Success"].ToString() == "false") { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } await _dialogService.CloseLoadingPopup(pop); } }
public async Task WithDrawJob() { if (SwipedJobItem.VacancyID.HasValue) { var result = await _dialogService.Alert("Please confirm you wish to withdraw your application?", "All related information will be removed from system", "Confirm Withdraw", "Cancel"); if (result) { var pop = await _dialogService.OpenLoadingPopup(); Dictionary <string, object> obj = await _candidateJobService.WithDrawVacancy(SwipedJobItem.VacancyID); try { if (obj["Success"].ToString() == "true") //success { CandidateMainViewModel.Current.IsJobPageRendered = false; await _dialogService.PopupMessage("WithDraw Successefully", "#52CD9F", "#FFFFFF"); Vacancies.FirstOrDefault(x => x.VacancyID == SwipedJobItem.VacancyID).Status = null; } else if (obj["Success"].ToString() == "false") { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } await _dialogService.CloseLoadingPopup(pop); } } }