Skip to content

Repository files navigation

Advisor Appointment Scheduler

A database-driven advising and appointment scheduling application built with C# Windows Forms and Microsoft SQL Server.

The application provides a graphical front end for students/advisees to log in, view advisor availability, schedule appointments, and manage existing appointments. The SQL Server database serves as the backend and uses stored procedures to handle application operations and database interactions.

This project was completed as a team final project for B321: Database Driven Application Development. The project was designed to demonstrate how a relational database can be integrated with a C# application to create a complete, database-driven software system.


🎯 Project Overview

The goal of this project was to create a cohesive application consisting of two primary components:

  1. A SQL Server backend responsible for storing and processing application data.
  2. A C# Windows Forms frontend responsible for providing users with an interface for interacting with the database.

The application models a hypothetical university advising system where students can log in and schedule appointments with academic advisors.

The database contains information about:

  • Advisees
  • Advisors
  • Appointments
  • Appointment types
  • Meeting modalities
  • Buildings
  • Locations
  • Appointment time slots

The frontend communicates with the SQL Server database through stored procedures, allowing user actions in the application to result in database operations.


✨ Features

πŸ” User Login

The application provides an advisee login interface.

Users enter their username and password, which are passed from the C# frontend to a SQL Server stored procedure.

The database validates the credentials and returns the user's information to the application.

The application then stores the authenticated user's information in a session object for use throughout the application.


πŸ“… Appointment Scheduling

Users can create new advising appointments through the Windows Forms interface.

When creating an appointment, the application collects information such as:

  • Advisor
  • Location
  • Modality
  • Appointment type
  • Date
  • Start time
  • Duration
  • Advisee

The selected information is then passed to the SQL Server backend through the CreateScheduledAppointment stored procedure.


πŸ”„ Appointment Rescheduling

Existing appointments can be rescheduled by providing a new date and start time.

The SQL backend processes the change through the RescheduleAppointment stored procedure.


❌ Appointment Cancellation

Appointments can be canceled through the application.

The CancelAppointment stored procedure verifies that the appointment exists before removing it from the database.


⏰ Availability Checking

The application can retrieve existing appointment information and use it to determine advisor availability.

The database provides a GetAvailability stored procedure that returns scheduled appointments and their associated timing information.

This allows the frontend to use database information when determining available appointment times.


⚠️ Appointment Conflict Detection

The application includes logic for detecting overlapping appointments before creating a new appointment.

Before an appointment is created, the C# application calls the database's overlap-checking procedure and passes information about the proposed appointment, including:

  • Location
  • Modality
  • Advisor
  • Advisee
  • Appointment type
  • Date
  • Start time
  • Duration

This helps prevent conflicting appointments from being scheduled.


πŸ—οΈ System Architecture

The project uses a basic client/database architecture.

C# Windows Forms Application
            |
            v
    Database Connection
            |
            v
    SQL Server Backend
            |
            v
    Stored Procedures
            |
            v
      Relational Tables

The frontend is responsible primarily for:

  • User interaction
  • Collecting input
  • Displaying information
  • Calling stored procedures
  • Handling application state
  • Presenting database results

The backend is responsible primarily for:

  • Data storage
  • Relational integrity
  • Database operations
  • Appointment management
  • Login processing
  • Availability queries
  • Conflict detection

This separation demonstrates how a database can act as the backend of a desktop application.


πŸ—„οΈ Database Design

The SQL Server database was designed around the relationships involved in an academic advising system.

Advisees

Stores information about students/advisees, including:

  • Advisee ID
  • Username
  • Password
  • First name
  • Last name
  • Phone
  • Email
  • Address

Each advisee receives a unique identifier.

Advisors

Stores information about academic advisors, including:

  • Advisor ID
  • Username
  • Password
  • First name
  • Last name
  • Phone
  • Email
  • Default location

Scheduled Appointments

Stores appointment records and connects advisees with advisors.

Appointment information includes:

  • Appointment ID
  • Location
  • Modality
  • Advisor
  • Advisee
  • Appointment type
  • Appointment date
  • Start time
  • Duration
  • Description

Appointment Types

Stores the different types of appointments that can be scheduled.

Modality

Stores information about how an appointment is conducted, such as the meeting type or modality.

Buildings

Stores building and address information.

Locations

Stores specific appointment locations and associates those locations with buildings.

Appointment Time Slots

Provides information related to available scheduling periods.


πŸ”— Database Relationships

The database uses primary keys and foreign keys to establish relationships between entities.

For example:

Buildings
    |
    +---- Locations

Advisors
    |
    +---- ScheduledAppointments

Advisees
    |
    +---- ScheduledAppointments

AppointmentType
    |
    +---- ScheduledAppointments

Modality
    |
    +---- ScheduledAppointments

Locations
    |
    +---- ScheduledAppointments

This relational structure prevents appointment information from having to repeatedly store the same advisor, location, or appointment-type information.

Instead, records reference the appropriate entities through foreign keys.


🧠 Stored Procedures

A major part of the project was moving database operations into SQL Server stored procedures.

The stored procedure script is contained in:

B321_StoredProceduresScript.sql

The project includes procedures for several application operations.

LoginAdvisee

Authenticates an advisee using their username and password and returns their identifying information.

CreateScheduledAppointment

Creates a new appointment using the information supplied by the frontend.

CancelAppointment

Verifies that an appointment exists and removes it from the database.

RescheduleAppointment

Updates the date and start time of an existing appointment.

GetAdvisees

Retrieves advisee records for use by the frontend.

GetAdvisors

Retrieves advisor information.

GetModalities

Retrieves available appointment modalities.

GetApptTypes

Retrieves available appointment types.

GetLocations

Retrieves location information and joins it with building information.

GetAvailability

Retrieves existing appointments that can be used by the frontend when determining availability.

GetUserAppointments

Retrieves appointments associated with the current user.

CheckForOverlappingAppointments

Checks whether a proposed appointment conflicts with existing appointments.

CheckForOverlappingAppointmentsReschedule

Provides overlap checking specifically for appointment rescheduling.


πŸ›‘οΈ Database Security Approach

The project was designed so that the frontend interacts with the database primarily through stored procedures.

Instead of placing all database operations directly into the C# application, SQL operations are encapsulated within the SQL Server backend.

This provides several advantages:

  • Centralizes database logic
  • Reduces duplicated SQL code
  • Provides a defined interface between frontend and backend
  • Makes database operations easier to maintain
  • Allows database-side validation and processing
  • Provides a foundation for improving database security

The original project documentation specifically identified database encapsulation through stored procedures as a security goal.


πŸ’» C# Application

The frontend is implemented as a Windows Forms application using C#.

The project uses the Microsoft.Data.SqlClient library to establish connections to SQL Server and execute stored procedures.

The application contains several classes responsible for different parts of the system.

Examples include:

  • clsAdvisee
  • clsAdvisors
  • clsAppointmentType
  • clsDBUtil
  • clsLocation
  • clsModality
  • clsNewAppointment
  • clsScheduledAppointments
  • clsSessionInfo

The application also contains Windows Forms for different user interactions, including:

  • Login
  • Appointment scheduling
  • Appointment rescheduling
  • Schedule overview

πŸ”„ Frontend-to-Backend Workflow

A typical appointment-creation workflow looks like this:

User selects appointment information
                |
                v
      C# Windows Forms
                |
                v
   Validate user selections
                |
                v
   Check for appointment conflicts
                |
                v
    SQL Server stored procedure
                |
                v
   Create appointment record
                |
                v
      Database confirmation

This approach demonstrates how a desktop application can use a relational database as its backend while keeping application logic and database logic separated.


🧩 Object-Oriented Design

The C# portion of the project uses classes to represent different entities and responsibilities.

For example:

  • clsAdvisee represents advisee-related information.
  • clsAdvisors represents advisor information.
  • clsLocation represents appointment locations.
  • clsModality represents appointment modalities.
  • clsAppointmentType represents appointment types.
  • clsNewAppointment represents appointment information being created.
  • clsScheduledAppointments represents scheduled appointment information.
  • clsSessionInfo maintains information about the currently logged-in user.
  • clsDBUtil provides database connection functionality.

This object-oriented structure allowed the application to work with meaningful objects rather than keeping all application state in a single form.


🧠 What I Learned

This project was particularly valuable because it required multiple technologies to work together rather than simply writing isolated SQL or C# programs.

Database-Driven Application Development

The biggest lesson was learning how a database becomes part of a larger software system.

The database was not simply a collection of tables and queries. It served as the backend for an actual application.

This required understanding how:

User Interface
      ↓
Application Logic
      ↓
Database Operations
      ↓
Stored Procedures
      ↓
Relational Data

work together.

Connecting C# to SQL Server

I gained practical experience connecting a C# application to SQL Server using Microsoft.Data.SqlClient.

The application creates database connections, passes parameters to stored procedures, executes commands, and processes returned data.

Stored Procedures

This project gave me significant experience designing and using SQL Server stored procedures.

I learned how stored procedures can provide a structured interface between an application and a database.

Relational Database Design

The project reinforced concepts such as:

  • Primary keys
  • Foreign keys
  • Entity relationships
  • Normalization
  • Referential integrity
  • Data modeling
  • Relational queries

Application State

The project also introduced the challenge of maintaining state between different Windows Forms.

The clsSessionInfo class was used to maintain information about the currently logged-in user so that appointment operations could be associated with the correct advisee.

Error Handling

The application includes exception handling around database operations so that SQL errors can be caught and presented to the user instead of causing the application to terminate unexpectedly.


πŸ› οΈ Technologies Used

Frontend

  • C#
  • Windows Forms
  • Visual Studio

Backend

  • SQL Server Management Studio (SSMS)
  • T-SQL
  • Stored Procedures

Development

  • Git
  • GitHub

πŸ“‹ Prerequisites

To run the project locally, you will need:

  • Windows
  • Visual Studio
  • SQL Server
  • SQL Server Management Studio (SSMS)
  • Git

The repository's existing documentation identifies both SQL Server Management Studio and Visual Studio as required development tools.


πŸš€ Installation & Setup

1. Clone the Repository

git clone https://github.com/IBickCoding/B321_SQL_CSharp_Project.git

cd B321_SQL_CSharp_Project

2. Set Up SQL Server

Install Microsoft SQL Server and SQL Server Management Studio.

Open:

B321_Group1_FinalCreateLoadScript.sql

in SQL Server Management Studio.

Execute the script to create and populate the database.

The script creates the application's relational tables and inserts mock data for the hypothetical university advising system.

3. Create the Stored Procedures

Open:

B321_StoredProceduresScript.sql

in SQL Server Management Studio.

Execute the script after the database has been created.

This creates the stored procedures required by the C# application.

4. Open the C# Application

Open:

AppointmentSchedulerApp/AppointmentSchedulerApp.sln

in Visual Studio.

5. Configure the Database Connection

The application requires a valid SQL Server connection string.

Update the application's database configuration so that it points to your local SQL Server instance and the database created by the SQL scripts.

Do not commit credentials or sensitive connection information to GitHub.

6. Build and Run

Build the solution in Visual Studio.

Run the application.

The application should launch with the login interface.


πŸ“ Repository Structure

B321_SQL_CSharp_Project/
|
+-- AppointmentSchedulerApp/
|   |
|   +-- AppointmentSchedulerApp.sln
|   +-- AppointmentSchedulerApp.csproj
|   |
|   +-- Program.cs
|   |
|   +-- LoginForm.cs
|   +-- LoginForm.Designer.cs
|   +-- LoginForm.resx
|   |
|   +-- AppSchedular.cs
|   +-- AppSchedular.Designer.cs
|   +-- AppSchedular.resx
|   |
|   +-- frmReschduleForm.cs
|   +-- frmReschduleForm.Designer.cs
|   +-- frmReschduleForm.resx
|   |
|   +-- frmScheduleOverview.cs
|   +-- frmScheduleOverview.Designer.cs
|   +-- frmScheduleOverview.resx
|   |
|   +-- clsAdvisee.cs
|   +-- clsAdvisors.cs
|   +-- clsAppointmentType.cs
|   +-- clsDBUtil.cs
|   +-- clsLocation.cs
|   +-- clsModality.cs
|   +-- clsNewAppointment.cs
|   +-- clsScheduledAppointments.cs
|   +-- clsSessionInfo.cs
|
+-- B321_Group1_FinalCreateLoadScript.sql
|
+-- B321_StoredProceduresScript.sql
|
+-- B321_Group1_FinalERD.png
|
+-- B321_Group1_FinalAssumptions.docx
|
+-- B321_Group1_FinalContributions.docx
|
+-- B321_Group1_FinalTimeline.docx
|
+-- README.md

πŸ“ Entity Relationship Diagram

The project includes an Entity Relationship Diagram:

B321_Group1_FinalERD.png

The ERD documents the relationships between the major database entities used by the application.

The database design includes relationships between:

  • Advisees
  • Advisors
  • Scheduled appointments
  • Appointment types
  • Modalities
  • Buildings
  • Locations

πŸ“Š Mock Data

The project uses a hypothetical university dataset populated with mock data.

This allowed the team to create meaningful relationships between:

  • Students
  • Advisors
  • Locations
  • Appointment types
  • Appointment modalities
  • Scheduled appointments

The purpose of the mock dataset was to provide enough realistic relationships for the Windows Forms application to demonstrate real database operations.


πŸ‘₯ Team

This was a team project completed for B321: Database Driven Application Development.

Team Members

  • Ian Bickford
  • Shaun Poole
  • Roddey Sims

The SQL creation script identifies these three developers as the project programmers.


πŸ“š Academic Context

Course: B321 β€” Database Driven Application Development

Project Type: Final Project

Development: Team

Frontend: C# Windows Forms

Backend: Microsoft SQL Server

Database Access: Stored Procedures / Microsoft.Data.SqlClient

IDE: Visual Studio

The assignment required the team to create a database backend and connect it to a C# Windows Forms frontend to create a cohesive database-driven application.

About

Final Project for B321

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages