示例#1
0
文件: Shop.cs 项目: 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;
 }
示例#2
0
文件: Event.cs 项目: Unul/OWMA-wp
 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;
 }