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

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

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

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