Exemplo n.º 1
0
 public override bool InsertAddWeight(AddWeight parAddWeight)
 {
     using (var DB = new SQLite(ConfigFile))
     {
         return(DB.ExecuteNonQuery <AddWeight>(SqlInsertAddWeight, parAddWeight) > 0);
     }
 }
Exemplo n.º 2
0
        public static async Task <bool> AddWeightUser(decimal weight, DateTime date, string description)
        {
            var register = new AddWeight()
            {
                weight      = weight,
                date        = date,
                description = description
            };

            var httpClient = new HttpClient();

            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("bearer", Preferences.Get("accessToken", string.Empty));
            var jsonSerialized = JsonConvert.SerializeObject(register);
            var content        = new StringContent(jsonSerialized, Encoding.UTF8, "application/json");

            var response = await httpClient.PostAsync(Settings.Url + "/weight", content);

            if (!response.IsSuccessStatusCode)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 3
0
 public virtual bool InsertAddWeight(AddWeight parAddWeight)
 {
     return(db.ExecuteNonQuery <AddWeight>(SqlInsertAddWeight, parAddWeight) > 0);
 }