Example #1
0
        public async Task <int> Save(AgentCustomer obj)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();
            string method = urimainpath + "Save";

            var myContent = JsonConvert.SerializeObject(obj);

            parameters.Add("Object", myContent);
            return(await APIResult.post(method, parameters));
        }
Example #2
0
        public async Task <AgentCustomer> GetByID(int agentCustomerId)
        {
            AgentCustomer item = new AgentCustomer();
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("agentCustomerId", agentCustomerId.ToString());
            //#################
            IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetByID", parameters);

            foreach (Claim c in claims)
            {
                if (c.Type == "scopes")
                {
                    item = JsonConvert.DeserializeObject <AgentCustomer>(c.Value, new IsoDateTimeConverter {
                        DateTimeFormat = "dd/MM/yyyy"
                    });
                    break;
                }
            }

            return(item);
        }