public IEnumerable <CandidatesResponse> Get() { var api = HRApi.getApi(); var command = new CandidateCommand(); var res = api.Execute(command); var result = JsonConvert.DeserializeObject <CandidatesBeanResponse>(res, CandidateJSONResponseConverter.getInstance()); return(result.Candidates); }
public string AuthenticateExternal(string tkn) { var token = new TokenDTO() { Token = tkn }; var api = HRApi.getApi(); var command = new ExternalAuthenticationCommand(token); var res = api.Execute(command); var result = JsonConvert.DeserializeObject <TokenDTO>(res); return(result.Token); }
public string Authenticate(string userName, string password) { //API ENDPOINT HttpCommand.Setup(Constants.APIEndpoint); HRApi.getApi().Setup(userName, password); var api = HRApi.getApi(); var command = new CandidateCommand(); var res = api.Execute(command); //var resultss = JsonConvert.DeserializeObject<IEnumerable<Candidate>>(res); var result = JsonConvert.DeserializeObject <TokenDTO>(res); return(result.Token); }
public static void Initialize() { ContainerBuilder builder = new ContainerBuilder(); builder.RegisterType <HomeViewModel>().AsSelf(); builder.RegisterType <LoginViewModel>().AsSelf(); builder.RegisterType <CandidateViewModel>().AsSelf(); builder.RegisterInstance <IHRApi>(HRApi.getApi()).SingleInstance(); builder.RegisterType <LoginService>().As <ILoginService>(); builder.RegisterType <CandidateService>().As <ICandidateService>(); builder.RegisterType <ProcessService>().As <IProcessService>(); IContainer container = builder.Build(); AutofacServiceLocator asl = new AutofacServiceLocator(container); ServiceLocator.SetLocatorProvider(() => asl); }
public App() { InitializeComponent(); Items = new ObservableCollection <string>(); var listview = new ListView(); listview.ItemsSource = Items; listview.ItemAppearing += (sender, e) => { if (isLoading || Items.Count == 0) { return; } //hit bottom! if (e.Item.ToString() == Items[Items.Count - 1]) { LoadItems(); } }; // The root page of your application page = new ContentPage { Content = new StackLayout { VerticalOptions = LayoutOptions.Center, Children = { listview } } }; HttpCommand.Setup(AppSettingsManager.Settings[Constants.BaseApiUrl]); HRApi.getApi().Setup("AA", "bb"); MainPage = new NavigationPage(new LoginView()); LoadItems(); }