Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 1.14 KB

README.md

File metadata and controls

3 lines (2 loc) · 1.14 KB

This project keeps track of donated computer parts in C#. It includes a GUI, and utilizes Object Oriented Programming Principles.

There are 7 classes in this program. The base class, Parts, has private fields for general part information (vendor, price, make, model, comments), an overloaded constructor, and a virtual get data method that returns a string of data separated by commas. All other classes (CPU, GPU, RAM, Motherboard, Cables, Other) inherit from this base class. These derived classes use the overloaded base class constructor and override the get data method from the base class. For the form, once the user presses ‘submit’ the program determines which part they are submitting via a combo box, and creates an object of the specified class. Exception handling determines if the user’s input is valid. It then calls the get data method from said class and writes it to a CSV file. In form 2, a stream reader object is used to read from the CSV file. Each line of the file is read until a null value is reached, and each line is split at the comma and created into an array. Lastly, this array is appended as a row on the data grid view in form 2.