/// <summary> /// Updates waiter info. /// </summary> /// <param name="id"></param> /// <param name="waiter"></param> /// <returns></returns> public async Task<bool> UpdateWaiter(int id,Waiter waiter) { var _waiter = new Waiter { Id=waiter.Id, FirstName = waiter.FirstName, LastName = waiter.LastName, Password = waiter.Password }; var response = await client.PutAsJsonAsync(uriWaiters+"/"+ id, _waiter); if (response.IsSuccessStatusCode) { return true; } return false; }
/// <summary> /// Adds waiter to database. /// </summary> /// <param name="waiter"></param> /// <returns></returns> public async Task<bool> AddWaiter(Waiter waiter) { var _waiter = new Waiter { FirstName= waiter.FirstName, LastName = waiter.LastName, Password = waiter.Password }; HttpResponseMessage response = await client.PostAsJsonAsync(uriWaiters, _waiter); if (response.IsSuccessStatusCode) { return true; } return false; }