private async Task CandidateRegisterAsync() { var pop = await _dialogService.OpenLoadingPopup(); await _navigationService.NavigateToPopupAsync <CandidateRegisterViewModel>(true); await _dialogService.CloseLoadingPopup(pop); }
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 override async Task InitializeAsync(object navigationData) { var pop = await _dialogService.OpenLoadingPopup(); InitDataFilter = await _iDDLService.GetInitDataFilter(); JobTypeCollection = InitDataFilter.JobTypeDLL.Cast <object>().ToObservableCollection(); CategoryCollection = InitDataFilter.ClassificationDLL.Cast <object>().ToObservableCollection(); LocationCollection = InitDataFilter.LocationDDL.Cast <object>().ToObservableCollection(); PositionCollection = InitDataFilter.PositionDLL.Cast <object>().ToObservableCollection(); SkillCollection = InitDataFilter.SkillsDLL.Cast <object>().ToObservableCollection(); QualificationCollection = InitDataFilter.QualificationDLL.Cast <object>().ToObservableCollection(); LicenceCollection = InitDataFilter.TicketsDLL.Cast <object>().ToObservableCollection(); dynamic objSearchDifinition = await _candidateExploreService.GetSavedSearchDefinition(); if (objSearchDifinition["parameter"] != null) { string[] jobTypeIds = objSearchDifinition["parameter"]["JobTypeIds"].ToString().Split(','); JobTypeSelected = new ObservableCollection <object>(JobTypeCollection.Where(x => Array.IndexOf(jobTypeIds, (x as LookupItem).Id) >= 0)); string[] categoryIds = objSearchDifinition["parameter"]["CategoryIds"].ToString().Split(','); CategorySelected = new ObservableCollection <object>(CategoryCollection.Where(x => Array.IndexOf(categoryIds, (x as LookupItem).Id) >= 0)); string[] locationIds = objSearchDifinition["parameter"]["LocationIds"].ToString().Split(','); LocationSelected = new ObservableCollection <object>(LocationCollection.Where(x => Array.IndexOf(locationIds, (x as LookupItem).Id) >= 0)); string[] positionIds = objSearchDifinition["parameter"]["PositionIds"].ToString().Split(','); PositionSelected = new ObservableCollection <object>(PositionCollection.Where(x => Array.IndexOf(positionIds, (x as LookupItem).Id) >= 0)); string[] skillIds = objSearchDifinition["parameter"]["SkillsIds"].ToString().Split(','); SkillSelected = new ObservableCollection <object>(SkillCollection.Where(x => Array.IndexOf(skillIds, (x as LookupItem).Id) >= 0)); string[] qualificationIds = objSearchDifinition["parameter"]["QualificationsIds"].ToString().Split(','); QualificationSelected = new ObservableCollection <object>(QualificationCollection.Where(x => Array.IndexOf(qualificationIds, (x as LookupItem).Id) >= 0)); string[] licenceIds = objSearchDifinition["parameter"]["TicketLicensesIds"].ToString().Split(','); LicenceSelected = new ObservableCollection <object>(LicenceCollection.Where(x => Array.IndexOf(licenceIds, (x as LookupItem).Id) >= 0)); } else { JobTypeSelected = new ObservableCollection <object>(); CategorySelected = new ObservableCollection <object>(); LocationSelected = new ObservableCollection <object>(); PositionSelected = new ObservableCollection <object>(); SkillSelected = new ObservableCollection <object>(); QualificationSelected = new ObservableCollection <object>(); LicenceSelected = new ObservableCollection <object>(); } await _dialogService.CloseLoadingPopup(pop); }
private async Task BtnSaveReferenceCommandAsync() { var pop = await _dialogService.OpenLoadingPopup(); ContactReference reference = new ContactReference { EmployerName = _employer, Position = _position, ReferenceName = _referenceName, Relationship = _relationship, Phone = _phone, Contacted = _isContacted, }; Dictionary <string, object> obj = await _candidateDetailsService.AddReference(reference); if (obj != null) { try { if (obj["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Add new Reference Successefully", "#52CD9F", "#FFFFFF"); await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } else if (obj["Success"].ToString() == "false") { if (obj["Message"].ToString() == "Fail") { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); } else if (obj["Message"].ToString() == "AttachFail") { await _dialogService.PopupMessage("Attach file Fail, 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 async Task SignInAsync() { var pop = await _dialogService.OpenLoadingPopup(); Dictionary <string, object> obj = await _authenticationService.LoginAsync(UserName, Password); if (obj != null) { if (obj["Success"].ToString() == "true") { await _dialogService.CloseLoadingPopup(pop); await _dialogService.PopupMessage("Login Successefully", "#52CD9F", "#FFFFFF"); if (obj["Roles"].ToString() == "Employer") { } else if (obj["Roles"].ToString() == "Candidate") { App.ContactID = obj["ContactID"].ToString(); App.UserName = obj["UserName"].ToString(); App.PassWord = Password; RequestService.ACCESS_TOKEN = obj["access_token"].ToString(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } } else if (obj["Message"].ToString() == "IsActive") //success //fail { await _dialogService.PopupMessage("This account yet active!", "#CF6069", "#FFFFFF"); } else if (obj["Message"].ToString() == "IsRequireReset") //success //fail { await _dialogService.PopupMessage("This account need reset!", "#CF6069", "#FFFFFF"); } else if (obj["Message"].ToString() == "LoginFail") //success //fail { await _dialogService.PopupMessage("Login fail, please try again!", "#CF6069", "#FFFFFF"); } } else { await _dialogService.PopupMessage("Login fail, please try again!", "#CF6069", "#FFFFFF"); await NavigationService.NavigateToAsync <LoginViewModel>(); } await _dialogService.CloseLoadingPopup(pop); }
private async Task BtnSaveSkillCommandAsync() { var pop = await _dialogService.OpenLoadingPopup(); ContactSkill skill = new ContactSkill { MeasurementName = _skill, ExperienceName = _experienceSelected.Name, ExperienceID = _experienceSelected.Id, }; Dictionary <string, object> obj = await _candidateDetailsService.AddSkill(skill); if (obj != null) { try { if (obj["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Add new Education Successefully", "#52CD9F", "#FFFFFF"); await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } else if (obj["Success"].ToString() == "false") { if (obj["Message"].ToString() == "Fail") { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); } else if (obj["Message"].ToString() == "AttachFail") { await _dialogService.PopupMessage("Attach file Fail, 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 async Task BtnSaveDocumentCommandAsync() { var pop = await _dialogService.OpenLoadingPopup(); string fileName = _title + Path.GetExtension(stream.FileName); Dictionary <string, object> obj = await _candidateDetailsService.AddDocument(stream, fileName); await _dialogService.CloseLoadingPopup(pop); if (obj != null) { try { if (obj["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Add new Document Successefully", "#52CD9F", "#FFFFFF"); await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } else if (obj["Success"].ToString() == "false") { if (obj["Message"].ToString() == "Fail") { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); } else if (obj["Message"].ToString() == "AttachFail") { await _dialogService.PopupMessage("Attach file Fail, please try again!!", "#CF6069", "#FFFFFF"); } } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } } }
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 async Task BtnSaveAccountSettingCommandAsync() { var pop = await _dialogService.OpenLoadingPopup(); Contact profile = new Contact { Password = _password, }; Dictionary <string, object> obj = await _authenticationService.ChangePassword(profile); await _dialogService.CloseLoadingPopup(pop); if (obj != null) { try { if (obj["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Change Password Successefully", "#52CD9F", "#FFFFFF"); await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } 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); } } }
private async void OpenSignoutPage() { var pop = await _dialogService.OpenLoadingPopup(); Dictionary <string, object> obj = await _authenticationService.Logout(); if (obj != null) { try { if (obj["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Logout Successefully", "#52CD9F", "#FFFFFF"); await PopupNavigation.Instance.PopAllAsync(); App.UserName = ""; App.ContactID = null; RequestService.ACCESS_TOKEN = ""; await _navigationService.NavigateToAsync <LoginViewModel>(); } else if (obj["Success"].ToString() == "false") { if (obj["Message"].ToString() == "Fail") { 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); }
public override async Task InitializeAsync(object navigationData) { WithDrawIsVisible = true; ApplyIsVisible = false; var pop = await _dialogService.OpenLoadingPopup(); _vacancyID = (Guid)navigationData; dynamic obj = await _candidateJobService.GetVacancyDetails(_vacancyID); DateTime opendate; try { opendate = DateTime.Parse(obj["jobDetail"]["OpenDate"].ToString()); } catch { opendate = DateTime.MinValue; } TimeSpan opendateInt = DateTime.Now - opendate; if (obj["jobDetail"] != null) { string Title = obj["jobDetail"]["Title"]; string worksiteName = obj["jobDetail"]["WorksiteName"]; bool isPromoted = obj["jobDetail"]["IsPromoted"]; string jobType = obj["jobDetail"]["JobType"]; string salary = obj["jobDetail"]["Salary"]; string status = obj["jobDetail"]["Status"]; string description = ""; if (obj["jobDetail"]["Description"] != null) { description = Utilities.HtmlToPlainText(obj["jobDetail"]["Description"].ToString()); } Models.Account account = new Models.Account(); if (obj["jobDetail"]["Account"] != null) { account = JsonConvert.DeserializeObject <Models.Account>(obj["jobDetail"]["Account"].ToString()); } List <JobRequire> requires; if (obj["requiredList"] != null) { requires = JsonConvert.DeserializeObject <List <JobRequire> >(obj["requiredList"].ToString()); } else { requires = new List <JobRequire>(); } //Get contact Task Dictionary <string, object> objContactTask = await _candidateJobService.GetContactTaskByContactIDAndVacancyID(_vacancyID); List <UserContactTask> contactTasksTodo = new List <UserContactTask>(); List <UserContactTask> contactTasksComplete = new List <UserContactTask>(); if (objContactTask["contactTasks"] != null) { List <UserContactTask> ContactTasks = JsonConvert.DeserializeObject <List <UserContactTask> >(objContactTask["contactTasks"].ToString()); foreach (var contactTask in ContactTasks) { if (contactTask.Completed) { contactTasksComplete.Add(contactTask); } else { contactTasksTodo.Add(contactTask); } } } _contactTasksTodoList.AddRange(contactTasksTodo); _contactTasksCompleteList.AddRange(contactTasksComplete); ContactTasksComplete = contactTasksComplete; ContactTasksTodo = contactTasksTodo; //Get contact Document Dictionary <string, object> objContactDocument = await _candidateJobService.GetDocumentsAssigneedByContactIDAndVacancyID(_vacancyID); List <ContactDocument> contactDocuments; if (objContactDocument["contactDocuments"] != null) { contactDocuments = JsonConvert.DeserializeObject <List <ContactDocument> >(objContactDocument["contactDocuments"].ToString()); } else { contactDocuments = new List <ContactDocument>(); } _contactDocumentList.AddRange(contactDocuments); ContactDocument = contactDocuments; Job = new Vacancy { VacancyID = _vacancyID, Title = Title, WorksiteName = worksiteName, IsPromoted = isPromoted, JobType = jobType, Salary = salary, Status = status, OpenDate = opendate, OpenDateInt = (int)opendateInt.TotalDays, Description = description, Account = account, Requires = requires, //ContactTasksTodo = contactTasksTodo, //ContactTasksComplete = contactTasksComplete, //ContactDocuments = contactDocuments }; TodoTaskListViewHeightRequest = ContactTasksTodo.Count * 60 + 38; CompleteTaskListViewHeightRequest = ContactTasksComplete.Count * 60 + 40; AttachmentListViewHeightRequest = ContactDocument.Count * 60 + 38; } await _dialogService.CloseLoadingPopup(pop); }
private async Task BtnSaveEducationAsync() { ContactEducation edu = new ContactEducation { University = _institution, DegreeType = _attained, Classification = _fieldofStudy, SubClassification = _course, City = _city, From = _fromDate, TimeFromString = _fromDate.HasValue ? _fromDate.Value.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture) : "", To = _toDate, TimeToString = _toDate.HasValue ? _toDate.Value.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture) : "", }; var pop = await _dialogService.OpenLoadingPopup(); Dictionary <string, object> obj = await _candidateDetailsService.AddEducation(edu); if (obj != null) { try { if (obj["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Add new Education Successefully", "#52CD9F", "#FFFFFF"); if (stream != null) { Dictionary <string, object> objupload = await _candidateDetailsService.SaveEducationAttachment(obj["Result"].ToString(), stream); if (objupload != null) { try { if (objupload["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Attach file Successefully", "#52CD9F", "#FFFFFF"); await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } else if (objupload["Success"].ToString() == "false") { if (objupload["Message"].ToString() == "Fail") { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); } else if (objupload["Message"].ToString() == "NodocumentFile") { await _dialogService.PopupMessage("Attach file Fail, please try again!!", "#CF6069", "#FFFFFF"); } } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } } } else { await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } } await _dialogService.CloseLoadingPopup(pop); }
private async Task BtnSaveProfileCommandAsync() { var pop = await _dialogService.OpenLoadingPopup(); string CityName = ""; Guid? CityID = null; if (CitySelected != null) { CityName = CitySelected.Name; CityID = CitySelected.Id; } Contact profile = new Contact { FirstName = _firstName, LastName = _lastName, Email = _email, Address = _address, CityName = CityName, CityID = CityID, Nationality = _nationalitySelected.Name, NationalityID = _nationalitySelected.Id, DateOfBirth = _birthDay, AboutMe = _aboutMe, }; Dictionary <string, object> obj = await _candidateDetailsService.EditCandidateDetails(profile); if (obj != null) { try { await _dialogService.PopupMessage("Edit Profile Successefully", "#52CD9F", "#FFFFFF"); if (stream != null) { Dictionary <string, object> objupload = await _candidateDetailsService.UploadResume(stream); if (objupload != null) { try { if (objupload["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Upload Resume Successefully", "#52CD9F", "#FFFFFF"); } else if (objupload["Success"].ToString() == "false") { if (objupload["Message"].ToString() == "Fail") { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); } else if (objupload["Message"].ToString() == "NodocumentFile") { await _dialogService.PopupMessage("Attach file Fail, please try again!!", "#CF6069", "#FFFFFF"); } } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } } } await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } } await _dialogService.CloseLoadingPopup(pop); }
private async Task SubmitRegisterAsync() { var pop = await _dialogService.OpenLoadingPopup(); Register reg = new Register { FirstName = _fieldFirstName, LastName = _fieldLastName, Email = _fieldEmail, Password = _fieldPassword, UserName = _fieldEmail, ConfirmPassword = _fieldPasswordConfirm, AccountName = _fieldCompanyName, Industry = _fieldIndustry }; Dictionary <string, object> obj = await _employerDetailService.EmployerRegister(reg); if (obj != null) { try { if (obj["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Register Successefully", "#52CD9F", "#FFFFFF"); App.ContactID = obj["ContactID"].ToString(); App.UserName = obj["UserName"].ToString(); App.PassWord = FieldPassword; RequestService.ACCESS_TOKEN = obj["access_token"].ToString(); if (_avatarStream != null) { Dictionary <string, object> objUpload = await _candidateDetailService.AddEditContactAvatarImage(_avatarStream); try { if (objUpload["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Update Cover image Successefully", "#52CD9F", "#FFFFFF"); } else if (objUpload["Success"].ToString() == "false") { await _dialogService.PopupMessage("Haven't image file, please try again!!", "#CF6069", "#FFFFFF"); } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } finally { await PopupNavigation.Instance.PopAllAsync(); await NavigationService.NavigateToAsync <LoginViewModel>(); } } else { await PopupNavigation.Instance.PopAllAsync(); await NavigationService.NavigateToAsync <LoginViewModel>(); } } else if (obj["Message"].ToString() == "IsExists") //is exists { await _dialogService.PopupMessage("This account is exists!", "#CF6069", "#FFFFFF"); } else if (obj["Message"].ToString() == "TryAgaint") //fail { 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); }
private async Task BtnSaveWorkExprienceCommandAsync() { var pop = await _dialogService.OpenLoadingPopup(); DateTime?dateFrom = null; DateTime?dateTo = null; try { dateFrom = _fromDate; } catch { dateFrom = null; } try { dateTo = _toDate; } catch { dateTo = null; } ContactWorkExprience work = new ContactWorkExprience { Title = _title, Company = _company, Location = _location, IsWorkCurrent = _isWorkCurrent, From = dateFrom, TimeFromString = dateFrom.HasValue ? dateFrom.Value.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture) : "", To = dateTo, TimeToString = dateTo.HasValue ? dateTo.Value.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture) : "", }; Dictionary <string, object> obj = await _candidateDetailsService.AddWorkExprience(work); if (obj != null) { try { if (obj["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Add new Work Exprience Successefully", "#52CD9F", "#FFFFFF"); if (stream != null) { Dictionary <string, object> objupload = await _candidateDetailsService.SaveWorkExperienceAttachment(obj["Result"].ToString(), stream); if (objupload != null) { try { if (objupload["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Attach file Successefully", "#52CD9F", "#FFFFFF"); await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } else if (objupload["Success"].ToString() == "false") { if (objupload["Message"].ToString() == "Fail") { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); } else if (objupload["Message"].ToString() == "NodocumentFile") { await _dialogService.PopupMessage("Attach file Fail, please try again!!", "#CF6069", "#FFFFFF"); } } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } } } else { await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } } await _dialogService.CloseLoadingPopup(pop); }
public override async Task InitializeAsync(object navigationData) { var pop = await _dialogService.OpenLoadingPopup(); _vacancyID = (Guid)navigationData; dynamic obj = await _candidateJobService.GetVacancyDetails(_vacancyID); DateTime opendate; try { opendate = DateTime.Parse(obj["jobDetail"]["OpenDate"].ToString()); } catch { opendate = DateTime.MinValue; } TimeSpan opendateInt = DateTime.Now - opendate; if (obj["jobDetail"] != null) { string Title = obj["jobDetail"]["Title"]; string worksiteName = obj["jobDetail"]["WorksiteName"]; bool isPromoted = obj["jobDetail"]["IsPromoted"]; string jobType = obj["jobDetail"]["JobType"]; string salary = obj["jobDetail"]["Salary"]; string status = obj["jobDetail"]["Status"]; string description = ""; if (obj["jobDetail"]["Description"] != null) { description = Utilities.HtmlToPlainText(obj["jobDetail"]["Description"].ToString()); } Models.Account account = new Models.Account(); if (obj["jobDetail"]["Account"] != null) { account = JsonConvert.DeserializeObject <Models.Account>(obj["jobDetail"]["Account"].ToString()); } List <JobRequire> requires; if (obj["requiredList"] != null) { requires = JsonConvert.DeserializeObject <List <JobRequire> >(obj["requiredList"].ToString()); } else { requires = new List <JobRequire>(); } Job = new Vacancy { VacancyID = _vacancyID, Title = Title, WorksiteName = worksiteName, IsPromoted = isPromoted, JobType = jobType, Salary = salary, Status = status, OpenDate = opendate, OpenDateInt = (int)opendateInt.TotalDays, Description = description, Account = account, Requires = requires, }; } await _dialogService.CloseLoadingPopup(pop); }
public override async Task InitializeAsync(object navigationData) { var pop = await _dialogService.OpenLoadingPopup(); var contactID = App.ContactID; dynamic obj = await _candidateDetailService.GetEmployerCandidateDetail(); //Get all list educationList = JsonConvert.DeserializeObject <List <ContactEducation> >(obj["Educations"].ToString()); workExprienceList = JsonConvert.DeserializeObject <List <ContactWorkExprience> >(obj["WorkExperiences"].ToString()); skillList = JsonConvert.DeserializeObject <List <ContactSkill> >(obj["Skills"].ToString()); qualificationList = JsonConvert.DeserializeObject <List <ContactQualification> >(obj["Qualifications"].ToString()); licenceList = JsonConvert.DeserializeObject <List <ContactLicence> >(obj["Licences"].ToString()); documentList = JsonConvert.DeserializeObject <List <Document> >(obj["Documents"].ToString()); referenceList = JsonConvert.DeserializeObject <List <ContactReference> >(obj["References"].ToString()); List <InterestedRole> roles = JsonConvert.DeserializeObject <List <InterestedRole> >(obj["Role"].ToString()); List <ContactLink> contactLinks = new List <ContactLink>(); contactLinks.Add(new ContactLink { Title = obj["CandidateDetails"]["Email"], IconSource = "icon_email.png" }); contactLinks.Add(new ContactLink { Title = obj["CandidateDetails"]["Phone"], IconSource = "icon_phone.png" }); contactLinks.Add(new ContactLink { Title = obj["CandidateDetails"]["CityName"], IconSource = "icon_address.png" }); string interestedRoles = ""; for (var i = 0; i < roles.Count; i++) { interestedRoles += roles[i].Name + ", "; } interestedRoles = interestedRoles.Substring(0, interestedRoles.Length - 2); Profile = new Contact() { UserID = contactID, AvatarUrl = RequestService.HOST_NAME + "api/Document/GetContactImage?id=" + obj["CandidateDetails"]["ProfileImage"], CoverUrl = RequestService.HOST_NAME + "api/Document/GetContactImage?id=" + obj["CandidateDetails"]["CoverImage"], FullName = obj["CandidateDetails"]["FullName"], RoleAndAddress = interestedRoles + " - " + obj["CandidateDetails"]["CityName"], Greeting = "Hi, I am " + obj["CandidateDetails"]["FullName"], Introduction = Utilities.HtmlToPlainText(obj["CandidateDetails"]["AboutMe"].ToString()), //Educations = educationList, //WorkExpriences = workExprienceList, //Skills = skillList, //Qualifications = qualificationList, //Licences = licenceList, //Documents = documentList, //References = referenceList, ContactLinks = contactLinks }; CandidateMainViewModel.Current.PositionCity = "Candidate" + " • " + obj["CandidateDetails"]["CityName"]; CandidateMainViewModel.Current.UserName = obj["CandidateDetails"]["FullName"]; ContactLinksListViewHeightRequest = Profile.ContactLinks.Count * 27; GetBindingDocument(); GetBindingEducation(); GetBindingQualification(); GetBindingReference(); GetBindingSkill(); GetBindingWorkExprience(); GetBindinLicence(); CandidateMainViewModel.Current.IsProfilePageRendered = true; await _dialogService.CloseLoadingPopup(pop); }
private async Task BtnSaveLicenceCommandAsync() { ContactLicence licence = new ContactLicence { MeasurementName = _type, MeasurementNumber = _number.ToString(), Description = _comment, From = _fromDate, DateFromString = _fromDate.HasValue ? _fromDate.Value.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture) : "", To = _toDate, DateToString = _toDate.HasValue ? _toDate.Value.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture) : "", }; var pop = await _dialogService.OpenLoadingPopup(); Dictionary <string, object> obj = await _candidateDetailsService.AddLicence(licence); if (obj != null) { try { if (obj["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Add new Licence Successefully", "#52CD9F", "#FFFFFF"); if (stream != null) { Dictionary <string, object> objupload = await _candidateDetailsService.SaveContactLicenceAttachment(obj["Result"].ToString(), stream); if (objupload != null) { try { if (objupload["Success"].ToString() == "true") //success { await _dialogService.PopupMessage("Attach file Successefully", "#52CD9F", "#FFFFFF"); await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } else if (objupload["Success"].ToString() == "false") { if (objupload["Message"].ToString() == "Fail") { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); } else if (objupload["Message"].ToString() == "NodocumentFile") { await _dialogService.PopupMessage("Attach file Fail, please try again!!", "#CF6069", "#FFFFFF"); } } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } } } else { await PopupNavigation.Instance.PopAllAsync(); await _navigationService.NavigateToAsync <CandidateMainViewModel>(); } } } catch { await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF"); await _dialogService.CloseLoadingPopup(pop); } } await _dialogService.CloseLoadingPopup(pop); }