Fixed some UI bugs in the Category Manager form.

This commit is contained in:
2021-04-11 19:23:29 -05:00
parent ba556e7339
commit 6838635c78
7 changed files with 155 additions and 357 deletions
+27 -25
View File
@@ -41,12 +41,12 @@ namespace InventoryTest
this.NewCategoryNameTextBox = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.DeleteSubCategoryPropertyButton = new System.Windows.Forms.Button();
this.CreateSubCategoryButton = new System.Windows.Forms.Button();
this.SubCategoryPropertyNameTextBox = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.SubCategoryPropertiesListBox = new System.Windows.Forms.ListBox();
this.menuStrip2 = new System.Windows.Forms.MenuStrip();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.DeleteSubCategoryButton = new System.Windows.Forms.Button();
this.DeleteCategoryButton = new System.Windows.Forms.Button();
@@ -57,10 +57,10 @@ namespace InventoryTest
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.CategoryPropertiesListBox = new System.Windows.Forms.ListBox();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.DeleteCategoryPropertyButton = new System.Windows.Forms.Button();
this.CategoryPropertyNameTextBox = new System.Windows.Forms.TextBox();
this.CreateCategoryPropertyButton = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.MainLayoutPanel.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
@@ -128,11 +128,9 @@ namespace InventoryTest
this.tableLayoutPanel1.Controls.Add(this.groupBox7, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.groupBox6, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.groupBox4, 2, 2);
this.tableLayoutPanel1.Controls.Add(this.menuStrip2, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.groupBox2, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.groupBox3, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.groupBox5, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.groupBox8, 0, 3);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
@@ -198,6 +196,7 @@ namespace InventoryTest
//
// groupBox6
//
this.groupBox6.Controls.Add(this.DeleteSubCategoryPropertyButton);
this.groupBox6.Controls.Add(this.CreateSubCategoryButton);
this.groupBox6.Controls.Add(this.SubCategoryPropertyNameTextBox);
this.groupBox6.Controls.Add(this.label4);
@@ -209,6 +208,16 @@ namespace InventoryTest
this.groupBox6.TabStop = false;
this.groupBox6.Text = "Sub-Category Property";
//
// DeleteSubCategoryPropertyButton
//
this.DeleteSubCategoryPropertyButton.Enabled = false;
this.DeleteSubCategoryPropertyButton.Location = new System.Drawing.Point(6, 109);
this.DeleteSubCategoryPropertyButton.Name = "DeleteSubCategoryPropertyButton";
this.DeleteSubCategoryPropertyButton.Size = new System.Drawing.Size(75, 23);
this.DeleteSubCategoryPropertyButton.TabIndex = 3;
this.DeleteSubCategoryPropertyButton.Text = "Delete";
this.DeleteSubCategoryPropertyButton.UseVisualStyleBackColor = true;
//
// CreateSubCategoryButton
//
this.CreateSubCategoryButton.Enabled = false;
@@ -258,14 +267,6 @@ namespace InventoryTest
this.SubCategoryPropertiesListBox.Size = new System.Drawing.Size(252, 116);
this.SubCategoryPropertiesListBox.TabIndex = 1;
//
// menuStrip2
//
this.menuStrip2.Location = new System.Drawing.Point(0, 0);
this.menuStrip2.Name = "menuStrip2";
this.menuStrip2.Size = new System.Drawing.Size(264, 24);
this.menuStrip2.TabIndex = 0;
this.menuStrip2.Text = "menuStrip2";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.DeleteSubCategoryButton);
@@ -362,6 +363,7 @@ namespace InventoryTest
//
// groupBox5
//
this.groupBox5.Controls.Add(this.DeleteCategoryPropertyButton);
this.groupBox5.Controls.Add(this.CategoryPropertyNameTextBox);
this.groupBox5.Controls.Add(this.CreateCategoryPropertyButton);
this.groupBox5.Controls.Add(this.label3);
@@ -373,6 +375,17 @@ namespace InventoryTest
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Category Property";
//
// DeleteCategoryPropertyButton
//
this.DeleteCategoryPropertyButton.Enabled = false;
this.DeleteCategoryPropertyButton.Location = new System.Drawing.Point(6, 105);
this.DeleteCategoryPropertyButton.Name = "DeleteCategoryPropertyButton";
this.DeleteCategoryPropertyButton.Size = new System.Drawing.Size(75, 23);
this.DeleteCategoryPropertyButton.TabIndex = 6;
this.DeleteCategoryPropertyButton.Text = "Delete";
this.DeleteCategoryPropertyButton.UseVisualStyleBackColor = true;
this.DeleteCategoryPropertyButton.Click += new System.EventHandler(this.DeleteCategoryPropertyButton_Click);
//
// CategoryPropertyNameTextBox
//
this.CategoryPropertyNameTextBox.Location = new System.Drawing.Point(6, 41);
@@ -400,16 +413,6 @@ namespace InventoryTest
this.label3.TabIndex = 0;
this.label3.Text = "Property Name:";
//
// groupBox8
//
this.groupBox8.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox8.Location = new System.Drawing.Point(3, 312);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(258, 135);
this.groupBox8.TabIndex = 7;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "Delete";
//
// CategoryManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@@ -422,7 +425,6 @@ namespace InventoryTest
this.MainLayoutPanel.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.groupBox6.ResumeLayout(false);
@@ -445,7 +447,6 @@ namespace InventoryTest
private System.Windows.Forms.ComboBox SubCategoryComboBox;
private System.Windows.Forms.ComboBox CategoryComboBox;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.MenuStrip menuStrip2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.ComboBox CategoryComboBoxManager;
private System.Windows.Forms.Label label2;
@@ -470,6 +471,7 @@ namespace InventoryTest
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button DeleteSubCategoryButton;
private System.Windows.Forms.Button DeleteCategoryButton;
private System.Windows.Forms.GroupBox groupBox8;
private System.Windows.Forms.Button DeleteSubCategoryPropertyButton;
private System.Windows.Forms.Button DeleteCategoryPropertyButton;
}
}
+24 -4
View File
@@ -28,10 +28,22 @@ namespace InventoryTest
CategoryPropertyNameTextBox.TextChanged += CategoryPropertyNameTextBox_TextChanged;
SubCategoryPropertyNameTextBox.TextChanged += SubCategoryNameTextBox_TextChanged;
NewCategoryNameTextBox.TextChanged += NewCategoryNameTextBox_TextChanged;
CategoryPropertiesListBox.SelectedIndexChanged += CategoryPropertiesListBox_SelectedIndexChanged;
SubCategoryPropertiesListBox.SelectedIndexChanged += SubCategoryPropertiesListBox_SelectedIndexChanged;
LoadCategories();
}
private void SubCategoryPropertiesListBox_SelectedIndexChanged(object sender, EventArgs e)
{
DeleteSubCategoryPropertyButton.Enabled = SubCategoryPropertiesListBox.SelectedIndex >= 0;
}
private void CategoryPropertiesListBox_SelectedIndexChanged(object sender, EventArgs e)
{
DeleteCategoryPropertyButton.Enabled = CategoryPropertiesListBox.SelectedIndex >= 0;
}
private void NewCategoryNameTextBox_TextChanged(object sender, EventArgs e)
{
CreateNewCategoryButton.Enabled = !string.IsNullOrEmpty(NewCategoryNameTextBox.Text);
@@ -58,6 +70,8 @@ namespace InventoryTest
SubCategoryComboBoxManager.Items.Clear();
CategoryPropertiesListBox.Items.Clear();
SubCategoryPropertiesListBox.Items.Clear();
DeleteCategoryPropertyButton.Enabled = false;
DeleteSubCategoryPropertyButton.Enabled = false;
var id = CategoryIds[CategoryComboBoxManager.Text];
SubCategoryIds.Clear();
@@ -140,6 +154,7 @@ namespace InventoryTest
private void LoadSubCategoryProperties()
{
SubCategoryPropertiesListBox.Items.Clear();
DeleteSubCategoryPropertyButton.Enabled = false;
using var connection = new SqlConnection(ConnectionString);
using var command = new SqlCommand("SELECT * FROM GetSubCategoryProperties(@ID)", connection);
command.Parameters.AddWithValue("ID", SubCategoryIds[SubCategoryComboBoxManager.Text]);
@@ -155,15 +170,12 @@ namespace InventoryTest
private void ToggleSubCategoryProperty(bool enabled)
{
SubCategoryPropertyNameTextBox.Enabled = enabled;
CreateSubCategoryButton.Enabled = enabled;
DeleteSubCategoryButton.Enabled = enabled;
}
private void ToggleCategoryProperty(bool enabled)
{
CategoryPropertyNameTextBox.Enabled = enabled;
CreateCategoryPropertyButton.Enabled = enabled;
DeleteCategoryButton.Enabled = enabled;
}
private void CreateCategoryPropertyButton_Click(object sender, EventArgs e)
@@ -210,7 +222,7 @@ namespace InventoryTest
CategoryIds.Add(NewCategoryNameTextBox.Text, Convert.ToInt32(command.ExecuteScalar()));
CategoryComboBoxManager.Items.Add(NewCategoryNameTextBox);
CategoryComboBoxManager.Items.Add(NewCategoryNameTextBox.Text);
NewCategoryNameTextBox.Text = string.Empty;
NewCategoryNameTextBox.Focus();
@@ -237,6 +249,9 @@ namespace InventoryTest
SubCategoryComboBoxManager.Enabled = true;
if (SubCategoryComboBoxManager.SelectedIndex == -1) SubCategoryComboBoxManager.SelectedIndex = 0;
SubCategoryPropertyNameTextBox.Enabled = true;
DeleteSubCategoryButton.Enabled = true;
}
private void DeleteCategoryButton_Click(object sender, EventArgs e)
@@ -265,5 +280,10 @@ namespace InventoryTest
SubCategoryIds.Remove(SubCategoryComboBoxManager.Text);
SubCategoryComboBoxManager.Items.RemoveAt(SubCategoryComboBoxManager.SelectedIndex);
}
private void DeleteCategoryPropertyButton_Click(object sender, EventArgs e)
{
}
}
}
+97 -250
View File
@@ -29,242 +29,80 @@ namespace InventoryTest
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.MainLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ManageCategoriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.CategorySelectionComboBox = new System.Windows.Forms.ComboBox();
this.SubCategorySelectionComboBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.ItemListView = new System.Windows.Forms.ListView();
this.MainLayoutPanel.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// MainLayoutPanel
//
this.MainLayoutPanel.ColumnCount = 3;
this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 34F));
this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.MainLayoutPanel.ColumnCount = 4;
this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.MainLayoutPanel.Controls.Add(this.menuStrip1, 0, 0);
this.MainLayoutPanel.Controls.Add(this.groupBox1, 0, 1);
this.MainLayoutPanel.Controls.Add(this.groupBox2, 0, 2);
this.MainLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainLayoutPanel.Location = new System.Drawing.Point(0, 0);
this.MainLayoutPanel.Name = "MainLayoutPanel";
this.MainLayoutPanel.RowCount = 4;
this.MainLayoutPanel.RowCount = 5;
this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 34F));
this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.MainLayoutPanel.Size = new System.Drawing.Size(800, 450);
this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.MainLayoutPanel.Size = new System.Drawing.Size(1289, 618);
this.MainLayoutPanel.TabIndex = 0;
//
// menuStrip1
//
this.MainLayoutPanel.SetColumnSpan(this.menuStrip1, 3);
this.MainLayoutPanel.SetColumnSpan(this.menuStrip1, 4);
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.editToolStripMenuItem,
this.toolsToolStripMenuItem,
this.helpToolStripMenuItem});
this.toolsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(800, 24);
this.menuStrip1.Size = new System.Drawing.Size(1289, 24);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.openToolStripMenuItem,
this.toolStripSeparator,
this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem,
this.toolStripSeparator1,
this.printToolStripMenuItem,
this.printPreviewToolStripMenuItem,
this.toolStripSeparator2,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "&File";
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image")));
this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.newToolStripMenuItem.Text = "&New";
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image")));
this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.openToolStripMenuItem.Text = "&Open";
//
// toolStripSeparator
//
this.toolStripSeparator.Name = "toolStripSeparator";
this.toolStripSeparator.Size = new System.Drawing.Size(143, 6);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.saveToolStripMenuItem.Text = "&Save";
//
// saveAsToolStripMenuItem
//
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.saveAsToolStripMenuItem.Text = "Save &As";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(143, 6);
//
// printToolStripMenuItem
//
this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image")));
this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.printToolStripMenuItem.Name = "printToolStripMenuItem";
this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
this.printToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.printToolStripMenuItem.Text = "&Print";
//
// printPreviewToolStripMenuItem
//
this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image")));
this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.printPreviewToolStripMenuItem.Text = "Print Pre&view";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(143, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(93, 22);
this.exitToolStripMenuItem.Text = "E&xit";
//
// editToolStripMenuItem
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.undoToolStripMenuItem,
this.redoToolStripMenuItem,
this.toolStripSeparator3,
this.cutToolStripMenuItem,
this.copyToolStripMenuItem,
this.pasteToolStripMenuItem,
this.toolStripSeparator4,
this.selectAllToolStripMenuItem});
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
this.editToolStripMenuItem.Text = "&Edit";
//
// undoToolStripMenuItem
//
this.undoToolStripMenuItem.Name = "undoToolStripMenuItem";
this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
this.undoToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.undoToolStripMenuItem.Text = "&Undo";
//
// redoToolStripMenuItem
//
this.redoToolStripMenuItem.Name = "redoToolStripMenuItem";
this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
this.redoToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.redoToolStripMenuItem.Text = "&Redo";
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6);
//
// cutToolStripMenuItem
//
this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image")));
this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
this.cutToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.cutToolStripMenuItem.Text = "Cu&t";
//
// copyToolStripMenuItem
//
this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image")));
this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.copyToolStripMenuItem.Text = "&Copy";
//
// pasteToolStripMenuItem
//
this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image")));
this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.pasteToolStripMenuItem.Text = "&Paste";
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6);
//
// selectAllToolStripMenuItem
//
this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.selectAllToolStripMenuItem.Text = "Select &All";
//
// toolsToolStripMenuItem
//
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ManageCategoriesToolStripMenuItem,
this.optionsToolStripMenuItem});
this.ManageCategoriesToolStripMenuItem});
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20);
this.toolsToolStripMenuItem.Text = "&Tools";
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(62, 20);
this.toolsToolStripMenuItem.Text = "&Manage";
//
// ManageCategoriesToolStripMenuItem
//
@@ -272,58 +110,82 @@ namespace InventoryTest
this.ManageCategoriesToolStripMenuItem.Size = new System.Drawing.Size(176, 22);
this.ManageCategoriesToolStripMenuItem.Text = "Manage &Categories";
//
// optionsToolStripMenuItem
// groupBox1
//
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(176, 22);
this.optionsToolStripMenuItem.Text = "&Options";
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.SubCategorySelectionComboBox);
this.groupBox1.Controls.Add(this.CategorySelectionComboBox);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(3, 28);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(316, 142);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Category Selection";
//
// helpToolStripMenuItem
// CategorySelectionComboBox
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.contentsToolStripMenuItem,
this.indexToolStripMenuItem,
this.searchToolStripMenuItem,
this.toolStripSeparator5,
this.aboutToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.helpToolStripMenuItem.Text = "&Help";
this.CategorySelectionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CategorySelectionComboBox.FormattingEnabled = true;
this.CategorySelectionComboBox.Location = new System.Drawing.Point(94, 22);
this.CategorySelectionComboBox.Name = "CategorySelectionComboBox";
this.CategorySelectionComboBox.Size = new System.Drawing.Size(216, 23);
this.CategorySelectionComboBox.TabIndex = 0;
//
// contentsToolStripMenuItem
// SubCategorySelectionComboBox
//
this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem";
this.contentsToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
this.contentsToolStripMenuItem.Text = "&Contents";
this.SubCategorySelectionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.SubCategorySelectionComboBox.FormattingEnabled = true;
this.SubCategorySelectionComboBox.Location = new System.Drawing.Point(94, 62);
this.SubCategorySelectionComboBox.Name = "SubCategorySelectionComboBox";
this.SubCategorySelectionComboBox.Size = new System.Drawing.Size(216, 23);
this.SubCategorySelectionComboBox.TabIndex = 1;
//
// indexToolStripMenuItem
// label1
//
this.indexToolStripMenuItem.Name = "indexToolStripMenuItem";
this.indexToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
this.indexToolStripMenuItem.Text = "&Index";
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(58, 15);
this.label1.TabIndex = 2;
this.label1.Text = "Category:";
//
// searchToolStripMenuItem
// label2
//
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
this.searchToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
this.searchToolStripMenuItem.Text = "&Search";
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(6, 65);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(83, 15);
this.label2.TabIndex = 3;
this.label2.Text = "Sub-Category:";
//
// toolStripSeparator5
// groupBox2
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(119, 6);
this.groupBox2.Controls.Add(this.ItemListView);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox2.Location = new System.Drawing.Point(3, 176);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(316, 142);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Items:";
//
// aboutToolStripMenuItem
// ItemListView
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
this.aboutToolStripMenuItem.Text = "&About...";
this.ItemListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.ItemListView.HideSelection = false;
this.ItemListView.Location = new System.Drawing.Point(3, 19);
this.ItemListView.Name = "ItemListView";
this.ItemListView.Size = new System.Drawing.Size(310, 120);
this.ItemListView.TabIndex = 0;
this.ItemListView.UseCompatibleStateImageBehavior = false;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.ClientSize = new System.Drawing.Size(1289, 618);
this.Controls.Add(this.MainLayoutPanel);
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
@@ -332,6 +194,9 @@ namespace InventoryTest
this.MainLayoutPanel.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -341,34 +206,16 @@ namespace InventoryTest
private System.Windows.Forms.TableLayoutPanel MainLayoutPanel;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ManageCategoriesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox SubCategorySelectionComboBox;
private System.Windows.Forms.ComboBox CategorySelectionComboBox;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.ListView ItemListView;
}
}
+7 -1
View File
@@ -13,13 +13,19 @@ namespace InventoryTest
{
public partial class Form1 : Form
{
private static string ConnectionString { get; } = "Server=DESKTOP-HJES64T;Database=main;Integrated Security=true;";
private static string ConnectionString { get; } = "Server=DESKTOP-HJES64T;Database=Inventory;Integrated Security=true;";
public Form1()
{
InitializeComponent();
ManageCategoriesToolStripMenuItem.Click += ShowCategoryManagerForm;
exitToolStripMenuItem.Click += ExitToolStripMenuItem_Click;
}
private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
private void ShowCategoryManagerForm(object sender, EventArgs e)
-77
View File
@@ -57,81 +57,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing.Common" name="System.Drawing.Common, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
<data name="newToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABiSURBVDhP7czBCoAwCIBhn80nifnq1cVDddHjQtogtjbb
NRJ+BuI+yCMi0UtVp3Rejx0gYjMiiszcRjKwb0eV7UOgPuIBy7z2EQ+w947Yffp6jQeUDQFlP/B94G2P
wGgAACcYuZjJw4fhNwAAAABJRU5ErkJggg==
</value>
</data>
<data name="openToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFTSURBVDhPlZK9SgNBFIXnCcQnkLyA4CPkHayFdBY22ppG
S0vLiEUEQS0EK4kWIkaiFgYJwYUgWQ24wSRkV/evHOfczMQxsyPrwIGd4dxvzr2zbHZFUbSUJMlTmqYl
eZR/yeJgba/O7513nhsijAWhYhzH6wLAFzdO+dzKQT6IKKqiCKo9uqSTeocACiI8W9JuLhRWLtpkZsv7
hhZWjwiOdEgpVZDlE4B+G/b9UTBt47bZ4h/PNe57zlTR1xjAKgGc3pBuKh8+UDGkz2DUveMv55u/9Haz
Sz5KohIAgt6xV6+ggLqQABB8UwLEabRdgugpbNIBmAfDgXu1QweAqT5tGnauCYBv1BBAEbP6tal7uW0C
MJxZo0391tnkJRTgc+Aapr8Ujr2fGeDAax4bJpt6jQoPw/CVXkFED1CMnrLMWcKs8GcSQMQoAYIZ/Ee+
788zxtg3DfyyePrZw2oAAAAASUVORK5CYII=
</value>
</data>
<data name="saveToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABzSURBVDhPY/j69WvDt2/f/pODQXoZQIyYCfv+MwTPIQmD
9ID0gg3ApoAYjGHAh/cficLD2QBS8SA1AJufkTGyWtoagM5HFwdhmAEfkPMCukJkzcjiIAw24MuXLwbI
hqArRNaMLA7CYANAAGYISIA0/O0/AID67ECmnhNDAAAAAElFTkSuQmCC
</value>
</data>
<data name="printToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACHSURBVDhP3ZJRCoAgEEQ9Wngsj+UJOkF1kwpEP6sxFdNt
098GHgk7+yxI5LHWHi2Eeh0MpZQsTYJt3Un+KnDODcaYEYNWAcAOdgUOSik/7EFr7SXptedpIW+lQBc7
2H18d3y2QAp6eBXgzPEqoEolZS8Jcr4EZT/8DXeigKNaypObOUL9ihAnoWKSj1JdahUAAAAASUVORK5C
YII=
</value>
</data>
<data name="printPreviewToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADXSURBVDhPnZExDoIwFIY5gWfxDFzBVRMTRu4iriYuXqGT
BmO8gFudmQ2DaJsyPvlrawilFGzy5fFK/68tRO2hlKIQdV2vzXJ3YEEcx16SJKGyLP0SK6ieLwfM5/l5
WBISoA5KxgiAlWC9iX5HSNBlkqCLV8AYIyEkibfoDVocAT7I8VbQbHWgaLHXFX1fGDgCKeUVIbA7cV2B
7ySOQDfNzgjjGRX9vXiEBc3uczR/ncCEq+X28rv7pG/QDqNyzqmRjv8LVgAwgRdpmlK2yQZxrmDQk+NR
9AE47sSEPD2a+wAAAABJRU5ErkJggg==
</value>
</data>
<data name="cutToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE6SURBVDhPhZI9boNAEIU5Qo6QI+QM9Egp6anDAaho3NiN
z0LrCKU0nQt6UodIOOKvJPstM2gJFnnSiN15b+bNrO256LruZRiGO9E0zZOkPc6aRyPpLQz5EcfxlGXZ
1Pd9KmmPMzk4NJLewjhMvu9PYRhOOoW6k4NDI/It2rb9jKLICnUKdScHh0bkWyDO83w1heteFMVqtYfA
gV11CnUnt+uuMA6vZVkuU6g7OTiR7cOMfTscDraQSJKEdW5C/w9empGv18JGEAT7rw+M4IxIg6LL5d02
YAqXM3GWshkk2JEixPp1w+XQrprQFSJ+i6f669v+3ojrurbB2eXQUiPlcwNbYAT35sd+uVdVZYWPOBqP
4/i8NKDr8XiygjRNF5c9zhYDc9m8ge65x0n5DBEvru5f9i/HfWY87xeZHuplYWIClgAAAABJRU5ErkJg
gg==
</value>
</data>
<data name="copyToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAB4SURBVDhPtc9RCoAgDMbxzuZJAo9pN/KhetkejQWD/HLq
oAZ/ItIfbZEhomLFzOt9qDdyMITwKsZYcs5jRIFjP6tS2uYQC0DEXKkF6BrPzL+xAHw3V5oF5NlEPICk
iNxzAZgLwP4BsNZFTb5XAOYCcD4DRnWBuahc6R2LWkqXAfkAAAAASUVORK5CYII=
</value>
</data>
<data name="pasteToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACaSURBVDhPvZFBCsMgEEU9Qs/k2TyGe6/RrWdxYRPEbcof
/MTaZGpa6MDDcfQ/AzFj5ZxvpZR7rXUD6DFrx58LAe/9Zq0V0GPWjo+Lr4GUkgSdcwL6/hy02F4Y8kXy
yIswzlUBAwz3Eq5TgiOmBRr/EazLKn8ixqjyIhoFuIC9xpTg7EumBVx7LgtGQgjnAsJLGm+Cb2jxX8qY
J5nBJhUlLbsqAAAAAElFTkSuQmCC
</value>
</data>
</root>