async void ExecuteServicoCommand() { if (!IsBusy) { try { IsBusy = true; Servico = new CVService(key, url); Model = await Servico.CVSUrlAsync(Url); ExibirLista(Model); } catch (System.Exception ex) { await DisplayAlert("Erro!", $"Erro:{ex.Message}", "Ok"); } finally { IsBusy = false; } } return; }
async Task ExecuteStreamCommand() { if (!IsBusy) { try { IsBusy = true; Servico = new CVService(key, urlStream); if (_imagemStream == null) { await DisplayAlert("Erro", "Nenhuma imagem selecionada", "Ok"); } Model = await Servico.CVSStreamAsync(_imagemStream); ExibirLista(Model); } catch (System.Exception ex) { await DisplayAlert("Erro!", $"Erro:{ex.Message}", "Ok"); } finally { IsBusy = false; } } return; }
private async void LoadData() { //var json = IOService.Load("C:\\input.txt"); //await Task.Delay(1000); var json = await Task.Run(() => CVService.GetDataFile("https://raw.githubusercontent.com/mrsteffenjo/cvpartner-timeline-backend/master/cvpartner-timeline-backend/src/test/resources/timeline.json")); LoadJSONTimeLineData(json); }
async void MainViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "SelectedEmployee" && SelectedEmployee != null) { IsBusy = true; var cvStream = await Task.Run(() => CVService.GetCV(SelectedEmployee)); LoadCV(cvStream); IsBusy = false; } }
static void Main(string[] args) { Experience exp = new Experience { id = 10, from = new DateTime(), to = new DateTime(), poste = "engineer", company = "Vermeg" }; Organisation org = new Organisation { City = "Monastir", Country = "Tunisia", Name = "ISIMM" }; Education educ = new Education { id = 10, from = new DateTime(), to = new DateTime(), organisation = org, }; Address adr = new Address { address = "C5 , C6 N°2 ", city = "Monastir", country = "Tunisia" }; Candidate cand = new Candidate { id = 10, address = adr, age = 24, birthDate = new DateTime(), email = "*****@*****.**", name = "Ala", phone = "50280400", sex = "Male", surname = "Ben khlifa" }; var listedu = new Education[10]; CVService CVS = new CVService(); CV c = CVS.GetById(2); EducationService ES = new EducationService(); listedu = c.educations.ToArray(); Console.WriteLine(ES.GetById(listedu[0].id).title); var listexp = new List <Experience>(); var listlang = new List <Languages>(); //listlang.Add(lang); //listexp.Add(exp); //listedu.Add(educ); CV cv = new CV { candidate = cand, departement = "RH", educations = listedu, experiences = listexp, hobbies = "FootBall", languages = listlang, linkedInLink = "URL", typeofjob = "Engineer" }; Languages lang = new Languages { level = "Native", name = "AR", cv = cv }; //LanguageService LS = new LanguageService(); //LS.Add(lang); //LS.Commit(); //ExperienceService ES = new ExperienceService(); //ES.Add(exp); //ES.Commit(); //EducationService EDS = new EducationService(); //EDS.Add(educ); //EDS.Commit(); //var con = CAS.GetById(2); //Console.WriteLine(con.email); //CAS.Add(cand); //CAS.Commit(); //CVService CVS = new CVService(); //CVS.Add(cv); //CVS.Commit(); Console.ReadKey(); }