Skip to main content

Employee Management System with CRUD, Validations & Auto-Code Generation (ASP.NET MVC + ADO.NET)

 

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:

Store Procedure: 

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:

Model Code:

(YT_Employee_Model):



Report_View_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

Popular posts from this blog

Entity_Framework Project (Employee registration, dynamic post dropdown, stored-procedure-based reporting, search, Radio Button and pagination, edit/update, and delete functionality)

Project Summary Project is an Employee Management System built using ASP.NET MVC with the following features: 1️⃣ Employee Registration Add and update employee details Auto-generate employee codes (EMP001, EMP002…) Validations applied for all fields Stores post, DOB, DOJ, and contact details 2️⃣ Post Dropdown Retrieves post data from the EFT_PostMaster table Used in both Add and Edit forms 3️⃣ Employee Report (List Page) Displays employee data using Stored Procedure (SpEmployee) Shows PostName from joined table Supports search and pagination (10 records per page) Edit and delete options available 4️⃣ Pagination Dynamic page navigation Calculates current and total pages 5️⃣ Delete Functionality Deletes employee by ID using Entity Framework 6️⃣ Partial View for Editing Loads employee data for edit in same view 7️⃣ Stored Procedure Integration Data is fetched using SpEmployee() SP returns employee + post information  Coding Section: Sql Code: Store Procedure for Report View: Solution ...

Entity Framework Project (Employee & Shop Supply Management System: Manage employees, departments, designations, shop supplies, birds, stock, transporters, with CRUD operations, dynamic dropdowns, reports, validations, and responsive UI using ASP.NET MVC, Entity Framework, Bootstrap, and Ajax.)

Project: Employee & Shop Supply Management System Key Features: Manage Employee Information : Add, edit, delete, and view employee details. Manage Departments & Designations with dropdown selections. Track Shop Supply : Sales, challan, bird types, quantity, weight, rate, and total amount. Manage Transporters & Vehicles with dynamic cascading dropdowns. CRUD Operations implemented using ASP.NET MVC and Entity Framework . Validations for mandatory fields and proper data entry. Reports : Employee reports and supply details in tabular format. Responsive UI using Bootstrap for easy navigation. Ajax Integration for dynamic dropdowns without page reload. Database tables for Employees, Departments, Designations, Shops, Bird Types, and Transporters. Coding Part: Sql Code: Model Code: Controller Code: For Saving the Information Using Model  For updating and deleting the information use below method using ID Delete Method for Record Deleting from Database  Method for ...