private void UpdateDisplay(clsAllGame prGame) { txbTitle.Text = prGame.Title; txbRelease.Text = string.Format("Sub Genres: {0}", prGame.ReleaseDate); txbQuantity.Text = string.Format("Stock: {0} copies left", prGame.Quantity); txbType.Text = string.Format("Type: {0}", prGame.GameType); txbPrice.Text = "$" + Convert.ToString(prGame.Price); }
internal async static Task <string> DeleteGameAsync(clsAllGame prGame) { using (HttpClient lcHttpClient = new HttpClient()) { HttpResponseMessage lcRespMessage = await lcHttpClient.DeleteAsync ($"http://localhost:60064/api/gamestore/DeleteGame?GameTitle={prGame.Title}"); return(await lcRespMessage.Content.ReadAsStringAsync()); } }
private clsOrder createNewOrder(clsAllGame prGame) { string lcDate = DateTime.Now.ToString(); clsOrder lcOrder = new clsOrder() { GameID = prGame.GameID, Quantity = Convert.ToInt16(txtOrderQuantity.Text), OrderPrice = prGame.Price * Convert.ToDouble(txtOrderQuantity.Text), OrderDate = lcDate.Substring(0, 10), CustomerName = txtName.Text, City = txtCity.Text }; return(lcOrder); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter != null) { try { _Game = e.Parameter as clsAllGame; UpdateDisplay(_Game); } catch (Exception ex) { txbErrorMessage.Text = ex.Message; } } }
internal async static Task <string> PostGameAsync(clsAllGame prGame) { return(await InsertOrUpdateAsync(prGame, "http://localhost:60064/api/gamestore/PostGame", "POST")); }