Project Key Points
-
Developed a complete Employee Management System using ASP.NET MVC (Framework) and ADO.NET.
-
Implemented CRUD operations (Create, Read, Update, Delete) with SQL Server.
-
Added auto-generated Employee Code (EMP001, EMP002…) using MAX(YewID) logic.
-
Used Stored Procedure (YTSPCRUD) for Insert/Update with flag-based operations.
-
Applied Data Annotation validations for Email, Mobile, Salary, etc.
-
Implemented custom validation based on Designation (Peon/Manager salary range).
-
Integrated Remote Email Validation using AJAX to check duplicates without page reload.
-
Built a responsive UI using Bootstrap 5 with user-friendly form and report table.
-
Created Report View showing employee data with Edit/Delete actions.
-
Added Delete confirmation using JavaScript popup.
-
Designed separate Connection class for centralized ADO.NET database connectivity.
-
Used SqlConnection, SqlCommand, SqlDataAdapter for database operations.
-
Ensured safe parameterized queries to prevent SQL Injection.
-
Maintained a clean MVC architecture with Controller, Model, View separation.
Coding Section:
Sql Code:
CREATE PROCEDURE YTSPCRUD
@YewID INT,
@EMPID NVARCHAR(MAX),
@LastName NVARCHAR(MAX),
@FirstName NVARCHAR(MAX),
@DOB NVARCHAR(MAX),
@Email NVARCHAR(MAX),
@Mobile NVARCHAR(MAX),
@Department NVARCHAR(MAX),
@Designation NVARCHAR(MAX),
@Salary DECIMAL(10,2),
@flag NVARCHAR(1)
AS
BEGIN
-- Insert
IF (@flag = 'I')
BEGIN
INSERT INTO Yew_Technology
(
EMPID, LastName, FirstName, DOB, Email,
Mobile, Department, Designation, Salary
)
VALUES
(
@EMPID, @LastName, @FirstName, @DOB, @Email,
@Mobile, @Department, @Designation, @Salary
);
END
-- Update
IF (@flag = 'U')
BEGIN
UPDATE Yew_Technology
SET
EMPID = @EMPID,
LastName = @LastName,
FirstName = @FirstName,
DOB = @DOB,
Email = @Email,
Mobile = @Mobile,
Department = @Department,
Designation = @Designation,
Salary = @Salary
WHERE YewID = @YewID;
END
END;
GO
Sql Connection Code:
(YT_Employee_Model):
Controller Code:
Action Method (Create the views):
Post Method to Save Data and Update the Data in Database:
GetBy Method for Getting Data for Update:
Automatic Employee Code Generation Method:
Report View Method (For Showing the data in Report Format in View):
Delete Method for Deleting the Record from the Database:

Email Id Validate Method to Check this email id already exist in database:
View Code
Employee Registration View Code:
Report View Code:
Index View Code:
RenderBody Added in Common Layout(_layout.cshtml):
User Interface:
LINK: https://tinyurl.com/mu36prx2
Comments
Post a Comment