using System; using System.Collections.Generic; using Tanshu.Accounts.Entities; using RestSharp; namespace Tanshu.Accounts.Repository { public static class ModifierBI { public static IList List() { var request = new RestRequest(); request.Resource = "Modifiers.json"; return JsonStore.Execute>(request); } public static IList List(Guid productGroupID) { var request = new RestRequest(); request.Resource = "Modifiers.json"; request.AddQueryParameter("pg", productGroupID.ToString()); return JsonStore.Execute>(request); } public static Modifier Get(Guid id) { var request = new RestRequest(); request.Resource = "Modifier/{id}.json"; request.AddParameter("id", id, ParameterType.UrlSegment); return JsonStore.Execute(request); } public static Modifier Insert(Modifier modifier) { var request = new RestRequest(Method.PUT); request.Resource = "Modifier.json"; request.AddJsonBody(modifier); return JsonStore.Execute(request); } public static Modifier Update(Modifier modifier) { var request = new RestRequest(Method.POST); request.Resource = "Modifier/{id}.json"; request.AddParameter("id", modifier.ModifierID, ParameterType.UrlSegment); request.AddJsonBody(modifier); return JsonStore.Execute(request); } } }