public static async Task DeleteOrderItemAsync(string orderId) { try { var req = await BestConcertManagement.DeleteOrderItemAsync(orderId); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static async Task <string> AddOrderItemAsync(string token, string concertId, string quantity) { try { return(await BestConcertManagement.AddOrderItemAsync(token, concertId, quantity)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static async Task <UserModel> GetUserAsync(string token) { try { var req = await BestConcertManagement.GetUserAsync(token); var result = JsonConvert.DeserializeObject <UserModel>(req); return(result); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static async Task <List <Order> > GetHistoryOrdersFromUserIdAsync(string token) { try { var req = await BestConcertManagement.GetHistoryOrdersFromUserIdAsync(token); var result = JsonConvert.DeserializeObject <List <Order> >(req); return(result); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static async Task <Order> GetCurrentOrderFromUserTokenAsync(object token) { try { var req = await BestConcertManagement.GetCurrentOrderFromUserTokenAsync(token.ToString()); var result = JsonConvert.DeserializeObject <Order>(req); return(result); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static async Task <List <ConcertModel> > GetConcertByArtistAsync(string artist) { try { var req = await BestConcertManagement.GetConcertByArtistAsync(artist); var result = JsonConvert.DeserializeObject <List <ConcertModel> >(req); return(result); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static async Task <UserModel> SetUserAsync(string token, string firstName, string lastName, string password, string email, string address) { try { var req = await BestConcertManagement.SetUserAsync(token, firstName, lastName, password, email, address); var result = JsonConvert.DeserializeObject <UserModel>(req); return(result); } catch (Exception ex) { throw new Exception(ex.Message); } }
/// <summary> /// Vérification de la connection au site /// </summary> /// <param name="username"></param> /// <param name="password"></param> /// <returns>Boolean</returns> public static async Task <object[]> SignInAsync(string username, string password) { try { var result = await BestConcertManagement.Login(username, password); if ((bool)result[0]) { result[1] = JsonConvert.DeserializeObject <UserModel>((string)result[1]); } return(result); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static async Task <UserModel> AddUserAsync(string firstName, string lastName, string password, string email, string address) { try { if (String.IsNullOrEmpty(firstName) && String.IsNullOrEmpty(lastName) && String.IsNullOrEmpty(password) && String.IsNullOrEmpty(email)) { throw new Exception("Invalid Parameter !"); } var req = await BestConcertManagement.AddUserAsync(firstName, lastName, password, email, address); var result = JsonConvert.DeserializeObject <UserModel>(req); return(result); } catch (Exception ex) { throw new Exception(ex.Message); } }