Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string   lcReply;
            InputBox inputBox = new InputBox("New or Preowned?");

            if (inputBox.ShowDialog() == DialogResult.OK)
            {
                // Get answer
                lcReply = (inputBox.getAnswer());
                Console.WriteLine(lcReply);

                // Make new game of corresponding type
                clsAllGame lcGame = new clsAllGame();
                if (lcReply != string.Empty)
                {
                    lcGame.GenreID = _Genre.GenreID;
                }
                lcGame.GameType = lcReply;

                // Open correct form
                frmGame.DispatchWorkForm(lcGame);
                refreshFormFromDB(_Genre.GenreName);
            }
            else
            {
                inputBox.Close();
                Console.WriteLine("No response");
            }
            refreshFormFromDB(_Genre.GenreName);
        }
Ejemplo n.º 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?GameID={prGame.GameID}");

                return(await lcRespMessage.Content.ReadAsStringAsync());
            }
        }
Ejemplo n.º 3
0
 public static void DispatchWorkForm(clsAllGame prGame)
 {
     _GamesForm[prGame.GameType].DynamicInvoke(prGame);
 }
Ejemplo n.º 4
0
 public void SetDetails(clsAllGame prGame)
 {
     _Game = prGame;
     UpdateDisplay();
     ShowDialog();
 }
Ejemplo n.º 5
0
 public static void Run(clsAllGame prGame)
 {
     Instance.SetDetails(prGame);
 }
Ejemplo n.º 6
0
 internal async static Task <string> PostGameAsync(clsAllGame prGame)
 {
     return(await InsertOrUpdateAsync(prGame, "http://localhost:60064/api/gamestore/PostGame", "POST"));
 }