public async Task GetInvoice() { UrenCSVReader reader = new UrenCSVReader(Options.Create(applicationSettings)); var client = new ZohoClient(Options.Create(applicationSettings)); var invoiceService = new ZohoInvoicesService(client, Options.Create(applicationSettings)); var response = await invoiceService.GetInvoice("XXX"); Assert.IsNotNull(response); }
public async Task ShouldCreateInvoices() { UrenCSVReader reader = new UrenCSVReader(Options.Create(applicationSettings)); var client = new ZohoClient(Options.Create(applicationSettings)); var invoiceService = new ZohoInvoicesService(client, Options.Create(applicationSettings)); var createInZoho = false; var outputs = await invoiceService.CreateInvoices(reader.ReadRecords(), createInZoho); Assert.IsNotNull(outputs); }
private async Task DoTask() { IZohoClient zohoClient = new ZohoClient(new ZohoConfig { AuthToken = Environment.GetEnvironmentVariable("ZohoAuthToken", EnvironmentVariableTarget.User), OrganizationId = Environment.GetEnvironmentVariable("ZohoOrgId", EnvironmentVariableTarget.User) }); try { } catch (Exception exception) { } }
static void Main(string[] args) { var client = new ZohoClient(); // uncomment to use login\password to obtain token var login = File.ReadAllText("login.txt"); //var password = File.ReadAllText("password.txt"); //var token = client.LoginAsync(login, password).Result; var token = File.ReadAllText("token.txt"); client.Login(token); //var response = client.TimeTracker.TimeLog.GetAsync( // login, // new DateTime(2015, 07, 01), // new DateTime(2015, 07, 20)).Result; //var newLogId = client.TimeTracker.TimeLog.AddAsync( // login, // new DateTime(2015, 07, 30), // "269998000000314115", // TimeSpan.FromHours(8), // "non-billable").Result; //var isDeleter = client.TimeTracker.TimeLog.DeleteAsync(newLogId).Result; // test holidays //var holidays = client.Leave.GetHolidaysAsync(login).Result; //Console.WriteLine(string.Join("\n", // holidays.Select( // x => x.Name + " " + x.FromDate.ToString("yyyy-MM-dd" + " -> " + x.ToDate.ToString("yyyy-MM-dd"))))); // test fetch records var records = client.FetchRecord.GetByFormAsync("leave", SearchColumn.EMPLOYEEID, "20").Result; Console.WriteLine(records.Count); }
internal ZohoOrganizationResource(ZohoClient client) : base(client, "organization", "organizations") { }
internal ZohoSalesOrderResource(ZohoClient client) : base(client, "salesorder", "salesorders") { }
public ZohoInvoicesService(ZohoClient client, IOptions <ApplicationSettings> applicationSettings) { this.client = client; this.applicationSettings = applicationSettings.Value; }
internal ZohoContactResource(ZohoClient client) : base(client, "contact", "contacts") { }
internal ZohoItemResource(ZohoClient client) : base(client, "item", "items") { }
internal ZohoPurchaseOrderResource(ZohoClient client) : base(client, "purchaseorder", "purchaseorders") { }
internal ZohoCurrencyResource(ZohoClient client) : base(client, "currency", "settings", "currencies") { }