
Build a database-driven winforms desktop app to manage repair shop customers and appointments, with add, edit, delete, and filter by customer using a combo box.
Explore building a database-driven desktop app with WinForms, focusing on customer and appointment forms to create, edit, delete records, auto-generated IDs, validation with error providers, and preparing to code.
Connect the project to a database by adding a data source. Create a repair services dataset, bind the grid to the customers table, and prepare table adapters for escrow statements.
Create and customize sql table adapters in the dataset designer to fetch records, add id and phone lookups, and build a joined appointment list from appointments, customers, and repair types.
Create a repair types class in a WinForms C# app, wiring a table adapter and exposing a read-only, sorted data table for dropdowns.
Create a customer class that uses a repair services table adapter, exposes a static last error property, and provides read-only customers data table for updates and deletes using original data.
Compute the next customer id by querying the maximum id in the customers table, starting at 1000 and incrementing by 10, and expose it as a read-only property.
Implement a duplicate phone check in a C# WinForms app using an id and phone, querying the database via an adapter and returning true when another customer owns the number.
Create a public method findById that returns a single customer by passing in the customer id, using the adapter to fetch the row and convert it to a customer.
Wrap the insert in a try-catch, call the adapter's insert method with id, name, and phone, and return true on success or log the error on failure.
Implement an update customer function returning a boolean, pass in customer id, updated name, and phone, retrieve the original data, and call the adapter's update method within a try-catch block.
Create a public delete function that confirms deletion with Windows Forms message box, deletes customer by id via the adapter, and returns true when rows affected are greater than zero.
Create an appointment class with a private readonly appointments table adapter and a static last error, exposing a read-only items table of appointments and a get by customer ID method.
Create a public function to find an appointment by id that returns a single appointment. Use the adapter to fetch all data and filter by the id, then return it.
Combine the date from the date picker with the time entered in a textbox to form a scheduled appointment using a static function that returns DateTime by adding a TimeSpan.
Create a method that returns a boolean to insert an appointment into the database, passing type id, description, license flag, customer id, and scheduled date, with try-catch error handling.
Develop an update method that returns a boolean, finds the original appointment by id, updates fields (description, license, customer id, scheduled) via the adapter, and handles errors.
Implement a public delete method for appointments in a winforms app, with a yes/no message box to confirm deletion by appointment id, mirroring the customer delete flow.
Navigate the main form to open new appointment, all appointments, and customers forms; create and reuse form instances and use dialog results to return to views after adding entries.
Load and populate the customer grid view, then edit or delete a selected customer by opening a modify form with the customer id, and refresh the grid view after changes.
Learn to implement a delete customer workflow in a C# WinForms and SQL app, validate selection, delete by boolean return, update the grid view, and handle appointment foreign key constraints.
Create a database-driven desktop app workflow for adding customers via a new customer form in WinForms, validating unique phone numbers with an error provider and saving to the database.
Modify the customer form to load the selected customer by id, populate name, phone, and id, validate duplicate phones, update the record, and close with OK or Cancel.
Build a database-driven WinForms appointments form in C# that joins customers and appointments to display data in a grid, with an all button and a customer filter via dropdown.
Bind the customer dropdown on form load to the customer data, show names, use IDs as values, and keep the grid view empty until a customer is selected.
Implement a selected index changed event for the customer combo box to filter appointments grid by selected customer id, converting the value to short and using get by customer id.
Select an appointment row to edit and pass its id to the modify form; if none is selected, prompt to choose an appointment to edit and update the grid view.
Implement a delayed delete event on the appointments form by selecting an appointment, retrieving its ID, and calling the delete method. If deletion succeeds, update grid view to remove it.
Populate the repair type and customer dropdowns on form load. Instantiate appointment, repair type, and customer in the constructor and bind display to description with value to id.
Save a new appointment by combining the date picker value with the time input, validating the time, and inserting the record with type, customer, and license status.
Modify the appointment form by reusing components from the new appointment form to perform an update using appointment id, type id, and customer id in a WinForms and C# app.
Populate and bind the repair type and customer combo boxes for the modify appointment form, then load the selected appointment by id and fill date, time, license, and description.
Test the appointment workflow by creating, editing, and deleting appointments, and verify the dropdown resets after edits. Learn to preserve database changes and respect foreign key constraints when deleting customers.
Implement a delete flow that checks for customer appointments with a parameterized inner join, preventing deletion and showing a friendly message when the customer has appointments.
Fix a combo box bug in a C# WinForms app by ensuring the appointments view filters to the selected customer and clears the dropdown when appropriate after edits or deletions.
Finish the course to gain a solid foundation in C# with WinForms and SQL, and build a mid-sized Windows Forms desktop app with CRUD and data passing between forms.
So what is the course all about? It’s about showing you how to set up mid-size project with Create, Read, Update and Delete functionality, C#, Windows Forms, and SQL. I don’t go over any theory, so it is advised you have a at least few months of experience with C# and Windows Forms.
The project itself is perfect for showing how to work with multiple forms, set up C# classes, connect to the database, code basic SQL statements, pass data between forms and form objects, work with Windows Form events, and perform CRUD operations. We won’t be working with in-memory data and each operation will be performed directly against the database.
Of course, this is not a full production ready project. However, it demonstrates how to build a mid-size Windows Forms application, and prepares you towards more advanced concepts. The goal is to show you step by step how each piece of application is coded, so that you can easily follow. This is a perfect course for people who prefer hands on programming, and who like to code everything in a single project, rather than lots of small examples. You can easily finish the project in one weekend, but don’t let that fool you - there is a lot packed into it, and once you understand the code and principles used in this project, you can definitely consider yourself an intermediate programmer. Not bad for 3 hours of your time, right?
So, I’ll see you in the course. Let’s code.