narsil/Tanshu.Accounts.Repository/SalesAnalysisBI.cs

52 lines
2.4 KiB
C#
Raw Normal View History

2018-08-24 10:41:33 +00:00
using RestSharp;
using System;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Repository
{
2018-08-24 10:41:33 +00:00
public static class SalesAnalysisBI
{
2018-08-24 10:41:33 +00:00
public static IList<SalesAnalysis> GetSale(DateTime startDate, DateTime finishDate)
{
2018-08-24 10:41:33 +00:00
var request = new RestRequest();
request.Resource = "SaleAnalysis/Sale.json";
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
return JsonStore.Execute<List<SalesAnalysis>>(request);
}
2018-08-24 10:41:33 +00:00
public static IList<SalesAnalysis> GetSettlements(DateTime startDate, DateTime finishDate)
{
2018-08-24 10:41:33 +00:00
var request = new RestRequest();
request.Resource = "SaleAnalysis/Settlements.json";
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
return JsonStore.Execute<List<SalesAnalysis>>(request);
}
2018-08-24 10:41:33 +00:00
public static SalesAnalysis GetServiceCharge(DateTime startDate, DateTime finishDate)
{
2018-08-24 10:41:33 +00:00
var request = new RestRequest();
request.Resource = "SaleAnalysis/ServiceCharge.json";
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
return JsonStore.Execute<SalesAnalysis>(request);
}
2018-08-24 10:41:33 +00:00
public static IList<TaxAnalysis> GetServiceTax(DateTime startDate, DateTime finishDate)
{
2018-08-24 10:41:33 +00:00
var request = new RestRequest();
request.Resource = "SaleAnalysis/ServiceTax.json";
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
return JsonStore.Execute<List<TaxAnalysis>>(request);
}
2018-08-24 10:41:33 +00:00
public static IList<TaxAnalysis> GetVat(DateTime startDate, DateTime finishDate)
{
2018-08-24 10:41:33 +00:00
var request = new RestRequest();
request.Resource = "SaleAnalysis/Vat.json";
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
return JsonStore.Execute<List<TaxAnalysis>>(request);
}
}
}