This project is a Pharmacy Management System implemented in C#, showcasing basic Object-Oriented Programming (OOP) principles. The system allows administrators to manage medicines and users to purchase medicines through a console-based application.
-
Admin Functionality:
- Add new medicines to the inventory.
- Remove existing medicines.
- View the list of available medicines.
-
User Functionality:
- Search and purchase medicines.
- View purchased medicines and their total cost at checkout.
-
Authentication System:
- Role-based access (Admin/User) with authentication using predefined credentials.
-
Modular Design:
- Encapsulation of logic within classes such as
Medicine,Admin,User, andLogin. - Clear separation of concerns for better code maintainability.
- Encapsulation of logic within classes such as
-
Interactive Console Interface:
- User-friendly menu system for both Admins and Users.
- Dynamic redirection and message display for enhanced user experience.
-
Encapsulation:
- Data and methods are encapsulated in classes like
Medicine,Admin,User, andLogin.
- Data and methods are encapsulated in classes like
-
Inheritance:
- While not directly applied here, the system architecture is designed for extensibility.
-
Modularity:
- Each core functionality is encapsulated within its respective class.
-
Polymorphism:
- The
ToStringmethod in theMedicineclass is overridden for meaningful output formatting.
- The
- .NET Framework installed on your system.
- A C# IDE or text editor like Visual Studio or Visual Studio Code.
- Clone or download the repository.
- Open the project in your preferred IDE.
- Compile and run the
PharmacySystemapplication. - Follow the on-screen instructions to use Admin or User functionalities.
- Admin Credentials:
- Username:
admin - Password:
admin123
- Username:
- User Credentials:
- Username:
user - Password:
user123
- Username:
The project includes basic unit testing for a major method:
- Example: Testing the addition of new medicines in the Admin class.
- Add a unit test project in your IDE.
- Write tests for core methods like
AddMedicine,Authenticate, orPurchaseMedicine. - Execute tests through the test explorer in your IDE.
The project demonstrates proper version control practices with at least three commits:
- Initial: Setting up the project structure and creating basic classes.
- second commit: Implementing core functionalities (Admin/User operations, authentication, etc.).
- last commit: Adding testing, documentation, and code cleanup.
-
Classes:
Medicine: Represents a medicine with ID, name, price, and quantity.Admin: Provides functionalities to manage medicines.User: Allows users to purchase medicines and checkout.Login: Handles authentication.PharmacySystem: Main entry point for the application.
-
Key Methods:
AddMedicine,RemoveMedicine(Admin functionalities).PurchaseMedicine,CheckOut(User functionalities).Authenticate(Login).