diff --git a/.vs/JobFairApp/v15/.suo b/.vs/JobFairApp/v15/.suo new file mode 100644 index 0000000..16419c3 Binary files /dev/null and b/.vs/JobFairApp/v15/.suo differ diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..c00e568 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,8 @@ +{ + "ExpandedNodes": [ + "", + "\\JobFairApp" + ], + "SelectedNode": "\\JobFairApp\\JobFairApp.sln", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 716a039..1a5037a 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/JobFairApp/.vs/JobFairApp/v15/.suo b/JobFairApp/.vs/JobFairApp/v15/.suo index 4ae7feb..c81cdb6 100644 Binary files a/JobFairApp/.vs/JobFairApp/v15/.suo and b/JobFairApp/.vs/JobFairApp/v15/.suo differ diff --git a/JobFairApp/.vs/JobFairApp/v15/sqlite3/storage.ide b/JobFairApp/.vs/JobFairApp/v15/sqlite3/storage.ide index 4d260cc..692a016 100644 Binary files a/JobFairApp/.vs/JobFairApp/v15/sqlite3/storage.ide and b/JobFairApp/.vs/JobFairApp/v15/sqlite3/storage.ide differ diff --git a/JobFairApp/JobFairApp/Classes/Candidate.cs b/JobFairApp/JobFairApp/Classes/Candidate.cs index d386668..5842bdf 100644 --- a/JobFairApp/JobFairApp/Classes/Candidate.cs +++ b/JobFairApp/JobFairApp/Classes/Candidate.cs @@ -13,42 +13,15 @@ public class Candidate : ISQLObject public int ID = MySQLUtils.NullID; public int PersonID = MySQLUtils.NullID; - private Person person; public Person Person { get { - if (PersonID != MySQLUtils.NullID) - { - if (person == null) - { - person = new Person().FromID(PersonID); - } - - return person; - } - else throw new InvalidOperationException("No PersonID found!"); + return new Person().FromID(PersonID); } set { - person = value; - PersonID = person.ID; - - //rematch ID - String query = "SELECT ID FROM Candidates WHERE PersonID = '" + PersonID + "'"; - - SqlConnection connection = new SqlConnection(MySQLUtils.ConnectionString); - connection.Open(); - - SqlCommand command = new SqlCommand(); - command.CommandText = query; - command.CommandType = CommandType.Text; - command.Connection = connection; - - SqlDataReader reader = command.ExecuteReader(); - connection.Close(); - - ID = reader.GetInt32(0); + PersonID = value.ID; } } @@ -74,7 +47,6 @@ public Candidate FromDataReader(SqlDataReader reader) { ID = reader.GetInt32(reader.GetOrdinal("ID")); PersonID = reader.GetInt32(reader.GetOrdinal("PersonID")); - person = null;//in case this was called on an existing object reader.Read();//advance reader because it may have other records @@ -85,24 +57,13 @@ public Candidate FromDataRow(DataRow row) { ID = (int)row["ID"]; PersonID = (int)row["PersonID"]; - person = null;//in case this was called on an existing object return this; } public int Insert() { - if (ID == MySQLUtils.NullID) return 0; - if (PersonID == MySQLUtils.NullID) - { - if (person != null) - person.Insert(); - else//there's no person ... it ... it doesn't work - { - return 0; - } - PersonID = person.ID; - } + if (ID == MySQLUtils.NullID || PersonID == MySQLUtils.NullID) return 0; String statement; statement = "INSERT INTO Candidates (PersonID) VALUES" + @@ -119,19 +80,19 @@ public int Insert() int retValue = command.ExecuteNonQuery(); - //created new entry, read new ID - if(ID == MySQLUtils.NullID) - { - command.CommandText = "SELECT ID FROM Candidates"; + ////created new entry, read new ID + //if(ID == MySQLUtils.NullID) + //{ + // command.CommandText = "SELECT ID FROM Candidates"; - SqlDataReader reader = command.ExecuteReader(); + // SqlDataReader reader = command.ExecuteReader(); - while(reader.HasRows) - { - ID = (int)reader[0]; - reader.Read(); - } - } + // while(reader.HasRows) + // { + // ID = (int)reader[0]; + // reader.Read(); + // } + //} connection.Close(); @@ -140,17 +101,8 @@ public int Insert() public int Set() { - if (ID == MySQLUtils.NullID) return 0; - if (PersonID == MySQLUtils.NullID) - { - if (person != null) - person.Insert(); - else//there's no person ... it ... it doesn't work - { - return 0; - } - PersonID = person.ID; - } + if (ID == MySQLUtils.NullID || PersonID == MySQLUtils.NullID) return 0; + String statement; statement = "UPDATE Candidates SET " + diff --git a/JobFairApp/JobFairApp/Classes/Interviewer.cs b/JobFairApp/JobFairApp/Classes/Interviewer.cs index f88b349..22cea5c 100644 --- a/JobFairApp/JobFairApp/Classes/Interviewer.cs +++ b/JobFairApp/JobFairApp/Classes/Interviewer.cs @@ -13,42 +13,15 @@ public class Interviewer : ISQLObject public int ID = MySQLUtils.NullID; public int PersonID = MySQLUtils.NullID; - private Person person; public Person Person { get { - if (PersonID != MySQLUtils.NullID) - { - if (person == null) - { - person = new Person().FromID(PersonID); - } - - return person; - } - else throw new InvalidOperationException("No PersonID found!"); + return new Person().FromID(PersonID); } set { - person = value; - PersonID = person.ID; - - //rematch ID - String query = "SELECT ID FROM Interviewers WHERE PersonID = '" + PersonID + "'"; - - SqlConnection connection = new SqlConnection(MySQLUtils.ConnectionString); - connection.Open(); - - SqlCommand command = new SqlCommand(); - command.CommandText = query; - command.CommandType = CommandType.Text; - command.Connection = connection; - - SqlDataReader reader = command.ExecuteReader(); - connection.Close(); - - ID = reader.GetInt32(0); + PersonID = value.ID; } } @@ -74,7 +47,6 @@ public Interviewer FromDataReader(SqlDataReader reader) { ID = reader.GetInt32(reader.GetOrdinal("ID")); PersonID = reader.GetInt32(reader.GetOrdinal("PersonID")); - person = null;//in case this was called on an existing object reader.Read();//advance reader because it may have other records @@ -85,23 +57,13 @@ public Interviewer FromDataRow(DataRow row) { ID = (int)row["ID"]; PersonID = (int)row["PersonID"]; - person = null;//in case this was called on an existing object return this; } public int Insert() { - if (PersonID == MySQLUtils.NullID) - { - if (person != null) - person.Insert(); - else//there's no person ... it ... it doesn't work - { - return 0; - } - PersonID = person.ID; - } + if (PersonID == MySQLUtils.NullID) return 0; String statement; statement = "INSERT INTO Interviewers (ID, PersonID) VALUES" + @@ -120,20 +82,20 @@ public int Insert() int retValue = command.ExecuteNonQuery(); - if (ID == MySQLUtils.NullID)//created new entry - read last ID to get new ID - { - command.CommandText = "SELECT ID FROM Interviewers"; - SqlDataReader IDs = command.ExecuteReader(); + //if (ID == MySQLUtils.NullID)//created new entry - read last ID to get new ID + //{ + // command.CommandText = "SELECT ID FROM Interviewers"; + // SqlDataReader IDs = command.ExecuteReader(); - int newID = 0; - while (IDs.HasRows) - { - newID = IDs.GetInt32(0); - IDs.Read(); - } + // int newID = 0; + // while (IDs.HasRows) + // { + // newID = IDs.GetInt32(0); + // IDs.Read(); + // } - ID = newID; - } + // ID = newID; + //} connection.Close(); diff --git a/JobFairApp/JobFairApp/Classes/JobFair.cs b/JobFairApp/JobFairApp/Classes/JobFair.cs index 530cca3..68e623e 100644 --- a/JobFairApp/JobFairApp/Classes/JobFair.cs +++ b/JobFairApp/JobFairApp/Classes/JobFair.cs @@ -10,29 +10,180 @@ namespace JobFairApp.Classes { public class JobFair : ISQLObject { + public int ID; + public String Name; + public String Description; + public String StartDate; + public String EndDate; + public String Website; + public String Phone; + public int ContactPersonID; + + public Person ContactPerson + { + get + { + return new Person().FromID(ContactPersonID); + } + set + { + ContactPersonID = value.ID; + } + } + public JobFair FromID(int ID) { - throw new NotImplementedException(); + String query = "SELECT * FROM JobFairs WHERE ID = '" + ID + "'"; + + SqlConnection connection = new SqlConnection(MySQLUtils.ConnectionString); + connection.Open(); + + SqlCommand command = new SqlCommand(); + command.CommandText = query; + command.CommandType = CommandType.Text; + command.Connection = connection; + + SqlDataReader reader = command.ExecuteReader(); + connection.Close(); + + return FromDataReader(reader); } public JobFair FromDataReader(SqlDataReader reader) { - throw new NotImplementedException(); + if (!reader.HasRows) + { + ID = MySQLUtils.NullID; + Name = null; + Description = null; + StartDate = null; + EndDate = null; + Website = null; + Phone = null; + ContactPersonID = MySQLUtils.NullID; + + return this; + } + + ID = reader.GetInt32(reader.GetOrdinal("ID")); + Name = (String)reader["Name"]; + Description = (String)reader["Description"]; + StartDate = (String)reader["StartDate"]; + EndDate = (String)reader["EndDate"]; + Website = (String)reader["Website"]; + Phone = (String)reader["Phone"]; + ContactPersonID = (int)reader["ContactPersonID"]; + + reader.Read();//advance reader because it may have other records + + return this; } public JobFair FromDataRow(DataRow row) { - throw new NotImplementedException(); + ID = (int)row["ID"]; + Name = (String)row["Name"]; + Description = (String)row["Description"]; + StartDate = (String)row["StartDate"]; + EndDate = (String)row["EndDate"]; + Website = (String)row["Website"]; + Phone = (String)row["Phone"]; + ContactPersonID = (int)row["ContactPersonID"]; + + return this; } public int Insert() { - throw new NotImplementedException(); + String statement; + statement = "INSERT INTO JobFairs " + + "(Name, Description, StartDate, EndDate, " + + "Website, Phone, ContactPersonID) VALUES" + + "(" + + "'" + Name + "'," + + "'" + Description + "'," + + "'" + StartDate + "'," + + "'" + EndDate + "'," + + "'" + Website + "'," + + "'" + Phone + "'," + + "'" + ContactPersonID + "')"; + + SqlConnection connection = new SqlConnection(MySQLUtils.ConnectionString); + + connection.Open(); + + SqlCommand command = new SqlCommand(); + command.CommandText = statement; + command.CommandType = CommandType.Text; + command.Connection = connection; + + int retValue = command.ExecuteNonQuery(); + + //if (ID == MySQLUtils.NullID)//created new entry - read last ID to get new ID + //{ + // command.CommandText = "SELECT ID FROM JobFairs"; + // SqlDataReader IDs = command.ExecuteReader(); + + // int newID = 0; + // while (IDs.HasRows) + // { + // newID = int.Parse(IDs[0].ToString()); + // IDs.Read(); + // } + + // ID = newID; + //} + + connection.Close(); + + return retValue; } public int Set() { - throw new NotImplementedException(); + String statement; + statement = "UPDATE JobFairs SET" + + "(Name, Description, StartDate, EndDate, " + + "Website, Phone, ContactPersonID) VALUES" + + "(" + + "'" + Name + "'," + + "'" + Description + "'," + + "'" + StartDate + "'," + + "'" + EndDate + "'," + + "'" + Website + "'," + + "'" + Phone + "'," + + "'" + ContactPersonID + "')" + + "WHERE ID = '" + ID + "'"; + + SqlConnection connection = new SqlConnection(MySQLUtils.ConnectionString); + + connection.Open(); + + SqlCommand command = new SqlCommand(); + command.CommandText = statement; + command.CommandType = CommandType.Text; + command.Connection = connection; + + int retValue = command.ExecuteNonQuery(); + + //if (ID == MySQLUtils.NullID)//created new entry - read last ID to get new ID + //{ + // command.CommandText = "SELECT ID FROM JobFairs"; + // SqlDataReader IDs = command.ExecuteReader(); + + // int newID = 0; + // while (IDs.HasRows) + // { + // newID = int.Parse(IDs[0].ToString()); + // IDs.Read(); + // } + + // ID = newID; + //} + + connection.Close(); + + return retValue; } } } diff --git a/JobFairApp/JobFairApp/Classes/MySQLUtils.cs b/JobFairApp/JobFairApp/Classes/MySQLUtils.cs index e134404..fe2ab26 100644 --- a/JobFairApp/JobFairApp/Classes/MySQLUtils.cs +++ b/JobFairApp/JobFairApp/Classes/MySQLUtils.cs @@ -8,7 +8,7 @@ namespace JobFairApp.Classes { public class MySQLUtils { - public const String ConnectionString = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=JobFair;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"; + public const String ConnectionString = @"Data Source=localhost\SQLEXPRESS;Initial Catalog=JobFair;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"; public const int NullID = -1; } } diff --git a/JobFairApp/JobFairApp/Classes/Person.cs b/JobFairApp/JobFairApp/Classes/Person.cs index 2abf131..46b8a40 100644 --- a/JobFairApp/JobFairApp/Classes/Person.cs +++ b/JobFairApp/JobFairApp/Classes/Person.cs @@ -125,20 +125,20 @@ public int Insert() int retValue = command.ExecuteNonQuery(); - if (ID == MySQLUtils.NullID)//created new entry - read last ID to get new ID - { - command.CommandText = "SELECT ID FROM People"; - SqlDataReader IDs = command.ExecuteReader(); + //if (ID == MySQLUtils.NullID)//created new entry - read last ID to get new ID + //{ + // command.CommandText = "SELECT ID FROM People"; + // SqlDataReader IDs = command.ExecuteReader(); - int newID = 0; - while (IDs.HasRows) - { - newID = int.Parse(IDs[0].ToString()); - IDs.Read(); - } + // int newID = 0; + // while (IDs.HasRows) + // { + // newID = int.Parse(IDs[0].ToString()); + // IDs.Read(); + // } - ID = newID; - } + // ID = newID; + //} connection.Close(); @@ -162,8 +162,7 @@ public int Set() "Phone = '" + Phone + "' " + "WHERE ID = '" + ID + "'"; - - + SqlConnection connection = new SqlConnection(MySQLUtils.ConnectionString); connection.Open(); diff --git a/JobFairApp/JobFairApp/Classes/Venue.cs b/JobFairApp/JobFairApp/Classes/Venue.cs index 7615b6e..1c16b8b 100644 --- a/JobFairApp/JobFairApp/Classes/Venue.cs +++ b/JobFairApp/JobFairApp/Classes/Venue.cs @@ -60,21 +60,12 @@ public Venue FromDataRow(DataRow row) public int Insert() { String statement; - if (ID == -1) - { - statement = "INSERT INTO Venues (Name, [Short Descrption], [Long Description]) VALUES" + - "(" + - "'" + Name + "'," + - "'" + ShortDescription + "'," + - "'" + LongDescription + "')"; - } - else - { - statement = "UPDATE People SET " + - "Name = '" + Name + "'" + - " [Short Description] = '" + ShortDescription + "'" + - " [Long Description] = '" + LongDescription + "'"; - } + statement = "INSERT INTO Venues (Name, [Short Description], [Long Description]) VALUES" + + "(" + + "'" + Name + "'," + + "'" + ShortDescription + "'," + + "'" + LongDescription + "')"; + SqlConnection connection = new SqlConnection(MySQLUtils.ConnectionString); @@ -83,23 +74,24 @@ public int Insert() SqlCommand command = new SqlCommand(); command.CommandText = statement; command.CommandType = CommandType.Text; + command.Connection = connection; int retValue = command.ExecuteNonQuery(); - if (ID == -1)//created new entry - get last ID to know new ID - { - command.CommandText = "SELECT ID FROM Venues"; - SqlDataReader IDs = command.ExecuteReader(); + //if (ID == -1)//created new entry - get last ID to know new ID + //{ + // command.CommandText = "SELECT ID FROM Venues"; + // SqlDataReader IDs = command.ExecuteReader(); - int newID = 0; - while (IDs.HasRows) - { - newID = IDs.GetInt32(0); - IDs.Read(); - } + // int newID = 0; + // while (IDs.HasRows) + // { + // newID = IDs.GetInt32(0); + // IDs.Read(); + // } - ID = newID; - } + // ID = newID; + //} connection.Close(); @@ -114,7 +106,8 @@ public int Set() statement = "UPDATE People SET " + "Name = '" + Name + "'" + " [Short Description] = '" + ShortDescription + "'" + - " [Long Description] = '" + LongDescription + "'"; + " [Long Description] = '" + LongDescription + "'" + + "WHERE ID = '" + ID + "'"; SqlConnection connection = new SqlConnection(MySQLUtils.ConnectionString); diff --git a/JobFairApp/JobFairApp/Form1.Designer.cs b/JobFairApp/JobFairApp/Form1.Designer.cs index 5de5b17..1c42e2c 100644 --- a/JobFairApp/JobFairApp/Form1.Designer.cs +++ b/JobFairApp/JobFairApp/Form1.Designer.cs @@ -30,11 +30,12 @@ private void InitializeComponent() { this.person_btn = new System.Windows.Forms.Button(); this.venue_btn = new System.Windows.Forms.Button(); + this.JobFair_btn = new System.Windows.Forms.Button(); this.SuspendLayout(); // // person_btn // - this.person_btn.Location = new System.Drawing.Point(12, 53); + this.person_btn.Location = new System.Drawing.Point(12, 70); this.person_btn.Name = "person_btn"; this.person_btn.Size = new System.Drawing.Size(104, 23); this.person_btn.TabIndex = 3; @@ -44,7 +45,7 @@ private void InitializeComponent() // // venue_btn // - this.venue_btn.Location = new System.Drawing.Point(12, 24); + this.venue_btn.Location = new System.Drawing.Point(12, 41); this.venue_btn.Name = "venue_btn"; this.venue_btn.Size = new System.Drawing.Size(104, 23); this.venue_btn.TabIndex = 2; @@ -52,11 +53,22 @@ private void InitializeComponent() this.venue_btn.UseVisualStyleBackColor = true; this.venue_btn.Click += new System.EventHandler(this.venue_btn_Click); // + // JobFair_btn + // + this.JobFair_btn.Location = new System.Drawing.Point(12, 12); + this.JobFair_btn.Name = "JobFair_btn"; + this.JobFair_btn.Size = new System.Drawing.Size(103, 23); + this.JobFair_btn.TabIndex = 4; + this.JobFair_btn.Text = "Create Job Fair"; + this.JobFair_btn.UseVisualStyleBackColor = true; + this.JobFair_btn.Click += new System.EventHandler(this.JobFair_btn_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(338, 334); + this.Controls.Add(this.JobFair_btn); this.Controls.Add(this.person_btn); this.Controls.Add(this.venue_btn); this.Name = "Form1"; @@ -69,6 +81,7 @@ private void InitializeComponent() private System.Windows.Forms.Button person_btn; private System.Windows.Forms.Button venue_btn; + private System.Windows.Forms.Button JobFair_btn; } } diff --git a/JobFairApp/JobFairApp/Form1.cs b/JobFairApp/JobFairApp/Form1.cs index 94a45a6..6f32651 100644 --- a/JobFairApp/JobFairApp/Form1.cs +++ b/JobFairApp/JobFairApp/Form1.cs @@ -44,5 +44,19 @@ private void person_btn_Click(object sender, EventArgs e) }; createCandidate.Show(); } + + private void JobFair_btn_Click(object sender, EventArgs e) + { + this.Hide(); + Forms.CreateFair createFair = new Forms.CreateFair(); + createFair.VisibleChanged += delegate (object source, EventArgs args) + { + if (!createFair.Visible) + { + this.Show(); + } + }; + createFair.Show(); + } } } diff --git a/JobFairApp/JobFairApp/Forms/CreateFair.Designer.cs b/JobFairApp/JobFairApp/Forms/CreateFair.Designer.cs index 08cfd43..b07c299 100644 --- a/JobFairApp/JobFairApp/Forms/CreateFair.Designer.cs +++ b/JobFairApp/JobFairApp/Forms/CreateFair.Designer.cs @@ -28,11 +28,116 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.label1 = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.descriptionLabel = new System.Windows.Forms.Label(); + this.venuesComboBox = new System.Windows.Forms.ComboBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.addVenueButton = new System.Windows.Forms.Button(); + this.venuesListBox = new System.Windows.Forms.ListBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(13, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Name"; + // + // nameTextBox + // + this.nameTextBox.Location = new System.Drawing.Point(79, 13); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(138, 20); + this.nameTextBox.TabIndex = 1; + // + // textBox1 + // + this.textBox1.AcceptsReturn = true; + this.textBox1.Location = new System.Drawing.Point(79, 40); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(138, 77); + this.textBox1.TabIndex = 2; + // + // descriptionLabel + // + this.descriptionLabel.AutoSize = true; + this.descriptionLabel.Location = new System.Drawing.Point(13, 40); + this.descriptionLabel.Name = "descriptionLabel"; + this.descriptionLabel.Size = new System.Drawing.Size(60, 13); + this.descriptionLabel.TabIndex = 3; + this.descriptionLabel.Text = "Description"; + // + // venuesComboBox + // + this.venuesComboBox.FormattingEnabled = true; + this.venuesComboBox.Location = new System.Drawing.Point(6, 19); + this.venuesComboBox.Name = "venuesComboBox"; + this.venuesComboBox.Size = new System.Drawing.Size(121, 21); + this.venuesComboBox.TabIndex = 4; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.venuesListBox); + this.groupBox1.Controls.Add(this.addVenueButton); + this.groupBox1.Controls.Add(this.venuesComboBox); + this.groupBox1.Location = new System.Drawing.Point(16, 132); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(201, 144); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Venue"; + // + // addVenueButton + // + this.addVenueButton.Location = new System.Drawing.Point(134, 19); + this.addVenueButton.Name = "addVenueButton"; + this.addVenueButton.Size = new System.Drawing.Size(61, 23); + this.addVenueButton.TabIndex = 5; + this.addVenueButton.Text = "Add"; + this.addVenueButton.UseVisualStyleBackColor = true; + this.addVenueButton.Click += new System.EventHandler(this.addVenueButton_Click); + // + // venuesListBox + // + this.venuesListBox.FormattingEnabled = true; + this.venuesListBox.Location = new System.Drawing.Point(7, 47); + this.venuesListBox.Name = "venuesListBox"; + this.venuesListBox.Size = new System.Drawing.Size(188, 82); + this.venuesListBox.TabIndex = 6; + // + // CreateFair + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(235, 288); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.descriptionLabel); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.label1); + this.Name = "CreateFair"; this.Text = "CreateFair"; + this.groupBox1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + } #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label descriptionLabel; + private System.Windows.Forms.ComboBox venuesComboBox; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.ListBox venuesListBox; + private System.Windows.Forms.Button addVenueButton; } } \ No newline at end of file diff --git a/JobFairApp/JobFairApp/Forms/CreateFair.cs b/JobFairApp/JobFairApp/Forms/CreateFair.cs index 578813e..d63f597 100644 --- a/JobFairApp/JobFairApp/Forms/CreateFair.cs +++ b/JobFairApp/JobFairApp/Forms/CreateFair.cs @@ -7,14 +7,29 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; - +using JobFairApp.Classes; namespace JobFairApp.Forms { public partial class CreateFair : Form { + /* + * This has almost no actual functionality lol + */ + + private JobFair fair; + private Dictionary venues; public CreateFair() { InitializeComponent(); + venues = new Dictionary(); + } + + private void addVenueButton_Click(object sender, EventArgs e) + { + //get value in combo box + //add it and the id to the venues dictionary + + //that match will later be used to simply pair this fair's id with all the venues here } } } diff --git a/JobFairApp/JobFairApp/Forms/CreateFair.resx b/JobFairApp/JobFairApp/Forms/CreateFair.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/JobFairApp/JobFairApp/Forms/CreateFair.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/JobFairApp/JobFairApp/Forms/PersonControl.Designer.cs b/JobFairApp/JobFairApp/Forms/PersonControl.Designer.cs index 217956d..a9a6289 100644 --- a/JobFairApp/JobFairApp/Forms/PersonControl.Designer.cs +++ b/JobFairApp/JobFairApp/Forms/PersonControl.Designer.cs @@ -140,70 +140,70 @@ private void InitializeComponent() this.firstBox.Location = new System.Drawing.Point(86, 50); this.firstBox.Name = "firstBox"; this.firstBox.Size = new System.Drawing.Size(100, 20); - this.firstBox.TabIndex = 10; + this.firstBox.TabIndex = 1; // // miBox // this.miBox.Location = new System.Drawing.Point(86, 70); this.miBox.Name = "miBox"; this.miBox.Size = new System.Drawing.Size(100, 20); - this.miBox.TabIndex = 11; + this.miBox.TabIndex = 2; // // lastBox // this.lastBox.Location = new System.Drawing.Point(86, 90); this.lastBox.Name = "lastBox"; this.lastBox.Size = new System.Drawing.Size(100, 20); - this.lastBox.TabIndex = 12; + this.lastBox.TabIndex = 3; // // titleBox // this.titleBox.Location = new System.Drawing.Point(86, 110); this.titleBox.Name = "titleBox"; this.titleBox.Size = new System.Drawing.Size(100, 20); - this.titleBox.TabIndex = 13; + this.titleBox.TabIndex = 4; // // address1Box // this.address1Box.Location = new System.Drawing.Point(86, 130); this.address1Box.Name = "address1Box"; this.address1Box.Size = new System.Drawing.Size(100, 20); - this.address1Box.TabIndex = 14; + this.address1Box.TabIndex = 5; // // address2Box // this.address2Box.Location = new System.Drawing.Point(86, 150); this.address2Box.Name = "address2Box"; this.address2Box.Size = new System.Drawing.Size(100, 20); - this.address2Box.TabIndex = 15; + this.address2Box.TabIndex = 6; // // cityBox // this.cityBox.Location = new System.Drawing.Point(86, 170); this.cityBox.Name = "cityBox"; this.cityBox.Size = new System.Drawing.Size(100, 20); - this.cityBox.TabIndex = 16; + this.cityBox.TabIndex = 7; // // zipBox // this.zipBox.Location = new System.Drawing.Point(86, 210); this.zipBox.Name = "zipBox"; this.zipBox.Size = new System.Drawing.Size(100, 20); - this.zipBox.TabIndex = 17; + this.zipBox.TabIndex = 9; // // emailBox // this.emailBox.Location = new System.Drawing.Point(86, 230); this.emailBox.Name = "emailBox"; this.emailBox.Size = new System.Drawing.Size(100, 20); - this.emailBox.TabIndex = 18; + this.emailBox.TabIndex = 10; // // loadIDButton // this.loadIDButton.Location = new System.Drawing.Point(33, 12); this.loadIDButton.Name = "loadIDButton"; this.loadIDButton.Size = new System.Drawing.Size(120, 23); - this.loadIDButton.TabIndex = 20; + this.loadIDButton.TabIndex = 0; this.loadIDButton.Text = "Load User ID"; this.loadIDButton.UseVisualStyleBackColor = true; this.loadIDButton.Click += new System.EventHandler(this.loadIDButton_Click); @@ -213,7 +213,7 @@ private void InitializeComponent() this.verifyButton.Location = new System.Drawing.Point(63, 278); this.verifyButton.Name = "verifyButton"; this.verifyButton.Size = new System.Drawing.Size(75, 23); - this.verifyButton.TabIndex = 21; + this.verifyButton.TabIndex = 12; this.verifyButton.Text = "Verify"; this.verifyButton.UseVisualStyleBackColor = true; this.verifyButton.Click += new System.EventHandler(this.verifyButton_Click); @@ -241,14 +241,14 @@ private void InitializeComponent() this.phoneBox.Location = new System.Drawing.Point(86, 250); this.phoneBox.Name = "phoneBox"; this.phoneBox.Size = new System.Drawing.Size(100, 20); - this.phoneBox.TabIndex = 24; + this.phoneBox.TabIndex = 11; // // stateBox // this.stateBox.Location = new System.Drawing.Point(86, 190); this.stateBox.Name = "stateBox"; this.stateBox.Size = new System.Drawing.Size(100, 20); - this.stateBox.TabIndex = 25; + this.stateBox.TabIndex = 8; // // PersonControl // diff --git a/JobFairApp/JobFairApp/Forms/UserProfile.Designer.cs b/JobFairApp/JobFairApp/Forms/UserProfile.Designer.cs index de44a46..be93fa6 100644 --- a/JobFairApp/JobFairApp/Forms/UserProfile.Designer.cs +++ b/JobFairApp/JobFairApp/Forms/UserProfile.Designer.cs @@ -30,12 +30,13 @@ private void InitializeComponent() { this.loginButton = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); - this.personControl1 = new JobFairApp.Forms.PersonControl(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.checkedListBox1 = new System.Windows.Forms.CheckedListBox(); this.SuspendLayout(); // // loginButton // - this.loginButton.Location = new System.Drawing.Point(114, 12); + this.loginButton.Location = new System.Drawing.Point(490, 12); this.loginButton.Name = "loginButton"; this.loginButton.Size = new System.Drawing.Size(75, 23); this.loginButton.TabIndex = 0; @@ -45,7 +46,7 @@ private void InitializeComponent() // // button2 // - this.button2.Location = new System.Drawing.Point(33, 12); + this.button2.Location = new System.Drawing.Point(409, 12); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(75, 23); this.button2.TabIndex = 1; @@ -53,19 +54,35 @@ private void InitializeComponent() this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.newUserButton_Click); // - // personControl1 + // groupBox1 // - this.personControl1.Location = new System.Drawing.Point(13, 50); - this.personControl1.Name = "personControl1"; - this.personControl1.Size = new System.Drawing.Size(199, 322); - this.personControl1.TabIndex = 2; + this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox1.Location = new System.Drawing.Point(157, 100); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(271, 264); + this.groupBox1.TabIndex = 2; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "My Interviews"; + // + // checkedListBox1 + // + this.checkedListBox1.FormattingEnabled = true; + this.checkedListBox1.Items.AddRange(new object[] { + "Created an Account", + "Filled Profile", + "Applied for interviews"}); + this.checkedListBox1.Location = new System.Drawing.Point(434, 108); + this.checkedListBox1.Name = "checkedListBox1"; + this.checkedListBox1.Size = new System.Drawing.Size(131, 124); + this.checkedListBox1.TabIndex = 3; // // UserProfile // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(236, 376); - this.Controls.Add(this.personControl1); + this.ClientSize = new System.Drawing.Size(577, 376); + this.Controls.Add(this.checkedListBox1); + this.Controls.Add(this.groupBox1); this.Controls.Add(this.button2); this.Controls.Add(this.loginButton); this.Name = "UserProfile"; @@ -79,6 +96,7 @@ private void InitializeComponent() private System.Windows.Forms.Button loginButton; private System.Windows.Forms.Button button2; - private PersonControl personControl1; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckedListBox checkedListBox1; } } \ No newline at end of file diff --git a/JobFairApp/JobFairApp/Forms/UserProfile.cs b/JobFairApp/JobFairApp/Forms/UserProfile.cs index 398b725..3d5cbd7 100644 --- a/JobFairApp/JobFairApp/Forms/UserProfile.cs +++ b/JobFairApp/JobFairApp/Forms/UserProfile.cs @@ -14,6 +14,7 @@ namespace JobFairApp.Forms { public partial class UserProfile : Form { + //the file a recurring user's information would be in String loginPath = "JobFairAppData/login.txt"; public UserProfile() @@ -28,6 +29,7 @@ public void LoadProfile(Person p) private void UserProfile_Load(object sender, EventArgs e) { + //attempt to load a previous profile FileInfo file = new FileInfo(loginPath); if (file.Exists) { @@ -35,6 +37,8 @@ private void UserProfile_Load(object sender, EventArgs e) String line = reader.ReadLine(); + reader.Close(); + int ID = int.Parse(line); Person p = new Person().FromID(ID); diff --git a/JobFairApp/JobFairApp/JobFairApp.csproj b/JobFairApp/JobFairApp/JobFairApp.csproj index 249a891..0f1f2fc 100644 --- a/JobFairApp/JobFairApp/JobFairApp.csproj +++ b/JobFairApp/JobFairApp/JobFairApp.csproj @@ -105,6 +105,9 @@ CreateCandidate.cs + + CreateFair.cs + CreateVenue.cs diff --git a/JobFairApp/JobFairApp/bin/Debug/JobFairApp.exe b/JobFairApp/JobFairApp/bin/Debug/JobFairApp.exe index 5ca6727..5cbada1 100644 Binary files a/JobFairApp/JobFairApp/bin/Debug/JobFairApp.exe and b/JobFairApp/JobFairApp/bin/Debug/JobFairApp.exe differ diff --git a/JobFairApp/JobFairApp/bin/Debug/JobFairApp.pdb b/JobFairApp/JobFairApp/bin/Debug/JobFairApp.pdb index d2ce061..449fbe5 100644 Binary files a/JobFairApp/JobFairApp/bin/Debug/JobFairApp.pdb and b/JobFairApp/JobFairApp/bin/Debug/JobFairApp.pdb differ diff --git a/JobFairApp/JobFairApp/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/JobFairApp/JobFairApp/obj/Debug/DesignTimeResolveAssemblyReferences.cache index f4d1367..14ba641 100644 Binary files a/JobFairApp/JobFairApp/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/JobFairApp/JobFairApp/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/JobFairApp/JobFairApp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/JobFairApp/JobFairApp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 28179ed..af316de 100644 Binary files a/JobFairApp/JobFairApp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/JobFairApp/JobFairApp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.Forms.CreateFair.resources b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.Forms.CreateFair.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.Forms.CreateFair.resources differ diff --git a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.CoreCompileInputs.cache b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.CoreCompileInputs.cache index 2e99fe7..dd065aa 100644 --- a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.CoreCompileInputs.cache +++ b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -77518104bc0c2c06c79f16f5cb1b609e3a7a91ae +6f03eecd323b8cda8ba1f479f6952836edba5983 diff --git a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.FileListAbsolute.txt b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.FileListAbsolute.txt index 62549e3..4ff0e20 100644 --- a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.FileListAbsolute.txt +++ b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.FileListAbsolute.txt @@ -25,3 +25,18 @@ C:\Users\hwk66\Source\Repos\JobFairApp2\JobFairApp\JobFairApp\obj\Debug\JobFairA C:\Users\hwk66\Source\Repos\JobFairApp2\JobFairApp\JobFairApp\obj\Debug\JobFairApp.csproj.CoreCompileInputs.cache C:\Users\hwk66\Source\Repos\JobFairApp2\JobFairApp\JobFairApp\obj\Debug\JobFairApp.exe C:\Users\hwk66\Source\Repos\JobFairApp2\JobFairApp\JobFairApp\obj\Debug\JobFairApp.pdb +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\bin\Debug\JobFairApp.exe.config +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\bin\Debug\JobFairApp.exe +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\bin\Debug\JobFairApp.pdb +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.csprojResolveAssemblyReference.cache +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.Form1.resources +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.Forms.CreateCandidate.resources +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.Forms.CreateFair.resources +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.Forms.CreateVenue.resources +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.Forms.PersonControl.resources +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.Forms.UserProfile.resources +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.Properties.Resources.resources +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.csproj.GenerateResource.Cache +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.csproj.CoreCompileInputs.cache +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.exe +C:\Users\Bo\Desktop\Classes\Programming environments\VS\JobFairApp\JobFairApp\JobFairApp\obj\Debug\JobFairApp.pdb diff --git a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.GenerateResource.Cache b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.GenerateResource.Cache index 2f16529..ecb7399 100644 Binary files a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.GenerateResource.Cache and b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.csproj.GenerateResource.Cache differ diff --git a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.exe b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.exe index 5ca6727..5cbada1 100644 Binary files a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.exe and b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.exe differ diff --git a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.pdb b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.pdb index d2ce061..449fbe5 100644 Binary files a/JobFairApp/JobFairApp/obj/Debug/JobFairApp.pdb and b/JobFairApp/JobFairApp/obj/Debug/JobFairApp.pdb differ diff --git a/JobFairApp/JobFairApp/obj/Release/JobFairApp.csproj.CoreCompileInputs.cache b/JobFairApp/JobFairApp/obj/Release/JobFairApp.csproj.CoreCompileInputs.cache index 710f29d..4125ba2 100644 --- a/JobFairApp/JobFairApp/obj/Release/JobFairApp.csproj.CoreCompileInputs.cache +++ b/JobFairApp/JobFairApp/obj/Release/JobFairApp.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -77518104bc0c2c06c79f16f5cb1b609e3a7a91ae +6f03eecd323b8cda8ba1f479f6952836edba5983