Do the file menu

This commit is contained in:
kougyokugentou 2020-04-30 09:21:47 -07:00
parent 3d3e1bb0c3
commit ad594106d4
3 changed files with 51 additions and 11 deletions

35
Form1.Designer.cs generated
View File

@ -54,7 +54,6 @@
this.exitsavesDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitsavesDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.studentBindingNavigator = new System.Windows.Forms.BindingNavigator(this.components); this.studentBindingNavigator = new System.Windows.Forms.BindingNavigator(this.components);
this.bindingNavigatorAddNewItem = new System.Windows.Forms.ToolStripButton(); this.bindingNavigatorAddNewItem = new System.Windows.Forms.ToolStripButton();
this.studentBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel(); this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel();
this.bindingNavigatorDeleteItem = new System.Windows.Forms.ToolStripButton(); this.bindingNavigatorDeleteItem = new System.Windows.Forms.ToolStripButton();
this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton(); this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
@ -93,6 +92,8 @@
this.foundStudents_comboBox = new System.Windows.Forms.ComboBox(); this.foundStudents_comboBox = new System.Windows.Forms.ComboBox();
this.lblFoundStudents = new System.Windows.Forms.Label(); this.lblFoundStudents = new System.Windows.Forms.Label();
this.studentDbID = new System.Windows.Forms.NumericUpDown(); this.studentDbID = new System.Windows.Forms.NumericUpDown();
this.studentBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.exitWithoutSavingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
lastNameLabel = new System.Windows.Forms.Label(); lastNameLabel = new System.Windows.Forms.Label();
firstNameLabel = new System.Windows.Forms.Label(); firstNameLabel = new System.Windows.Forms.Label();
student_idLabel = new System.Windows.Forms.Label(); student_idLabel = new System.Windows.Forms.Label();
@ -110,12 +111,12 @@
this.mainMenuStrip.SuspendLayout(); this.mainMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.studentBindingNavigator)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.studentBindingNavigator)).BeginInit();
this.studentBindingNavigator.SuspendLayout(); this.studentBindingNavigator.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.studentBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.student_pictureBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.student_pictureBox)).BeginInit();
this.parent_groupBox.SuspendLayout(); this.parent_groupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.phoneNumberNumericUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.phoneNumberNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.studentDbID)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.studentDbID)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.studentBindingSource)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// lastNameLabel // lastNameLabel
@ -269,6 +270,7 @@
this.newStudentToolStripMenuItem, this.newStudentToolStripMenuItem,
this.saveStudentToolStripMenuItem, this.saveStudentToolStripMenuItem,
this.reportsToolStripMenuItem, this.reportsToolStripMenuItem,
this.exitWithoutSavingToolStripMenuItem,
this.exitsavesDataToolStripMenuItem}); this.exitsavesDataToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(54, 31); this.fileToolStripMenuItem.Size = new System.Drawing.Size(54, 31);
@ -277,14 +279,16 @@
// newStudentToolStripMenuItem // newStudentToolStripMenuItem
// //
this.newStudentToolStripMenuItem.Name = "newStudentToolStripMenuItem"; this.newStudentToolStripMenuItem.Name = "newStudentToolStripMenuItem";
this.newStudentToolStripMenuItem.Size = new System.Drawing.Size(239, 34); this.newStudentToolStripMenuItem.Size = new System.Drawing.Size(270, 34);
this.newStudentToolStripMenuItem.Text = "&New Student"; this.newStudentToolStripMenuItem.Text = "&New Student";
this.newStudentToolStripMenuItem.Click += new System.EventHandler(this.newStudentToolStripMenuItem_Click);
// //
// saveStudentToolStripMenuItem // saveStudentToolStripMenuItem
// //
this.saveStudentToolStripMenuItem.Name = "saveStudentToolStripMenuItem"; this.saveStudentToolStripMenuItem.Name = "saveStudentToolStripMenuItem";
this.saveStudentToolStripMenuItem.Size = new System.Drawing.Size(239, 34); this.saveStudentToolStripMenuItem.Size = new System.Drawing.Size(270, 34);
this.saveStudentToolStripMenuItem.Text = "&Save Student"; this.saveStudentToolStripMenuItem.Text = "&Save Student";
this.saveStudentToolStripMenuItem.Click += new System.EventHandler(this.saveStudentToolStripMenuItem_Click);
// //
// reportsToolStripMenuItem // reportsToolStripMenuItem
// //
@ -292,7 +296,7 @@
this.studentBySchoolToolStripMenuItem, this.studentBySchoolToolStripMenuItem,
this.studentsByProgramToolStripMenuItem}); this.studentsByProgramToolStripMenuItem});
this.reportsToolStripMenuItem.Name = "reportsToolStripMenuItem"; this.reportsToolStripMenuItem.Name = "reportsToolStripMenuItem";
this.reportsToolStripMenuItem.Size = new System.Drawing.Size(239, 34); this.reportsToolStripMenuItem.Size = new System.Drawing.Size(270, 34);
this.reportsToolStripMenuItem.Text = "Reports"; this.reportsToolStripMenuItem.Text = "Reports";
// //
// studentBySchoolToolStripMenuItem // studentBySchoolToolStripMenuItem
@ -310,8 +314,9 @@
// exitsavesDataToolStripMenuItem // exitsavesDataToolStripMenuItem
// //
this.exitsavesDataToolStripMenuItem.Name = "exitsavesDataToolStripMenuItem"; this.exitsavesDataToolStripMenuItem.Name = "exitsavesDataToolStripMenuItem";
this.exitsavesDataToolStripMenuItem.Size = new System.Drawing.Size(239, 34); this.exitsavesDataToolStripMenuItem.Size = new System.Drawing.Size(270, 34);
this.exitsavesDataToolStripMenuItem.Text = "E&xit (saves data)"; this.exitsavesDataToolStripMenuItem.Text = "E&xit (saves data)";
this.exitsavesDataToolStripMenuItem.Click += new System.EventHandler(this.exitsavesDataToolStripMenuItem_Click);
// //
// studentBindingNavigator // studentBindingNavigator
// //
@ -355,10 +360,6 @@
this.bindingNavigatorAddNewItem.Size = new System.Drawing.Size(34, 30); this.bindingNavigatorAddNewItem.Size = new System.Drawing.Size(34, 30);
this.bindingNavigatorAddNewItem.Text = "Add new"; this.bindingNavigatorAddNewItem.Text = "Add new";
// //
// studentBindingSource
//
this.studentBindingSource.DataSource = typeof(DBWizard.Models.Student);
//
// bindingNavigatorCountItem // bindingNavigatorCountItem
// //
this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem"; this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
@ -733,6 +734,17 @@
this.studentDbID.TabIndex = 8; this.studentDbID.TabIndex = 8;
this.studentDbID.Visible = false; this.studentDbID.Visible = false;
// //
// studentBindingSource
//
this.studentBindingSource.DataSource = typeof(DBWizard.Models.Student);
//
// exitWithoutSavingToolStripMenuItem
//
this.exitWithoutSavingToolStripMenuItem.Name = "exitWithoutSavingToolStripMenuItem";
this.exitWithoutSavingToolStripMenuItem.Size = new System.Drawing.Size(270, 34);
this.exitWithoutSavingToolStripMenuItem.Text = "Exit without saving";
this.exitWithoutSavingToolStripMenuItem.Click += new System.EventHandler(this.exitWithoutSavingToolStripMenuItem_Click);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
@ -780,13 +792,13 @@
((System.ComponentModel.ISupportInitialize)(this.studentBindingNavigator)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.studentBindingNavigator)).EndInit();
this.studentBindingNavigator.ResumeLayout(false); this.studentBindingNavigator.ResumeLayout(false);
this.studentBindingNavigator.PerformLayout(); this.studentBindingNavigator.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.studentBindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.student_pictureBox)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.student_pictureBox)).EndInit();
this.parent_groupBox.ResumeLayout(false); this.parent_groupBox.ResumeLayout(false);
this.parent_groupBox.PerformLayout(); this.parent_groupBox.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.phoneNumberNumericUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.phoneNumberNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.studentDbID)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.studentDbID)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.studentBindingSource)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -844,6 +856,7 @@
private System.Windows.Forms.Label lblFoundStudents; private System.Windows.Forms.Label lblFoundStudents;
private System.Windows.Forms.ComboBox foundStudents_comboBox; private System.Windows.Forms.ComboBox foundStudents_comboBox;
private System.Windows.Forms.NumericUpDown studentDbID; private System.Windows.Forms.NumericUpDown studentDbID;
private System.Windows.Forms.ToolStripMenuItem exitWithoutSavingToolStripMenuItem;
} }
} }

View File

@ -406,5 +406,29 @@ namespace DBWizard
ClearForm(); ClearForm();
MessageBox.Show("Student deleted from database."); MessageBox.Show("Student deleted from database.");
} }
private void exitWithoutSavingToolStripMenuItem_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
private void exitsavesDataToolStripMenuItem_Click(object sender, EventArgs e)
{
//Error handling happens on the save_button_Click event, so no need to do it here.
save_button_Click(save_button, EventArgs.Empty);
//If there's an error, oh well, we tried, exit anyway.
Environment.Exit(0);
}
private void newStudentToolStripMenuItem_Click(object sender, EventArgs e)
{
clear_button_Click(clear_button, EventArgs.Empty);
}
private void saveStudentToolStripMenuItem_Click(object sender, EventArgs e)
{
save_button_Click(save_button, EventArgs.Empty);
}
} //Form1 } //Form1
} }

View File

@ -2253,4 +2253,7 @@
AAA= AAA=
</value> </value>
</data> </data>
<metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 65</value>
</metadata>
</root> </root>