Example #1
0
        static void Main(string[] args)
        {
            var employeeApi = new EmployeesApi("http://localhost:9000");

            employeeApi.Configuration.ApiClient.RestClient.Authenticator = new NtlmAuthenticator();

            foreach (var employee in employeeApi.EmployeesGet())
            {
                Console.WriteLine($"Id:{employee.Id} Name:{employee.Name} BirthDay:{employee.BirthDay}");
            }
            Console.ReadLine();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ParasutClient"/> class.
        /// </summary>
        /// <param name="url">The url<see cref="string"/>.</param>
        /// <param name="version">The version<see cref="string"/>.</param>
        /// <param name="companyId">The companyId<see cref="string"/>.</param>
        /// <param name="clientId">The clientId<see cref="string"/>.</param>
        /// <param name="clientSecret">The clientSecret<see cref="string"/>.</param>
        /// <param name="username">The username<see cref="string"/>.</param>
        /// <param name="password">The password<see cref="string"/>.</param>
        public ParasutClient(string url          = null,
                             string version      = null,
                             string companyId    = null,
                             string clientId     = null,
                             string clientSecret = null,
                             string username     = null,
                             string password     = null) : base()
        {
            Url          = ParasutApiSettings.Url(url);
            Version      = ParasutApiSettings.Version(version);
            CompanyId    = ParasutApiSettings.CompanyId(companyId);
            ClientId     = ParasutApiSettings.ClientId(clientId);
            ClientSecret = ParasutApiSettings.ClientSecret(clientSecret);
            Username     = ParasutApiSettings.Username(username);
            Password     = ParasutApiSettings.Password(password);

            GenerateConfiguration();



            Home            = new ApiHomeApi(Configuration);
            ItemCategories  = new ItemCategoriesApi(Configuration);
            Accounts        = new AccountsApi(Configuration);
            BankFees        = new BankFeesApi(Configuration);
            Contacts        = new ContactsApi(Configuration);
            EArchives       = new EArchivesApi(Configuration);
            EInvoiceInboxes = new EInvoiceInboxesApi(Configuration);
            EInvoices       = new EInvoicesApi(Configuration);
            Employees       = new EmployeesApi(Configuration);
            Products        = new ProductsApi(Configuration);
            PurchaseBills   = new PurchaseBillsApi(Configuration);
            Salaries        = new SalariesApi(Configuration);
            SalesInvoices   = new SalesInvoicesApi(Configuration);
            Tags            = new TagsApi(Configuration);
            Taxes           = new TaxesApi(Configuration);
            TrackableJobs   = new TrackableJobsApi(Configuration);
            Transactions    = new TransactionsApi(Configuration);
        }
 public void Init()
 {
     instance = new EmployeesApi();
 }