Tech used:
The purpose of this project is to allow for easy organization of componets purchased for the maintenance of machines. I am using this project to help me keep track of the parts I've purchased for my car and how much money I've spent fixing the car.
Clicking the Add Machine on the top nav bar will take the user to a form. Once filled out hitting the submit button, the application will use a database context object to commit the changes to the table of Machines.
Once the transaction is complete, it loads a list of Machines for the user. Each row has a link to allow the user to view details about the respective machine.
The Id for each Machine is the primary key and is autogenerated and not touched by the user, that is why that field is read-only in the Edit Machine form. It is really interesting that transactions to the table are done using C#, as this project deals with relational databases, the queries to the database would start to get a little more lengthy and complex, but with this project, it was just a matter of making sure I had the correct data in the correct models used for a page, then using that model as a parameter for a function within the controller for the object which I was focused on. Clicking the View button in the list of machines will select that particular machine and take the user to the edit machine form. From this page it is possible to edit the data for that machine and submit to commit the changes to the table. The user can also delete the machine from the table and because another table depends on this machine table, the components associated with this machine will also be deleted from the components table. It is also possible to add a component to this machine.
Clicking the Add Component button will take the user to a form for a new Component, it will autofill the Machine Id field and make it read-only, this is a foreign key for this table.
Once the new component is added, the user is taken to a list that shows all the machines and underneath each machine, its components.
The user can then click the View button and be taken to a form for that specific component. Clicking the Submit button will commit the changes to the table of components and clicking delete will delete the component from the table, this will not affect the table of machines.