Skip to content

Commit 4cfc494

Browse files
committed
New features
- Added value counts in manage stock area - Ticket number mandatory if 'Assigned' is selected in manage stock area - Ticket number not allowed if 'Stocked' is selected in manage stock area
1 parent 75eb4c1 commit 4cfc494

19 files changed

+120
-8
lines changed
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.

.vs/Stock Management Program/v17/.suo

-6 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
C:\Users\Mitchell\Documents\Real Stock Management Database

managestock.Designer.cs

Lines changed: 45 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

managestock.cs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,45 @@ private void selectcatagorybutton_Click(object sender, EventArgs e)
151151
// Display quantity count
152152
quantity_count.Text = count.ToString();
153153

154+
// Set unmarkednum to number of lines with "" in 2nd column
155+
int unmarkedqty = 0;
156+
foreach (string csvline in csvlines)
157+
{
158+
string[] csvvalues = csvline.Split(',');
159+
if (csvvalues[1] == "")
160+
{
161+
unmarkedqty++;
162+
}
163+
}
164+
// Display unmarked count
165+
unmarkednum.Text = ($"Unmarked: {unmarkedqty.ToString()}");
166+
167+
// Set assignednum to number of lines with "Assigned" in 2nd column
168+
int assignedqty = 0;
169+
foreach (string csvline in csvlines)
170+
{
171+
string[] csvvalues = csvline.Split(',');
172+
if (csvvalues[1] == "Assigned")
173+
{
174+
assignedqty++;
175+
}
176+
}
177+
// Display Assigned count
178+
assignednum.Text = ($"Assigned: {assignedqty.ToString()}");
179+
180+
// Set stockednum to number of lines with "Stocked" in 2nd column
181+
int stockedqty = 0;
182+
foreach (string csvline in csvlines)
183+
{
184+
string[] csvvalues = csvline.Split(',');
185+
if (csvvalues[1] == "Stocked")
186+
{
187+
stockedqty++;
188+
}
189+
}
190+
// Display Stocked count
191+
stockednum.Text = ($"Stocked: {stockedqty.ToString()}");
192+
154193
// Enable selected serial num box
155194
selectedserialtextbox.Enabled = true;
156195

@@ -446,6 +485,41 @@ private void assignedcheckbox_CheckedChanged(object sender, EventArgs e)
446485

447486
private void savebutton_Click(object sender, EventArgs e)
448487
{
488+
// If assigned is checked, ticket number is required
489+
if (assignedcheckbox.Checked == true)
490+
{
491+
// If ticket box is empty
492+
if (ticketnumberbox.Text == "")
493+
{
494+
MessageBox.Show("Ticket number is required.");
495+
return;
496+
}
497+
else
498+
{
499+
500+
}
501+
}
502+
else
503+
{
504+
}
505+
506+
// If stocked is checked, ticket number should be empty
507+
if (stockedcheckbox.Checked == true)
508+
{
509+
// If ticket box is not empty
510+
if (ticketnumberbox.Text != "")
511+
{
512+
MessageBox.Show("A stocked item shouldn't have a ticket number.");
513+
return;
514+
}
515+
else
516+
{
517+
518+
}
519+
}
520+
else
521+
{
522+
}
449523
// Save order number changes
450524
// Pull directory path from settings
451525
string directory_path;
Binary file not shown.
Binary file not shown.
Binary file not shown.

settings.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)