private async Task ShortListJob() { if (SwipedJobItem.VacancyID.HasValue) { var pop = await _dialogService.OpenLoadingPopup(); bool shortlisted; if (SwipedJobItem.Status == "Interested") { shortlisted = true; } else { shortlisted = false; } Dictionary <string, object> obj = await _candidateJobService.ShortListJob(shortlisted, SwipedJobItem.VacancyID); try { if (obj["Success"].ToString() == "true") //success { ContactJobs oldValue = Vacancies.Where(x => x.VacancyID == SwipedJobItem.VacancyID).FirstOrDefault(); CandidateMainViewModel.Current.IsJobPageRendered = false; if (obj["Message"].ToString() == "UnShortlist") { oldValue.Status = null; await _dialogService.PopupMessage("Remove Shortlist Job Successefully", "#52CD9F", "#FFFFFF"); } else if (obj["Message"].ToString() == "Shortlist") { oldValue.Status = "Interested"; await _dialogService.PopupMessage("Shortlist Job Successefully", "#52CD9F", "#FFFFFF"); } } 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); } }
private void SwipeJobItem(object obj) { SwipedJobItem = (obj as SwipeEndedEventArgs).ItemData as ContactJobs; }