Guest User

Untitled

a guest
Nov 13th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. try
  2. {
  3. string url = Constants.requestUrl + "Host=" + host + "&Database=" + database + "&Request=Fsq6Tr";
  4. string contentType = "application/json";
  5. JObject json = new JObject
  6. {
  7. { "CAF", caf },
  8. { "CustomerID", retailerCode },
  9. { "EmployeeNumber", employeeNumber },
  10. { "Street", street },
  11. { "Barangay", barangay },
  12. { "Town", town },
  13. { "District", district },
  14. { "Province", province },
  15. { "Country", country },
  16. { "Landmark", landmark },
  17. { "Telephone1", telephone1 },
  18. { "Telephone2", telephone2 },
  19. { "Mobile", mobile },
  20. { "Email", email },
  21. { "Location", location },
  22. { "Date", Convert.ToDateTime(date) },
  23. { "StartTime", Convert.ToDateTime(startTime) },
  24. { "EndTime", Convert.ToDateTime(endTime) },
  25. { "Photo1", photo1 },
  26. { "Photo2", photo2 },
  27. { "Photo3", photo3 },
  28. { "Video", video },
  29. { "MobilePhoto1", photo1url },
  30. { "MobilePhoto2", photo2url },
  31. { "MobilePhoto3", photo3url },
  32. { "MobileVideo", videourl },
  33. { "Rekorida", rekorida },
  34. { "Merchandizing", merchandizing },
  35. { "TradeCheck", tradecheck },
  36. { "Others", others },
  37. { "OtherConcern", otherconcern },
  38. { "Remarks", remarks },
  39. { "LastSync", Convert.ToDateTime(current_datetime) },
  40. { "MobileUpdate", Convert.ToDateTime(current_datetime) }
  41. };
  42.  
  43. HttpClient client = new HttpClient();
  44. var response = await client.PostAsync(url, new StringContent(json.ToString(), Encoding.UTF8, contentType));
  45.  
  46. await DisplayAlert("Success!", "Form sent successfully!", "Got it");
  47. }
  48. catch (Exception ex)
  49. {
  50. await DisplayAlert(" Sending Error ", ex.Message, "Got it");
  51. }
Add Comment
Please, Sign In to add comment