public async void SaveCost() { CostingModel costingModel = new CostingModel() { Density = this.Density, Length = this.Length, Weight = this.Weight, Width = this.Width, Thickness = this.Thickness }; string requestUrl = "http://10.6.0.133/api/Test"; ServiceHandler serviceHandler = new ServiceHandler(); string jsonContent = JsonConvert.SerializeObject(costingModel); string result = await serviceHandler.PostRequest(requestUrl, jsonContent); //BaseResponse addGroupResponse = (BaseResponse)JsonConvert.DeserializeObject(result, typeof(BaseResponse)); }
public async void LoadCost(int id) { string requestUrl = "http://10.6.0.133/api/Test?id=" + id; ServiceHandler serviceHandler = new ServiceHandler(); string result = await serviceHandler.RequestData(requestUrl); //DimensionModel dimensionModel = (DimensionModel)JsonConvert.DeserializeObject(result, typeof(DimensionModel)); DimensionModel dimensionModel = new DimensionModel() { Density = 100, Length = 123, Weight = 12, Width = 33, Thickness = 3 }; this.Density = dimensionModel.Density; this.Length = dimensionModel.Length; this.Weight = dimensionModel.Weight; this.Width = dimensionModel.Width; this.Thickness = dimensionModel.Thickness; }