using RestSharp; using System; using System.Collections.Generic; using Tanshu.Accounts.Entities; namespace Tanshu.Accounts.Repository { public static class TaxBI { public static IList List() { var request = new RestRequest(); request.Resource = "Taxes.json"; return JsonStore.Execute>(request); } public static Tax Get(Guid id) { var request = new RestRequest(); request.Resource = "Tax/{id}.json"; request.AddParameter("id", id, ParameterType.UrlSegment); return JsonStore.Execute(request); } public static Tax Delete(Guid id) { var request = new RestRequest(Method.DELETE); request.Resource = "Tax/{id}.json"; request.AddParameter("id", id, ParameterType.UrlSegment); return JsonStore.Execute(request); } public static Tax Insert(Tax tax) { var request = new RestRequest(Method.PUT); request.Resource = "Tax.json"; request.AddJsonBody(tax); return JsonStore.Execute(request); } public static Tax Update(Tax tax) { var request = new RestRequest(Method.POST); request.Resource = "Tax/{id}.json"; request.AddParameter("id", tax.TaxID, ParameterType.UrlSegment); request.AddJsonBody(tax); return JsonStore.Execute(request); } } }