示例#1
0
 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);
 }
示例#2
0
        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());
            }
        }
示例#3
0
        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);
        }
示例#4
0
 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;
         }
     }
 }
示例#5
0
 internal async static Task <string> PostGameAsync(clsAllGame prGame)
 {
     return(await InsertOrUpdateAsync(prGame, "http://localhost:60064/api/gamestore/PostGame", "POST"));
 }