From dd0594211f6952a33522a7740fbe87e5d299ddc8 Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Thu, 15 Apr 2021 18:31:11 -0500 Subject: [PATCH] The main form now pulls in category and sub category options for the user to select from. Removed some controls from the CategoryManager form that VS 2019 seems to have failed to clear from the designer's code. --- .../DesignTimeBuild/.dtbcache.v2 | Bin 73119 -> 73119 bytes .vs/InventoryTest/v16/.suo | Bin 36352 -> 43520 bytes InventoryTest/CategoryManager.Designer.cs | 20 -- InventoryTest/Form1.Designer.cs | 282 +++++++++--------- InventoryTest/Form1.cs | 112 ++++++- 5 files changed, 259 insertions(+), 155 deletions(-) diff --git a/.vs/InventoryTest/DesignTimeBuild/.dtbcache.v2 b/.vs/InventoryTest/DesignTimeBuild/.dtbcache.v2 index 2d93fa4750fe9916c88498c6c7f5c9b84af2015d..dd31158436879e5a63c701fff102d663469e60ff 100644 GIT binary patch delta 319 zcmbQgn`QoP7A7TziA;VD#)igb#+F8jX=cVINl6B#7KzD*MiyyFDM?0Y$rfoQY01WE z$(9DG=82}JCTYeNsflKZW`=172B|4#$reUQldpd|&c^I)6~iDs`QR6EmXy?j;>ih& zj+1M@NKW3xXbz&87&0b5{Gh~WGiQikxD7-T2^|18VHz@b-?Sd^Yx zQp`{_ng55ykFi0{m zFi0^lFi0~nFvu`4Fvv16Fvu}5Fvv47FeorEFfcMOFepNdVDM&OVEDk$^nvjM(+B1c zER7#nCoxX?z~(qP>zA~Q;|HM+f*&|O2!G)E!2N;e^9R8XydU^J@P80!XlO2D-CoAZ Hs3`#eSBPFB delta 581 zcmbQgn`QoP7N+w|6Pf(nEse}f42%*jl8uv06D<-A%+rh#P0TD(OcE_q%nVFSl9CLP z)6xvhjS|f*lT0klEldmyEey>q64MfmEDcf&7{r}QGjmENuJ@UIc7{4{QE6UDW^QV7 zeqLH;`ec1ZQ8bZ2MkzFr3P#7tXJ<%GzQkw_rW5_8CfhJ^O`h;kaq|Dqe7wOa*?J|3 zMd_&}#SG4qAAWF_XA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rkOZm?8XrtN3$Thi?-;b9Olx#tP4O7ko65s(DMg#LEKlF~C9KA$!ve8Pb z$stR1CokZWoP5B9gHL8xoH2`*sd(mm#tCz_O%8Kc19^er7uWk)2Hj_UVbYT?xZ6xV z<7UF*>gyIV`Jjmn)eW2^f+GZjCwr*sO#Z?bKy*lQ!b1|Azy#!2CS$=Y+@K_=BWJ-2 zPH_MK{|C{sAT0u*A_K$&VNj7Vd5T=iWEO4#kU0iE3=9mu3=9l@3=9nZ3=9kb3=9l` z3=9lG3=9mx3=9k*3=9mR&~gZ5z~mTt1(pPmWexHgEZHE&8u^e(V$PGDg={A`h<#!7 znp`UGH~BD=A*Uy_Y-0d917sUEJg_c5!5Fr=RKbsNva^u=WG00o827M*?_>e16h`IA zrB?ovU93$e|FEiIRG3_9?ayNdEq-BXof}j>gNiCpVEnf%#iA*A@(Cs#M)}EKCH;6A zLGfV#%}1czIk`m2f3mZx;p8t;{=DGA8&ufCOlO=hxl|e)o|6rjSU5n%Dkxh`^7G&T z#W_sbh~g=XpSt1jsfJ2DynX zk%56>E!X5KRWBY;&3=CyVlYfaL7=77Qlq#0z_n21aP9JUPW(g=h1h_vKyo3w|lAHE^1|$2|a4gzr$B{<%~DO1x$8PHNcg{$V#p}kmL$-2{e0wnq$b>iw8M-O>T&Z03{`edT1jM z#BqTI$QwxpW{>~~gW@BGA(J7Gp$x>G+>&G?`QY9E|DgN=5&)$H5Y14+pu;#hGERN+ zfjAMa!!ThsP$cq0q7`OL>ZEu>{xXJChCGH6hJ1!1hDwHz%?|wzjFTiv(DIu<53C%4 z!sX(>sm=1ID#24)7jCZ+}!x=AU9#=0pL3)HcK3V=hCFP0yk zd~41dQ0EAo#6bi&!!s~2xJIg5lo-Hx^2d;5upX>yZ^&}5;Wyves#s!cM9T4c)z04YblBLDyZ diff --git a/InventoryTest/CategoryManager.Designer.cs b/InventoryTest/CategoryManager.Designer.cs index d19e9fd..0b6302e 100644 --- a/InventoryTest/CategoryManager.Designer.cs +++ b/InventoryTest/CategoryManager.Designer.cs @@ -32,8 +32,6 @@ namespace InventoryTest this.MainLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.SubCategoryComboBox = new System.Windows.Forms.ComboBox(); - this.CategoryComboBox = new System.Windows.Forms.ComboBox(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.groupBox7 = new System.Windows.Forms.GroupBox(); this.CreateNewSubCategoryButton = new System.Windows.Forms.Button(); @@ -114,8 +112,6 @@ namespace InventoryTest // // groupBox1 // - this.groupBox1.Controls.Add(this.SubCategoryComboBox); - this.groupBox1.Controls.Add(this.CategoryComboBox); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox1.Location = new System.Drawing.Point(267, 28); this.groupBox1.Name = "groupBox1"; @@ -124,20 +120,6 @@ namespace InventoryTest this.groupBox1.TabStop = false; this.groupBox1.Text = "Category Selection"; // - // SubCategoryComboBox - // - this.SubCategoryComboBox.Location = new System.Drawing.Point(0, 0); - this.SubCategoryComboBox.Name = "SubCategoryComboBox"; - this.SubCategoryComboBox.Size = new System.Drawing.Size(121, 23); - this.SubCategoryComboBox.TabIndex = 0; - // - // CategoryComboBox - // - this.CategoryComboBox.Location = new System.Drawing.Point(0, 0); - this.CategoryComboBox.Name = "CategoryComboBox"; - this.CategoryComboBox.Size = new System.Drawing.Size(121, 23); - this.CategoryComboBox.TabIndex = 1; - // // tableLayoutPanel1 // this.tableLayoutPanel1.ColumnCount = 3; @@ -644,8 +626,6 @@ namespace InventoryTest private System.Windows.Forms.TableLayoutPanel MainLayoutPanel; private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.ComboBox SubCategoryComboBox; - private System.Windows.Forms.ComboBox CategoryComboBox; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.ComboBox CategoryComboBoxManager; diff --git a/InventoryTest/Form1.Designer.cs b/InventoryTest/Form1.Designer.cs index 0e5b2ff..895e9be 100644 --- a/InventoryTest/Form1.Designer.cs +++ b/InventoryTest/Form1.Designer.cs @@ -36,6 +36,7 @@ namespace InventoryTest this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ManageCategoriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.CreateItemButton = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.SubCategorySelectionComboBox = new System.Windows.Forms.ComboBox(); @@ -43,32 +44,32 @@ namespace InventoryTest this.groupBox2 = new System.Windows.Forms.GroupBox(); this.ItemListView = new System.Windows.Forms.ListView(); this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.label7 = new System.Windows.Forms.Label(); - this.CorePropertySoldCheckBox = new System.Windows.Forms.CheckBox(); - this.label8 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.CorePropertyNameTextBox = new System.Windows.Forms.TextBox(); - this.CorePropertyValueTextBox = new System.Windows.Forms.TextBox(); - this.CorePropertyBoughtForTextBox = new System.Windows.Forms.TextBox(); - this.CorePropertyDateAquiredDateTimePicker = new System.Windows.Forms.DateTimePicker(); - this.CorePropertySoldForTextBox = new System.Windows.Forms.TextBox(); - this.CorePropertyDateSoldDateTimePicker = new System.Windows.Forms.DateTimePicker(); this.CorePropertySoldToTextBox = new System.Windows.Forms.TextBox(); + this.CorePropertyDateSoldDateTimePicker = new System.Windows.Forms.DateTimePicker(); + this.CorePropertySoldForTextBox = new System.Windows.Forms.TextBox(); + this.CorePropertyDateAquiredDateTimePicker = new System.Windows.Forms.DateTimePicker(); + this.CorePropertyBoughtForTextBox = new System.Windows.Forms.TextBox(); + this.CorePropertyValueTextBox = new System.Windows.Forms.TextBox(); + this.CorePropertyNameTextBox = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.CorePropertySoldCheckBox = new System.Windows.Forms.CheckBox(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.CorePropertyCommentGroupBox = new System.Windows.Forms.GroupBox(); this.CorePropertyCommentTextBox = new System.Windows.Forms.TextBox(); + this.CorePropertyNotesGroupBox = new System.Windows.Forms.GroupBox(); this.CorePropertyNotesTextBox = new System.Windows.Forms.TextBox(); this.MainLayoutPanel.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.groupBox5.SuspendLayout(); + this.CorePropertyCommentGroupBox.SuspendLayout(); + this.CorePropertyNotesGroupBox.SuspendLayout(); this.SuspendLayout(); // // MainLayoutPanel @@ -82,8 +83,8 @@ namespace InventoryTest this.MainLayoutPanel.Controls.Add(this.groupBox1, 0, 1); this.MainLayoutPanel.Controls.Add(this.groupBox2, 0, 2); this.MainLayoutPanel.Controls.Add(this.groupBox3, 0, 3); - this.MainLayoutPanel.Controls.Add(this.groupBox4, 1, 3); - this.MainLayoutPanel.Controls.Add(this.groupBox5, 1, 4); + this.MainLayoutPanel.Controls.Add(this.CorePropertyCommentGroupBox, 1, 3); + this.MainLayoutPanel.Controls.Add(this.CorePropertyNotesGroupBox, 1, 4); this.MainLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.MainLayoutPanel.Location = new System.Drawing.Point(0, 0); this.MainLayoutPanel.Name = "MainLayoutPanel"; @@ -138,6 +139,7 @@ namespace InventoryTest // // groupBox1 // + this.groupBox1.Controls.Add(this.CreateItemButton); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.SubCategorySelectionComboBox); @@ -150,6 +152,16 @@ namespace InventoryTest this.groupBox1.TabStop = false; this.groupBox1.Text = "Category Selection"; // + // CreateItemButton + // + this.CreateItemButton.Enabled = false; + this.CreateItemButton.Location = new System.Drawing.Point(235, 113); + this.CreateItemButton.Name = "CreateItemButton"; + this.CreateItemButton.Size = new System.Drawing.Size(75, 23); + this.CreateItemButton.TabIndex = 4; + this.CreateItemButton.Text = "button1"; + this.CreateItemButton.UseVisualStyleBackColor = true; + // // label2 // this.label2.AutoSize = true; @@ -233,72 +245,73 @@ namespace InventoryTest this.groupBox3.TabStop = false; this.groupBox3.Text = "Core Properties"; // - // label3 + // CorePropertySoldToTextBox // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(3, 19); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(42, 15); - this.label3.TabIndex = 0; - this.label3.Text = "Name:"; + this.CorePropertySoldToTextBox.Location = new System.Drawing.Point(94, 209); + this.CorePropertySoldToTextBox.Name = "CorePropertySoldToTextBox"; + this.CorePropertySoldToTextBox.Size = new System.Drawing.Size(216, 23); + this.CorePropertySoldToTextBox.TabIndex = 14; // - // label4 + // CorePropertyDateSoldDateTimePicker // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(6, 46); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(38, 15); - this.label4.TabIndex = 1; - this.label4.Text = "Value:"; + this.CorePropertyDateSoldDateTimePicker.Location = new System.Drawing.Point(94, 179); + this.CorePropertyDateSoldDateTimePicker.Name = "CorePropertyDateSoldDateTimePicker"; + this.CorePropertyDateSoldDateTimePicker.Size = new System.Drawing.Size(216, 23); + this.CorePropertyDateSoldDateTimePicker.TabIndex = 13; // - // label5 + // CorePropertySoldForTextBox // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(6, 73); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(69, 15); - this.label5.TabIndex = 2; - this.label5.Text = "Bought For:"; + this.CorePropertySoldForTextBox.Location = new System.Drawing.Point(94, 124); + this.CorePropertySoldForTextBox.Name = "CorePropertySoldForTextBox"; + this.CorePropertySoldForTextBox.Size = new System.Drawing.Size(216, 23); + this.CorePropertySoldForTextBox.TabIndex = 12; // - // label6 + // CorePropertyDateAquiredDateTimePicker // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(6, 100); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(79, 15); - this.label6.TabIndex = 3; - this.label6.Text = "Date Aquired:"; + this.CorePropertyDateAquiredDateTimePicker.Location = new System.Drawing.Point(94, 97); + this.CorePropertyDateAquiredDateTimePicker.Name = "CorePropertyDateAquiredDateTimePicker"; + this.CorePropertyDateAquiredDateTimePicker.Size = new System.Drawing.Size(216, 23); + this.CorePropertyDateAquiredDateTimePicker.TabIndex = 11; // - // groupBox4 + // CorePropertyBoughtForTextBox // - this.groupBox4.Controls.Add(this.CorePropertyCommentTextBox); - this.groupBox4.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox4.Location = new System.Drawing.Point(325, 324); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(316, 142); - this.groupBox4.TabIndex = 4; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Comment"; + this.CorePropertyBoughtForTextBox.Location = new System.Drawing.Point(94, 70); + this.CorePropertyBoughtForTextBox.Name = "CorePropertyBoughtForTextBox"; + this.CorePropertyBoughtForTextBox.Size = new System.Drawing.Size(216, 23); + this.CorePropertyBoughtForTextBox.TabIndex = 10; // - // groupBox5 + // CorePropertyValueTextBox // - this.groupBox5.Controls.Add(this.CorePropertyNotesTextBox); - this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox5.Location = new System.Drawing.Point(325, 472); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(316, 143); - this.groupBox5.TabIndex = 5; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "Notes"; + this.CorePropertyValueTextBox.Location = new System.Drawing.Point(94, 43); + this.CorePropertyValueTextBox.Name = "CorePropertyValueTextBox"; + this.CorePropertyValueTextBox.Size = new System.Drawing.Size(216, 23); + this.CorePropertyValueTextBox.TabIndex = 9; // - // label7 + // CorePropertyNameTextBox // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(6, 127); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(53, 15); - this.label7.TabIndex = 4; - this.label7.Text = "Sold For:"; + this.CorePropertyNameTextBox.Enabled = false; + this.CorePropertyNameTextBox.Location = new System.Drawing.Point(94, 16); + this.CorePropertyNameTextBox.Name = "CorePropertyNameTextBox"; + this.CorePropertyNameTextBox.Size = new System.Drawing.Size(216, 23); + this.CorePropertyNameTextBox.TabIndex = 8; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(6, 212); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(48, 15); + this.label9.TabIndex = 7; + this.label9.Text = "Sold To:"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(6, 185); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(60, 15); + this.label8.TabIndex = 6; + this.label8.Text = "Date Sold:"; // // CorePropertySoldCheckBox // @@ -311,72 +324,61 @@ namespace InventoryTest this.CorePropertySoldCheckBox.Text = "?Sold"; this.CorePropertySoldCheckBox.UseVisualStyleBackColor = true; // - // label8 + // label7 // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(6, 185); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(60, 15); - this.label8.TabIndex = 6; - this.label8.Text = "Date Sold:"; + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(6, 127); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(53, 15); + this.label7.TabIndex = 4; + this.label7.Text = "Sold For:"; // - // label9 + // label6 // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(6, 212); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(48, 15); - this.label9.TabIndex = 7; - this.label9.Text = "Sold To:"; + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(6, 100); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(79, 15); + this.label6.TabIndex = 3; + this.label6.Text = "Date Aquired:"; // - // CorePropertyNameTextBox + // label5 // - this.CorePropertyNameTextBox.Location = new System.Drawing.Point(94, 16); - this.CorePropertyNameTextBox.Name = "CorePropertyNameTextBox"; - this.CorePropertyNameTextBox.Size = new System.Drawing.Size(216, 23); - this.CorePropertyNameTextBox.TabIndex = 8; + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(6, 73); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(69, 15); + this.label5.TabIndex = 2; + this.label5.Text = "Bought For:"; // - // CorePropertyValueTextBox + // label4 // - this.CorePropertyValueTextBox.Location = new System.Drawing.Point(94, 43); - this.CorePropertyValueTextBox.Name = "CorePropertyValueTextBox"; - this.CorePropertyValueTextBox.Size = new System.Drawing.Size(216, 23); - this.CorePropertyValueTextBox.TabIndex = 9; + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(6, 46); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(38, 15); + this.label4.TabIndex = 1; + this.label4.Text = "Value:"; // - // CorePropertyBoughtForTextBox + // label3 // - this.CorePropertyBoughtForTextBox.Location = new System.Drawing.Point(94, 70); - this.CorePropertyBoughtForTextBox.Name = "CorePropertyBoughtForTextBox"; - this.CorePropertyBoughtForTextBox.Size = new System.Drawing.Size(216, 23); - this.CorePropertyBoughtForTextBox.TabIndex = 10; + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(3, 19); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(42, 15); + this.label3.TabIndex = 0; + this.label3.Text = "Name:"; // - // CorePropertyDateAquiredDateTimePicker + // CorePropertyCommentGroupBox // - this.CorePropertyDateAquiredDateTimePicker.Location = new System.Drawing.Point(94, 97); - this.CorePropertyDateAquiredDateTimePicker.Name = "CorePropertyDateAquiredDateTimePicker"; - this.CorePropertyDateAquiredDateTimePicker.Size = new System.Drawing.Size(216, 23); - this.CorePropertyDateAquiredDateTimePicker.TabIndex = 11; - // - // CorePropertySoldForTextBox - // - this.CorePropertySoldForTextBox.Location = new System.Drawing.Point(94, 124); - this.CorePropertySoldForTextBox.Name = "CorePropertySoldForTextBox"; - this.CorePropertySoldForTextBox.Size = new System.Drawing.Size(216, 23); - this.CorePropertySoldForTextBox.TabIndex = 12; - // - // CorePropertyDateSoldDateTimePicker - // - this.CorePropertyDateSoldDateTimePicker.Location = new System.Drawing.Point(94, 179); - this.CorePropertyDateSoldDateTimePicker.Name = "CorePropertyDateSoldDateTimePicker"; - this.CorePropertyDateSoldDateTimePicker.Size = new System.Drawing.Size(216, 23); - this.CorePropertyDateSoldDateTimePicker.TabIndex = 13; - // - // CorePropertySoldToTextBox - // - this.CorePropertySoldToTextBox.Location = new System.Drawing.Point(94, 209); - this.CorePropertySoldToTextBox.Name = "CorePropertySoldToTextBox"; - this.CorePropertySoldToTextBox.Size = new System.Drawing.Size(216, 23); - this.CorePropertySoldToTextBox.TabIndex = 14; + this.CorePropertyCommentGroupBox.Controls.Add(this.CorePropertyCommentTextBox); + this.CorePropertyCommentGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.CorePropertyCommentGroupBox.Location = new System.Drawing.Point(325, 324); + this.CorePropertyCommentGroupBox.Name = "CorePropertyCommentGroupBox"; + this.CorePropertyCommentGroupBox.Size = new System.Drawing.Size(316, 142); + this.CorePropertyCommentGroupBox.TabIndex = 4; + this.CorePropertyCommentGroupBox.TabStop = false; + this.CorePropertyCommentGroupBox.Text = "Comment"; // // CorePropertyCommentTextBox // @@ -388,6 +390,17 @@ namespace InventoryTest this.CorePropertyCommentTextBox.Size = new System.Drawing.Size(310, 120); this.CorePropertyCommentTextBox.TabIndex = 0; // + // CorePropertyNotesGroupBox + // + this.CorePropertyNotesGroupBox.Controls.Add(this.CorePropertyNotesTextBox); + this.CorePropertyNotesGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.CorePropertyNotesGroupBox.Location = new System.Drawing.Point(325, 472); + this.CorePropertyNotesGroupBox.Name = "CorePropertyNotesGroupBox"; + this.CorePropertyNotesGroupBox.Size = new System.Drawing.Size(316, 143); + this.CorePropertyNotesGroupBox.TabIndex = 5; + this.CorePropertyNotesGroupBox.TabStop = false; + this.CorePropertyNotesGroupBox.Text = "Notes"; + // // CorePropertyNotesTextBox // this.CorePropertyNotesTextBox.Dock = System.Windows.Forms.DockStyle.Fill; @@ -416,10 +429,10 @@ namespace InventoryTest this.groupBox2.ResumeLayout(false); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - this.groupBox5.ResumeLayout(false); - this.groupBox5.PerformLayout(); + this.CorePropertyCommentGroupBox.ResumeLayout(false); + this.CorePropertyCommentGroupBox.PerformLayout(); + this.CorePropertyNotesGroupBox.ResumeLayout(false); + this.CorePropertyNotesGroupBox.PerformLayout(); this.ResumeLayout(false); } @@ -448,8 +461,8 @@ namespace InventoryTest private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label3; - private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.GroupBox CorePropertyCommentGroupBox; + private System.Windows.Forms.GroupBox CorePropertyNotesGroupBox; private System.Windows.Forms.TextBox CorePropertySoldToTextBox; private System.Windows.Forms.DateTimePicker CorePropertyDateSoldDateTimePicker; private System.Windows.Forms.TextBox CorePropertySoldForTextBox; @@ -459,6 +472,7 @@ namespace InventoryTest private System.Windows.Forms.TextBox CorePropertyNameTextBox; private System.Windows.Forms.TextBox CorePropertyCommentTextBox; private System.Windows.Forms.TextBox CorePropertyNotesTextBox; + private System.Windows.Forms.Button CreateItemButton; } } diff --git a/InventoryTest/Form1.cs b/InventoryTest/Form1.cs index 3f2c119..1f9c9be 100644 --- a/InventoryTest/Form1.cs +++ b/InventoryTest/Form1.cs @@ -13,7 +13,12 @@ namespace InventoryTest { public partial class Form1 : Form { - private static string ConnectionString { get; } = "Server=DESKTOP-HJES64T;Database=Inventory;Integrated Security=true;"; + private string ConnectionString { get; } = "Server=DESKTOP-HJES64T;Database=Inventory;Integrated Security=true;"; + private int CommentsMaxLength { get; } = 3072; + private int NotesMaxLength { get; } = 3072; + private Dictionary CategoryIds { get; } = new(); + private Dictionary SubCategoryIds { get; } = new(); + private Dictionary PropertyTypeIds { get; } = new(); public Form1() { @@ -21,6 +26,103 @@ namespace InventoryTest ManageCategoriesToolStripMenuItem.Click += ShowCategoryManagerForm; exitToolStripMenuItem.Click += ExitToolStripMenuItem_Click; + CorePropertyCommentTextBox.TextChanged += CorePropertyCommentTextBox_TextChanged; + CorePropertyCommentTextBox.MaxLength = CommentsMaxLength; + CorePropertyCommentGroupBox.Text = $"Comments (Remaing Characters: {CorePropertyCommentTextBox.MaxLength - CorePropertyCommentTextBox.TextLength})"; + CorePropertyNotesTextBox.TextChanged += CorePropertyNotesTextBox_TextChanged; + CorePropertyNotesTextBox.MaxLength = NotesMaxLength; + CorePropertyNotesGroupBox.Text = $"Notes (Remaing Characters: {CorePropertyNotesTextBox.MaxLength - CorePropertyNotesTextBox.TextLength})"; + CorePropertyNameTextBox.TextChanged += ToggleCreateItemButton; + CorePropertyBoughtForTextBox.TextChanged += ToggleCreateItemButton; + CorePropertySoldForTextBox.TextChanged += ToggleCreateItemButton; + CorePropertyValueTextBox.TextChanged += ToggleCreateItemButton; + + CategorySelectionComboBox.SelectedIndexChanged += CategorySelectionComboBox_SelectedIndexChanged; + SubCategorySelectionComboBox.SelectedIndexChanged += SubCategorySelectionComboBox_SelectedIndexChanged; + + LoadCategories(); + } + + private void SubCategorySelectionComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + //throw new NotImplementedException(); + } + + private void CategorySelectionComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + SubCategoryIds.Clear(); + SubCategorySelectionComboBox.Items.Clear(); + + using var connection = new SqlConnection(ConnectionString); + using var command = new SqlCommand("SELECT ID, Name FROM dbo.GetCategorySubCategories(@ID)", connection); + command.Parameters.AddWithValue("ID", CategoryIds[CategorySelectionComboBox.Text]); + + connection.Open(); + + var reader = command.ExecuteReader(); + + while (reader.Read()) + { + SubCategoryIds.Add(reader["Name"].ToString(), Convert.ToInt32(reader["ID"])); + SubCategorySelectionComboBox.Items.Add(reader["Name"].ToString()); + } + + if (SubCategorySelectionComboBox.Items.Count > 0) + { + SubCategorySelectionComboBox.Enabled = true; + SubCategorySelectionComboBox.SelectedIndex = 0; + } + else SubCategorySelectionComboBox.Enabled = false; + } + + private void LoadCategories() + { + CategoryIds.Clear(); + + using var connection = new SqlConnection(ConnectionString); + using var command = new SqlCommand("SELECT [Category ID], [Category Name] FROM Category", connection); + + connection.Open(); + + var reader = command.ExecuteReader(); + + while (reader.Read()) + { + CategoryIds.Add(reader["Category Name"].ToString(), Convert.ToInt32(reader["Category ID"])); + CategorySelectionComboBox.Items.Add(reader["Category Name"]); + } + + reader.Close(); + + if (CategorySelectionComboBox.Items.Count > 0) + { + CategorySelectionComboBox.SelectedIndex = 0; + CorePropertyNameTextBox.Enabled = true; + } + else CorePropertyNameTextBox.Enabled = false; + } + + private void ToggleCreateItemButton(object sender, EventArgs e) + { + var valueValid = CorePropertyValueTextBox.Text.Trim().Length == 0; + var boughtForValid = CorePropertyBoughtForTextBox.Text.Trim().Length == 0; + var soldForValid = CorePropertySoldForTextBox.Text.Trim().Length == 0; + + if (!valueValid) valueValid = decimal.TryParse(CorePropertyValueTextBox.Text, out decimal _); + if (!boughtForValid) boughtForValid = decimal.TryParse(CorePropertyBoughtForTextBox.Text, out decimal _); + if (!soldForValid) soldForValid = decimal.TryParse(CorePropertySoldForTextBox.Text, out decimal _); + + CreateItemButton.Enabled = CorePropertyNameTextBox.Text.Trim().Length > 0 && valueValid && boughtForValid && soldForValid; + } + + private void CorePropertyNotesTextBox_TextChanged(object sender, EventArgs e) + { + CorePropertyNotesGroupBox.Text = $"Notes (Remaing Characters: {CorePropertyNotesTextBox.MaxLength - CorePropertyNotesTextBox.TextLength})"; + } + + private void CorePropertyCommentTextBox_TextChanged(object sender, EventArgs e) + { + CorePropertyCommentGroupBox.Text = $"Comments (Remaing Characters: {CorePropertyCommentTextBox.MaxLength - CorePropertyCommentTextBox.TextLength})"; } private void ExitToolStripMenuItem_Click(object sender, EventArgs e) @@ -33,5 +135,13 @@ namespace InventoryTest var form = new CategoryManager(ConnectionString); form.ShowDialog(); } + + private struct ItemPropertyPairing + { + public int PropertyID; + public int ItemID; + public int PropertyTypeID; + public string Value; + } } }