Пример #1
0
        public async Task EditSmartphone(SmartPhone s)
        {

            var httpclient = new HttpClient();
            //var Smartphone_json = JsonConvert.SerializeObjectAsync(s);
            HttpContent httpcontent = new StringContent(JsonConvert.SerializeObject(s));
            httpcontent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            httpclient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            var response = await httpclient.PutAsync(new Uri(Base_Url+s.Id), httpcontent);
        }
Пример #2
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.DataContext = App.Ds;
            Current_Item =  App.Ds.GetItem(e.Parameter.ToString());

        }
Пример #3
0
 public async Task DeleteSmartphone(SmartPhone s)
 {
     var httpclient = new HttpClient();
     var reponse = await httpclient.DeleteAsync(Base_Url + s.Id);
 }