Beispiel #1
0
        public async Task SaveIdiomsAsync(Idioms idioms, bool isNewIdioms)
        {
            var uri = new Uri(string.Format("{0}/{1}", Constant.AddIdiomsUrl, idioms.Id));

            try
            {
                var json    = JsonConvert.SerializeObject(idioms);
                var content = new StringContent(json, Encoding.UTF8, "application/json");

                HttpResponseMessage response = null;
                if (isNewIdioms)
                {
                    response = await client.PostAsync(uri, content);
                }
                else
                {
                    response = await client.PutAsync(uri, content);
                }
                if (response.IsSuccessStatusCode)
                {
                    Debug.WriteLine(@"trongan93-  Sucessfully Saved");
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(@"trongan93-Error: {0}", ex.Message);
            }
        }
Beispiel #2
0
 public Task DeleteTaskAsync(Idioms item)
 {
     return(_coliService.DeleteIdiomsAsync(item.Id));
 }
Beispiel #3
0
 public Task SaveTaskIdiomAsync(Idioms item, bool isNewItem = false)
 {
     return(_coliService.SaveIdiomsAsync(item, isNewItem));
 }