// adding or editing category by calling API metod "save" // if propertyItemId = 0 will call save else call edit public async Task <int> save(PropertiesItems item) { Dictionary <string, string> parameters = new Dictionary <string, string>(); string method = "propertiesItems/Save"; var myContent = JsonConvert.SerializeObject(item); parameters.Add("itemObject", myContent); return(await APIResult.post(method, parameters)); }
//******************************************************** //****************** get values of property public async Task <PropertiesItems> getById(int itemId) { PropertiesItems item = new PropertiesItems(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("itemId", itemId.ToString()); //################# IEnumerable <Claim> claims = await APIResult.getList("PropertiesItems/GetPropItemByID", parameters); foreach (Claim c in claims) { if (c.Type == "scopes") { item = JsonConvert.DeserializeObject <PropertiesItems>(c.Value, new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" }); break; } } return(item); }