Exemplo n.º 1
0
Arquivo: Shop.cs Projeto: Unul/OWMA-wp
 public static async Task<Shops> GetAll(Event oEvent)
 {
     var response = await Network.Get("/events/" + oEvent.id + "/shops");
     if (response.IsSuccessStatusCode)
         return Network.Deserialize<Shops>(await response.Content.ReadAsStringAsync());
     var errorHandler = Network.Deserialize<ErrorHandler>(await response.Content.ReadAsStringAsync());
     Utils.Notify("Une erreur s'est produite", errorHandler.errors.First().message);
     return null;
 }
Exemplo n.º 2
0
 public static async Task<bool> Create(Event oEvent)
 {
     var response = await Network.Post("/events", Network.Serialize(oEvent), true);
     if (response.IsSuccessStatusCode)
         return true;
     var errorHandler = Network.Deserialize<ErrorHandler>(await response.Content.ReadAsStringAsync());
     Utils.Notify("Une erreur s'est produite", errorHandler.errors.First().message);
     return false;
 }