Ejemplo n.º 1
0
        public async Task <int> save(ShippingCompanies item)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();
            string method    = "ShippingCompanies/Save";
            var    myContent = JsonConvert.SerializeObject(item);

            parameters.Add("itemObject", myContent);
            return(await APIResult.post(method, parameters));
        }
Ejemplo n.º 2
0
        public async Task <ShippingCompanies> GetByID(int itemId)
        {
            ShippingCompanies           item       = new ShippingCompanies();
            Dictionary <string, string> parameters = new Dictionary <string, string>();

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

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