Exemple #1
0
 private static bool CheckLogin(UpdateResultWithId loginResult)
 {
     if (!loginResult.Result)
     {
         Console.WriteLine("Login error. Please check your credentials");
     }
     else
     {
         Console.WriteLine($"Successfully logged using API. User Id  :{loginResult.NewId}");
     }
     return(loginResult.Result);
 }
Exemple #2
0
        static void DemoSynchronousCalls(LoginClient login, EmployesClient rh)
        {
            Console.WriteLine("Synchronous calls demo");
            //Example of Sync conde
            //Call Login api. This call will also set up necessary cookie
            UpdateResultWithId loginResult = login.ApiLogin(apiKey);

            if (!CheckLogin(loginResult))
            {
                return;
            }
            //getting list of actives (not deleted) users
            var employyes = rh.GetAllRessources(true);

            PrintUsers(employyes);
            //logining out. This is for demo purpose only
            _ = login.LogOut();
        }