Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
c1ac4c3
old file code
CTH-npitx Sep 29, 2025
c7b18a0
debug boolean
CTH-npitx Sep 29, 2025
772f5b5
Merge branch 'master' into file-code
CTH-npitx Sep 29, 2025
ac03423
correct bool location
CTH-npitx Sep 29, 2025
36bd455
namespace
CTH-npitx Sep 29, 2025
3d8398b
Merge branch 'debug-bool' into file-code
CTH-npitx Sep 29, 2025
a63e0bb
Merge branch 'master' into file-code
CTH-npitx Sep 29, 2025
5f2e414
Update snackShack.csproj
CTH-npitx Sep 29, 2025
a2afb9e
pre-made error message
CTH-npitx Sep 29, 2025
85c7b41
Merge branch 'master' into pre-set-debug-message
CTH-npitx Sep 29, 2025
0c1e2e1
Update fileCode.cs
CTH-npitx Sep 29, 2025
4a0d69c
Merge branch 'pre-set-debug-message' into file-code
CTH-npitx Sep 29, 2025
4577906
Update Program.cs
CTH-npitx Sep 29, 2025
44ac2cf
Update Program.cs
CTH-npitx Sep 29, 2025
4b25608
Update inventory.cs
CTH-npitx Sep 29, 2025
de825db
Update inventory.cs
CTH-npitx Sep 29, 2025
5d7451f
write code
CTH-npitx Sep 29, 2025
13c686e
Update inventory.cs
CTH-npitx Sep 29, 2025
79d8db0
read file
CTH-npitx Sep 29, 2025
1ca7e57
File Code
CTH-npitx Sep 29, 2025
447b66b
remove file export
CTH-npitx Feb 18, 2026
8bbcc84
Create Program Documentation.txt
CTH-npitx Feb 18, 2026
d08e694
move files
CTH-npitx Feb 18, 2026
fd0b0f1
move and merge 1
CTH-npitx Feb 18, 2026
893bc46
Merge branch 'directly-use-adress-book' into export-file
CTH-npitx Feb 18, 2026
29b31af
.git files
CTH-npitx Feb 18, 2026
de1c51a
properties
CTH-npitx Feb 18, 2026
1f01dd9
move frm_main
CTH-npitx Feb 18, 2026
7fc0af8
move classes
CTH-npitx Feb 18, 2026
a945907
move csproj
CTH-npitx Feb 18, 2026
318354a
Merge branch 'directly-use-adress-book' into export-file
CTH-npitx Feb 18, 2026
a3b790c
Merge branch 'directly-use-adress-book' into export-file
CTH-npitx Feb 19, 2026
90c0b0f
missing note
CTH-npitx Feb 19, 2026
fa2767a
Update Program Documentation.txt
CTH-npitx Feb 19, 2026
e0fa088
Merge branch 'export-file' into update-notes
CTH-npitx Feb 19, 2026
5d54456
Delete Move and move.txt
CTH-npitx Feb 19, 2026
c3633b1
Update Notes
CTH-npitx Feb 19, 2026
abe5783
Merge branch 'directly-use-adress-book' into base-point
CTH-npitx Feb 19, 2026
46da57e
redundant files
CTH-npitx Feb 19, 2026
31016bc
Merge branch 'export-file' into base-point
CTH-npitx Feb 19, 2026
06fa299
Base Point
CTH-npitx Feb 19, 2026
d18db58
delete exraneus
CTH-npitx Feb 19, 2026
f505e40
Merge branch 'directly-use-adress-book' into clean-folders
CTH-npitx Feb 19, 2026
91a2069
update notes
CTH-npitx Feb 19, 2026
ae74714
Clean Folders
CTH-npitx Feb 19, 2026
405a386
Merge branch 'directly-use-adress-book' into export-file
CTH-npitx Feb 19, 2026
67a5dae
Export Files
CTH-npitx Feb 19, 2026
beebf64
build soloution
CTH-npitx Feb 19, 2026
9777b8c
build soloution
CTH-npitx Feb 19, 2026
6edae5e
Full Integrate
CTH-npitx Feb 19, 2026
86737cc
extraneus files
CTH-npitx Feb 23, 2026
71bf1af
Merge branch 'directly-use-adress-book' into list-example-files
CTH-npitx Feb 23, 2026
74e7bfa
Update Extraneus Files.txt
CTH-npitx Feb 23, 2026
97a3c64
Merge branch 'full-integrate' into list-example-files
CTH-npitx Feb 23, 2026
57d0db8
temporary delete
CTH-npitx Feb 23, 2026
b4d09f3
Create store.con
CTH-npitx Feb 23, 2026
405574d
Merge branch 'directly-use-adress-book' into transfer-.con
CTH-npitx Feb 23, 2026
d19a0e7
Revert "temporary delete"
CTH-npitx Feb 23, 2026
eadfcbd
Transfer ".csv"
CTH-npitx Feb 23, 2026
07f409d
Merge branch 'directly-use-adress-book' into list-example-files
CTH-npitx Feb 23, 2026
f262b23
location
CTH-npitx Feb 23, 2026
ef2842c
add store
CTH-npitx Feb 23, 2026
068c7f5
Update Extraneus Files.txt
CTH-npitx Feb 23, 2026
0ffeb4a
List Examples
CTH-npitx Feb 23, 2026
2a3f7aa
Update Full Integrate
CTH-npitx Feb 23, 2026
12fecfc
Update To Codeing Base
CTH-npitx Feb 23, 2026
5e3e0ae
rename
CTH-npitx Feb 23, 2026
f676c4c
Coding Base 2
CTH-npitx Feb 23, 2026
857cffc
Revert "Full Integrate"
CTH-npitx Feb 25, 2026
272cc39
Merge branch 'full-integrate' into coding-base-2
CTH-npitx Feb 25, 2026
e892f1b
Revert "Merge branch 'full-integrate' into coding-base-2"
CTH-npitx Feb 25, 2026
751287a
Update Program Documentation.txt
CTH-npitx Feb 25, 2026
bb9cc85
Merge branch 'coding-base-2' into full-integrate
CTH-npitx Feb 25, 2026
322d4af
Revert "Merge branch 'coding-base-2' into full-integrate"
CTH-npitx Feb 25, 2026
85030fd
Merge branch 'code-base' into add-.con
CTH-npitx Feb 25, 2026
be49d1e
Revert "temporary delete"
CTH-npitx Feb 25, 2026
4772734
Add .con file
CTH-npitx Feb 25, 2026
6e2132b
Merge branch 'code-base' into full-integrate
CTH-npitx Feb 25, 2026
83d7831
Coded Base
CTH-npitx Feb 25, 2026
fa43256
Pre-merge
CTH-npitx Feb 25, 2026
a1be8a2
Merge branch 'directly-use-adress-book' into preMerge-code
CTH-npitx Feb 25, 2026
61d46dd
Pre-Merge Code
CTH-npitx Feb 25, 2026
2f80eba
Update fileCode.cs
CTH-npitx Feb 25, 2026
f2f9828
Merge branch 'directly-use-adress-book' into integrate-file-code
CTH-npitx Feb 25, 2026
5686ffe
Revert "Update fileCode.cs"
CTH-npitx Feb 25, 2026
ac3922e
Update snackShack.csproj
CTH-npitx Feb 25, 2026
506d5b6
Update snackShack.csproj
CTH-npitx Feb 25, 2026
da18696
Update Soloution
CTH-npitx Feb 25, 2026
8a125cf
Merge branch 'directly-use-adress-book' into coding-base
CTH-npitx Feb 25, 2026
7e09c69
Revert "Pre-Merge Code"
CTH-npitx Feb 25, 2026
38f0e85
Merge branch 'coding-base' into simple-format-edits
CTH-npitx Feb 25, 2026
f47b619
lowercase
CTH-npitx Feb 25, 2026
d134ed9
Merge branch 'directly-use-adress-book' into minor-format-edits
CTH-npitx Feb 25, 2026
8712c19
second revert
CTH-npitx Feb 25, 2026
2ac1564
Minor Format Edits
CTH-npitx Feb 25, 2026
a211bdd
Merge branch 'directly-use-adress-book' into coding-base
CTH-npitx Feb 25, 2026
964bb3e
Merge branch 'coding-base' into simple-format-edits
CTH-npitx Feb 25, 2026
8f88216
Simple Format Edits
CTH-npitx Mar 2, 2026
79f146d
Ensure Linearality
CTH-npitx Mar 2, 2026
0098935
Update Program Documentation.txt
CTH-npitx Mar 2, 2026
7feff96
Merge branch 'directly-use-adress-book' into coding-base
CTH-npitx Mar 2, 2026
15b3ec4
background files
CTH-npitx Mar 2, 2026
0e87cac
transfer base in as a merge commit so all changes are noticable at once
CTH-npitx Mar 2, 2026
47de1ac
the 3.x.x base
CTH-npitx Mar 2, 2026
c08cd26
Match Base 3.x.x base3
CTH-npitx Mar 2, 2026
08fcf59
move inventory.csv
CTH-npitx Mar 9, 2026
4790b5a
build
CTH-npitx Mar 9, 2026
981723a
Merge branch 'directly-use-adress-book' into move-inventory
CTH-npitx Mar 9, 2026
eb099a8
Move Inventory
CTH-npitx Mar 9, 2026
3b72a91
Revert "transfer base in as a merge commit so all changes are noticab…
CTH-npitx Mar 9, 2026
af168a4
Merge branch 'directly-use-adress-book' into read-and-write
CTH-npitx Mar 9, 2026
f6b1bd2
undo the undo
CTH-npitx Mar 9, 2026
0719035
commented out path
CTH-npitx Mar 9, 2026
9c90319
create file code
CTH-npitx Apr 7, 2026
7dd75c4
Merge branch 'main' into file-code
CTH-npitx Apr 7, 2026
d9a3b74
Update fileCode.cs
CTH-npitx Apr 7, 2026
d9c6358
Update fileCode.cs
CTH-npitx Apr 7, 2026
b829510
Update frm_snackInvent.cs
CTH-npitx Apr 7, 2026
fbb1410
test
CTH-npitx Apr 7, 2026
fa348ef
Merge branch 'main' into file-code
CTH-npitx Apr 8, 2026
90defba
Merge branch 'main' into create-file-code-file
CTH-npitx Apr 8, 2026
2509107
Merge branch 'transfered-file-code-1' into create-file-code-file
CTH-npitx Apr 8, 2026
e521553
Combine the transfered code
CTH-npitx Apr 8, 2026
09c5eab
transfer commented read
CTH-npitx Apr 8, 2026
32181e7
Update fileCode.cs
CTH-npitx Apr 8, 2026
1f59885
Merge branch 'main' into transfered-file-code-1
CTH-npitx Apr 8, 2026
b882f17
Merge branch 'file-code' into transfered-file-code-1
CTH-npitx Apr 8, 2026
4fdddb8
Combine with commented file code, hopefully
CTH-npitx Apr 8, 2026
948f41d
Merge branch 'main' into file-code
CTH-npitx Apr 9, 2026
53b5ba1
Merge branch 'pre-merge' into file-code
CTH-npitx Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/Notes/file manipulation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
for adding from the saved file, the idea is that the "add" function can be modified to output the whole thing/ be used to get all of the entrie.

that way, the order is:

1. open
2. read file
3. split CSV
4. create classes based on CSV
5. add that into the list
6. use this to add it to the contacts
7. done!

___________________________________________________________
save to file just adds a new line with the necessary separation symbol (determined by a constant variable, in this case a "~")

a new system will be added to replace tildes with something else, so the splitting symbol is replaced in the text by something, then that becomes a tilde.

details to be figured out
3 changes: 3 additions & 0 deletions Example-Only Files/Example-Only Files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Contact.cs
store.con
Snack-Shack\bin\Debug\contacts
37 changes: 34 additions & 3 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,38 @@ static void Main()
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frm_snackInvent());
}

internal static List<snackInvent> snacks = new List<snackInvent>();
internal const bool debug = true; //global var to controll default for debugs
internal static List<inventory> inventory = new List<inventory>(); //makes a collection that refferences the class that will store information
}
}
internal static class coreCommands
{
internal static void error(string message, Exception ex = null, bool revealException = false)
{
string msg = message; //what message to display
if (revealException) //put the toggle
{
msg = msg + ": " + ex.Message; //the message
}//a bool to toggle if the exception code should be included in the error message
MessageBox.Show(msg); //show the message
} //this is for error messages. the text is mandatory, but the
//rest isn't necessary. if you don't provide an exception, it won't display one. If you provide an error, it will default to "hide error".
// WARNING: If you provide a boolean, you can controll if it's hidden. If you provide a boolean but no error, well, it won't work righ

/* internal static string path()
{
var pathSpliter = '\\'; //part between paths
var loc = AppDomain.CurrentDomain.BaseDirectory; //get the current domain
var comps = loc.Split('\\'); //array of path after being split
var len = comps.Length; //length of path
var completeLoc = string.Empty; //blank variable for path
for (var i = 0; i < len-3; i++) //repeat by the length minus 2, which will lead to it excluding the 2 folders that are unwanted
{
var comp = comps[i];
completeLoc = completeLoc + comp + char.ToString(pathSpliter); //add next part to path
}
return completeLoc; //output path
} //derive the path of the base file */

} //base commands to aid in everything

}
54 changes: 28 additions & 26 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
Expand All @@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
Expand All @@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
Expand All @@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
Expand All @@ -109,9 +112,13 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="VendingMachine" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Files\presetImages\VendingMachine.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Empty file.
20 changes: 20 additions & 0 deletions bin/Debug/contacts/store.con
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
tests~test~1~test~True~test~1
testing~test2~ 1~test~False~test~2
test~test~ 2~test~True~test~3
tests~testing~~ 11~True~1~4
w~test~ 12 124~test~False~testasae~5
t~e~ 1~s~False~tests~6
hi~test~test~ 1~False~test~7
tests~h~test~ 1~True~test~8
tests ~h~ 1~ 11~True~test~9
1~2~ 4~3~False~5~10
t~e~ 1~ 1~False~tests~11
charlie~hatch~1234567891~test~True~this is a largeer scale test~12
test~test~ 12~large~True~this is a very large scale test and I do mean very as in very, very, very....................................~13
test~test2~ 1~test3~True~t~14
testt~~~~False~~15
t~~~~False~~16
t~~~~False~~17
test~test~ 12~large~True~4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA~18
1~1~1234567890~1~False~info~19
test~test~ 1~test2~True~test~20
23 changes: 23 additions & 0 deletions constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace snackShack
{
internal static class constants //pre-defined constants
{
const char fileSepChar_con = '\\'; //seperater in file paths
internal const int min = 4; //length of entries
internal const char entrySep = ','; //seperation character
internal const string preMadeErrorMsg = "I'm sorry dave, I'm afraid I can't do that"; //pre-made error message
internal const double minPrice = 0.05;
internal static string fileSepString() //give the seperation character as a string
{
return char.ToString(fileSepChar_con);
}
internal static char fileSepChar() //give the seperation character as a char
{
return fileSepChar_con;
}
internal static decimal minimumPrice()
{
return (decimal)minPrice;
}
}
}
92 changes: 92 additions & 0 deletions fileCode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@

using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using System;

namespace snackShack
{
internal static class files
{
#region I/O
internal static void Write(string filepath, char sep)
{
bool status = File.Exists(filepath); //check if the file exists
if (status || Program.debug) //if file exists, or debug is active, run system
{
try
{
using (StreamWriter sw = new StreamWriter(filepath)) //utilize the file path to find the file
{
foreach (var c in Program.inventory) //the loop for createing the contents which will be saved
{
//csv - comma seperated values
//name-imagepath-cost-index
string ind = (c.index + 1).ToString(); //indux to string
string cost = c.cost.ToString(); //cost to string
string line = c.name + sep + c.imagePath + sep + //combine string
cost + sep + ind;
sw.WriteLine(line); //write the information to the line
}
} //streamwriter
}
catch (Exception ex) //find if exception
{
snackShack.coreCommands.error(constants.preMadeErrorMsg, ex, true); //show error
}
}
else //say if no file
{
snackShack.coreCommands.error("File Not Found"); //show error
}
} //the write function

internal static void read(string path, char sep, int min) //the read function
{
bool status = File.Exists(path); //check if the file exists
if (status || Program.debug) //check if there
{
try
{
using (StreamReader sr = new StreamReader(path)) //make stringreader
{
//csv - comma seperated values
//firstname-lastname-email-phone-buisness-notes
while (!sr.EndOfStream) //add each line to it one by one
{
string item = sr.ReadLine(); //gets the next line of text from the file
var entry = item.Split(sep); //splits it by the seperator
if (entry.Length >= min)
{
inventory c = new inventory //make new constact
{
name = entry[0], //put the realevent input into the releavent field
imagePath = entry[1], //same
cost = Convert.ToInt32(entry[2]), //same
index = Convert.ToInt32(entry[3]) -1 //any guesses?
};
Program.inventory.Add(c); //add to list
}
else
{

coreCommands.error("error: below Max Length"); //show error during read
}
}
}
}
catch (Exception ex) //show if exception
{
MessageBox.Show("error" + ex.Message); //show error

}
}
else
{
MessageBox.Show("file not found"); //show error

}
}
#endregion
} //the code for files
}
Loading