Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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)
            {
            }
        }
Ejemplo n.º 4
0
        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")
 {
 }
Ejemplo n.º 7
0
 public ZohoInvoicesService(ZohoClient client, IOptions <ApplicationSettings> applicationSettings)
 {
     this.client = client;
     this.applicationSettings = applicationSettings.Value;
 }
Ejemplo n.º 8
0
 internal ZohoContactResource(ZohoClient client) : base(client, "contact", "contacts")
 {
 }
Ejemplo n.º 9
0
 internal ZohoItemResource(ZohoClient client) : base(client, "item", "items")
 {
 }
Ejemplo n.º 10
0
 internal ZohoPurchaseOrderResource(ZohoClient client) : base(client, "purchaseorder", "purchaseorders")
 {
 }
Ejemplo n.º 11
0
 internal ZohoCurrencyResource(ZohoClient client) : base(client, "currency", "settings", "currencies")
 {
 }