public async Task GetJoinTravel(TravelReqModel model) { HttpResponseMessage req = await client.PostAsync("http://ersu.net/appwebservice/rezervasyon.php", new FormUrlEncodedContent( new Dictionary <string, string>() { { "isimSoyisim", model.isimSoyisim }, { "email", model.email }, { "gsm", model.gsm }, { "ilteti", model.turname } })); if (req != null && req.IsSuccessStatusCode) { var data = await req.Content.ReadAsStringAsync(); } }
private async void GetJoinTravelRequest() { try { if (!string.IsNullOrEmpty(nameSurname.Text) && !string.IsNullOrEmpty(email.Text) && !string.IsNullOrEmpty(gsm.Text)) { contactText.Text = "GÖNDERİLİYOR"; var model = new TravelReqModel() { isimSoyisim = nameSurname.Text, email = email.Text, gsm = gsm.Text, turname = TravelDetailsView.travel.gezi }; await App.Client.GetJoinTravel(model); var newMessage = new MessageDialog("Sizinle en kısa zamanda bağlantıya geçeceğim. Özge Ersu", "Teşekkür ederim"); IUICommand result = await newMessage.ShowAsync(); nameSurname.Text = ""; email.Text = ""; gsm.Text = ""; contactText.Text = "GÖNDER"; Frame.GoBack(); } else { var newMessage = new MessageDialog("Eksik bilgi girdiniz.", "Lütfen"); IUICommand result = await newMessage.ShowAsync(); } } catch (Exception) { contactText.Text = "GÖNDER"; } }