Skip to content
This repository was archived by the owner on Sep 8, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions MtG Project/MtG Project/CollectionMenu.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions MtG Project/MtG Project/Deck Menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
Expand All @@ -10,12 +11,68 @@

namespace MtG_Project
{

public partial class Deck_Menu : Form
{
// If the person selects All Cards, then they take from the API. If they select from Collection, then the
// program will only use the JSON files.
Boolean allCards;
public Deck_Menu()
{
InitializeComponent();


//String connectionString;
//SqlConnection cnn;

//// Data source = name of server, initial catalog = name of database, user id and password are
//// self-explanatory.
//connectionString = @"Data Source=WIN-50GP30FGO75;Initial Catalog=Demodb;User ID=sa;Password=demo123";
//cnn = new SqlConnection(connectionString);
//cnn.Open();
//MessageBox.Show("Connection Open!");
//// Continue from
//// https://www.guru99.com/c-sharp-access-database.html

//// Define variables
//SqlCommand command;
//SqlDataReader datareader;
//String sql, Output = "";

//// Define the SQL statement
//sql = "SELECT TutorialID, TutorialName from demotb";

//// command statement
//command = new SqlCommand(sql, cnn);

//// Define the data reader
//datareader = command.ExecuteReader();

//// Get results
//while (datareader.Read())
//{
// Output = Output + datareader.GetValue(0) + " - " + datareader.GetValue(1) + "\n";
//}

//MessageBox.Show(Output);

//datareader.Close();
//command.Dispose();
//cnn.Close();

//// For putting stuff into the table
//// Reuse SqlCommand command
//SqlDataAdapter adapter = new SqlDataAdapter();
//String sql2 = "";
//sql2 = "INSERT into demotb (TutorialID, TutorialName) values(3,'" + "VB.Net" + "')";

//command = new SqlCommand(sql2, cnn);
//adapter.InsertCommand = new SqlCommand(sql2, cnn);
//adapter.InsertCommand.ExecuteNonQuery();

//command.Dispose();
//cnn.Close();

deckContentsBox.Text += "Grobby 5RR Creature Goblin 4/5";
deckListBox.Text += "Eggs Sunnyside Up";
deckListBox.Text += "Cawblade";
Expand Down Expand Up @@ -142,5 +199,13 @@ private void fromCollectionButton_Click(object sender, EventArgs e)
allCardsButton.Visible = false;
fromCollectionButton.Visible = false;
}

private void editDeckButton_Click(object sender, EventArgs e)
{
String deckName = deckContentsBox.SelectedIndex.ToString();
// Connect to database
// Get contents
// Display
}
}
}
Loading