/// <summary> /// /////////////////////////////////////// /// </summary> /// <returns></returns> /// public async Task <List <PosSerials> > GetAll() { List <PosSerials> list = new List <PosSerials>(); // Dictionary<string, string> parameters = new Dictionary<string, string>(); //parameters.Add("mainBranchId", mainBranchId.ToString()); //parameters.Add("userId", userId.ToString()); //parameters.Add("date", date.ToString()); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetAll"); foreach (Claim c in claims) { if (c.Type == "scopes") { list.Add(JsonConvert.DeserializeObject <PosSerials>(c.Value, new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" })); } } return(list); //List<PosSerials> memberships = null; //HttpResponseMessage response = new HttpResponseMessage(); //using (var client = new HttpClient()) //{ // Uri uri = new Uri(Global.APIUri + urimainpath + "GetAll"); // response = await ApiConnect.ApiGetConnect(uri); // response = await ApiConnect.ApiGetConnect(uri); // if (response.IsSuccessStatusCode) // { // var jsonString = await response.Content.ReadAsStringAsync(); // memberships = JsonConvert.DeserializeObject<List<PosSerials>>(jsonString); // return memberships; // } // else //web api sent error response // { // memberships = new List<PosSerials>(); // } // return memberships; //} }
public async Task <int> GetLastNum(string Code) { int count = 0; Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("payOpCode", Code); //################# IEnumerable <Claim> claims = await APIResult.getList("PayOp/GetLastNum", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { count = int.Parse(c.Value); break; } } return(count); }
public async Task <List <PaymentsSts> > GetAllPayments() { List <PaymentsSts> list = new List <PaymentsSts>(); Dictionary <string, string> parameters = new Dictionary <string, string>(); // parameters.Add("agentId", agentId.ToString()); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetAllPayments"); foreach (Claim c in claims) { if (c.Type == "scopes") { list.Add(JsonConvert.DeserializeObject <PaymentsSts>(c.Value, new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" })); } } return(list); }
public async Task <Versions> GetByID(int verId) { Versions item = new Versions(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("verId", verId.ToString()); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetByID", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { item = JsonConvert.DeserializeObject <Versions>(c.Value, new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" }); break; } } return(item); //Versions obj = new Versions(); //HttpResponseMessage response = new HttpResponseMessage(); //using (var client = new HttpClient()) //{ // Uri uri = new Uri(Global.APIUri + urimainpath + "GetByID?verId=" + verId); // response = await ApiConnect.ApiGetConnect(uri); // if (response.IsSuccessStatusCode) // { // var jsonString = await response.Content.ReadAsStringAsync(); // obj = JsonConvert.DeserializeObject<Versions>(jsonString); // return obj; // } // return obj; //} }
// public async Task <List <GroupObject> > GetUserpermission(int userId) { List <GroupObject> list = new List <GroupObject>(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("userId", userId.ToString()); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetUserpermission", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { list.Add(JsonConvert.DeserializeObject <GroupObject>(c.Value, new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" })); } } return(list); }
/// <summary> /// /////////////////////////////////////// /// </summary> /// <returns></returns> /// public async Task <List <AgentPackage> > GetAll() { List <AgentPackage> list = new List <AgentPackage>(); // Dictionary<string, string> parameters = new Dictionary<string, string>(); //parameters.Add("mainBranchId", mainBranchId.ToString()); //parameters.Add("userId", userId.ToString()); //parameters.Add("date", date.ToString()); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetAll"); foreach (Claim c in claims) { if (c.Type == "scopes") { list.Add(JsonConvert.DeserializeObject <AgentPackage>(c.Value, new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" })); } } return(list); }
public async Task <List <CountryPackageDate> > GetByCustomerPackId(int customerId, int packageId) { List <CountryPackageDate> list = new List <CountryPackageDate>(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("customerId", customerId.ToString()); parameters.Add("packageId", packageId.ToString()); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetByCustomerPackId", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { list.Add(JsonConvert.DeserializeObject <CountryPackageDate>(c.Value, new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" })); } } return(list); }
public async Task <int> updatecustomerdata(SendDetail SendDetaildata, string activeState) { int item = 0; Dictionary <string, string> parameters = new Dictionary <string, string>(); var myContent3 = JsonConvert.SerializeObject(SendDetaildata); parameters.Add("object", myContent3); parameters.Add("activeState", activeState); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "updatecustomerdata", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { item = int.Parse(c.Value); } } return(item); }
public async Task <GroupObject> GetByID(int valId) { GroupObject item = new GroupObject(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("Id", valId.ToString()); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetByID", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { item = JsonConvert.DeserializeObject <GroupObject>(c.Value, new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" }); break; } } return(item); }
public async Task <string> isExistCode(string packageCode) { string item = ""; Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("packageCode", packageCode); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "isExistCode", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { item = c.Value; break; } } return(item); //string obj = ""; //HttpResponseMessage response = new HttpResponseMessage(); //using (var client = new HttpClient()) //{ // Uri uri = new Uri(Global.APIUri + urimainpath + "isExistCode?packageCode=" + packageCode); // response = await ApiConnect.ApiGetConnect(uri); // if (response.IsSuccessStatusCode) // { // var jsonString = await response.Content.ReadAsStringAsync(); // obj = JsonConvert.DeserializeObject<string>(jsonString); // return obj; // } // return obj; //} }
public async Task <SendDetail> ActivateServerOffline(int packageUserId, string activeState) { SendDetail item = new SendDetail(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("packageUserId", packageUserId.ToString()); parameters.Add("activeState", activeState); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "ActivateServerOffline", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { item = JsonConvert.DeserializeObject <SendDetail>(c.Value, new JsonSerializerSettings { DateParseHandling = DateParseHandling.None }); } } return(item); }
public async Task <SendDetail> Activateserver(string packageSaleCode, string customerServerCode) { SendDetail item = new SendDetail(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("packageSaleCode", packageSaleCode); parameters.Add("customerServerCode", customerServerCode); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "ActivateServer", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { item = JsonConvert.DeserializeObject <SendDetail>(c.Value, new JsonSerializerSettings { DateParseHandling = DateParseHandling.None }); } } return(item); }
public async Task <PayOp> getLastPayOp(int packageUserId) { PayOp item = new PayOp(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("packageUserId", packageUserId.ToString()); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "getLastPayOp", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { item = JsonConvert.DeserializeObject <PayOp>(c.Value, new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" }); break; } } return(item); }
public async Task <int> GetLastNumOfCode(string type) { int item = 0; Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("type", type); //################# IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetLastNumOfCode", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { item = int.Parse(c.Value); break; } } return(item); //HttpResponseMessage response = new HttpResponseMessage(); //using (var client = new HttpClient()) //{ // Uri uri = new Uri(Global.APIUri + urimainpath + "GetLastNumOfCode?type=" + type); // response = await ApiConnect.ApiGetConnect(uri); // if (response.IsSuccessStatusCode) // { // string message = await response.Content.ReadAsStringAsync(); // message = JsonConvert.DeserializeObject<string>(message); // return int.Parse(message); // } // return 0; //} }