Exemplo n.º 1
0
        // Constructor

        #region ApiClient()
        public ApiClient(IApiClientSettings settings = null)
        {
            // Settings

            settings = settings ?? ApiClientSettings.Default;

            // Mapping

            MappingInstaller.Register();

//#if DEBUG
            ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); };
//#endif
            //Cache = cache;
            //Context = context;

            Accounts      = new AccountsClient(settings);
            Activations   = new ActivationsClient(Mapper.Engine, settings);
            Activities    = new ActivitiesClient(Mapper.Engine, settings);
            CalendarItems = new CalendarItemsClient(Mapper.Engine, settings);
            Devices       = new DevicesClient(Mapper.Engine, settings);
            People        = new PeopleClient(Mapper.Engine, settings);

            //People = new CachingPeopleService(Context);
        }
Exemplo n.º 2
0
        public ActionResult People(People FormSelected)
        {
            PeopleClient pClient = new PeopleClient();

            ViewBag.Countries = pClient.getAllCountries();
            ViewBag.Cities = pClient.selectCities(FormSelected.Country);
            ViewBag.Villages = pClient.selectVillages(FormSelected.City);
            ViewBag.People = pClient.selectPeople(FormSelected.Village);
            return View();
        }
 public bool IndexCreation(string indexName, bool forceCreate)
 {
     try
     {
         _client = new PeopleClient(_appSettings.Server, _appSettings.Port, indexName, true);
         return(forceCreate ? _client.CreateIndex() : _client.CheckConnection());
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(false);
     }
 }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("press enter to go...");

            Console.ReadLine();

            var client = new PeopleClient("HostedPeople");

            //var client = new PeopleClient("local");

            var rv = client.GetDataAsync(1).Result;

            Console.WriteLine("{0} - {1} - {2}", rv.Id, rv.familyName, rv.givenName);

            Console.WriteLine("press enter to go...");

            Console.ReadLine();
        }
Exemplo n.º 5
0
        public GenericDashboardController() : base()
        {
            RigOapChecklistClient = new RigOapChecklistClient(GetApiBaseUrl(), Client);

            OapChecklistClient = new OapChecklistClient(GetApiBaseUrl(), Client);

            PeopleClient = new PeopleClient(GetApiBaseUrl(), Client);

            Owner = CommonUtilities.GetUsers(PeopleClient);

            ChecklistType = "BRC";

            ChecklistSubType = "All";

            ChecklistStatus = "Open";

            FormType = "All";
        }
Exemplo n.º 6
0
        public void InitializeMocks()
        {
            BaseMock.Response             = null;
            BaseMock.ShouldThrowException = false;

            _dateTimeUtil = new DateTimeUtilMock();

            _teamsClientMock = TeamsClientMock.SetupMock();
            _teamsClient     = _teamsClientMock.Object;

            _positionsClientMock = PositionsClientMock.SetupMock();
            _positionsClient     = _positionsClientMock.Object;

            _holidaysClientMock = HolidaysClientMock.SetupMock();
            _holidaysClient     = _holidaysClientMock.Object;

            _dayOffsClientMock = DayOffsClientMock.SetupMock();
            _dayOffsClient     = _dayOffsClientMock.Object;

            _motivationModificatorsClientMock = MotivationModificatorsClientMock.SetupMock();
            _motivationModificatorsClient     = _motivationModificatorsClientMock.Object;

            _otherPaymentsClientMock = OtherPaymentsClientMock.SetupMock();
            _otherPaymentsClient     = _otherPaymentsClientMock.Object;

            _salaryClientMock = SalaryClientMock.SetupMock();
            _salaryClient     = _salaryClientMock.Object;

            _staffsClientMock = StaffClientMock.SetupMock();
            _staffsClient     = _staffsClientMock.Object;

            _peopleClientMock = PeopleClientMock.SetupMock();
            _peopleClient     = _peopleClientMock.Object;

            _roadMapsClientMock = RoadMapsClientMock.SetupMock();
            _roadMapsClient     = _roadMapsClientMock.Object;
        }
Exemplo n.º 7
0
        public static int?GetTourId(PeopleClient peopleClient, int userId)
        {
            var tourId = peopleClient.GetTourIdAsync(userId).Result?.Result?.Data;

            return(tourId);
        }
Exemplo n.º 8
0
        public static IEnumerable <Person> GetUsers(PeopleClient peopleClient)
        {
            var users = peopleClient.GetAllAsync().Result?.Result?.Data;

            return(users);
        }
Exemplo n.º 9
0
        public OapAuditController() : base()
        {
            OapAuditClient = new OapAuditClient(GetApiBaseUrl(), Client);

            PeopleClient = new PeopleClient(GetApiBaseUrl(), Client);
        }
 public PersonManager(IAdapter<PersonDTO> personAdapter, PeopleClient client)
 {
     this.personAdapter = personAdapter;
     this.client = client;
 }
Exemplo n.º 11
0
 public PeopleController(PeopleClient peopleClient, IEMSLogger <PeopleController> logger, IDateTimeUtil dateTimeUtil) :
     base(logger, dateTimeUtil)
 {
     _peopleClient = peopleClient;
 }
Exemplo n.º 12
0
 public PersonManager(IAdapter <PersonDTO> personAdapter, PeopleClient client)
 {
     this.personAdapter = personAdapter;
     this.client        = client;
 }