Skip to main content

SmartEMP – Employee Management System using ASP.NET Core, ADO.NET & SQL Server (Login Page, Session Implemented, Auto Employee Code Generation, Dropdown, Image Attachment, Validation Implemented).

 

FEATURES IMPLEMENTED IN THE PROJECT 

1️⃣ Employee Registration (Insert)

  • Add a new employee with:

    • First Name, Last Name

    • DOB, Email, Mobile

    • Department, Designation

    • Salary

    • Employee Image Upload

  • Employee Code auto-generated (EMP001, EMP002…)


2️⃣ Employee Update (Edit)

  • Load employee data by ID

  • Display in the form for editing

  • Update stored record via stored procedure


3️⃣ Employee Delete

  • Delete employee record by ID

  • Removed from database using SQL query


4️⃣ Employee Listing / Report

  • Show all employees in a table:

    • Code, Name, Email, Mobile

    • Department, Designation

    • Salary

    • Employee Image

  • Edit / Delete options for each row


5️⃣ Pagination (PagedList)

  • Employee report supports page navigation

  • Displays limited records per page


6️⃣ Employee Image Upload

  • Upload image through <input type="file">

  • Save image to folder /SaveImage/

  • Save path in database

  • Show image in report table


7️⃣ Dropdown Binding

  • Department dropdown

  • Designation dropdown

  • Loaded dynamically from SQL tables


8️⃣ Login System (Authentication)

  • Login page using email & password

  • Validate login from SQL database

  • Store user session values

  • FormsAuthentication cookie added

  • Redirect to Employee page on successful login


9️⃣ Session Management

  • IsSessionnValid() checks:
    ✔ Session ID
    ✔ Session username

  • Without session → redirect to Login


🔟 AJAX Form Submission

  • jQuery AJAX used to save employee data

  • Uses FormData() so file upload works

  • Shows alert after success

  • Reloads page without redirect


1️⃣1️⃣ Basic Front-end Validation

  • jQuery validation for:

    • First Name

    • Last Name

    • Email

    • Mobile No

  • Shows error text dynamically


1️⃣2️⃣ Code Behind SQL Logic (ADO.NET)

  • Custom connection class Connect.cs

  • FillQuery() returns DataTable

  • Executes stored procedure SpEmployeeCrud

  • Uses SqlCommand, SqlConnection, SqlDataAdapter


1️⃣3️⃣ Auto Employee Code Generator

  • Reads max Employee_Id

  • Generates next code in EMP001 format


Coding Section:
Sql Code:

Store Procedure:

CREATE PROCEDURE SpEmployeeCrud
    @Employee_Id      INT = NULL,
    @Employee_Code    NVARCHAR(50),
    @First_Name       NVARCHAR(100),
    @Last_Name        NVARCHAR(100),
    @DOB              DATE,
    @Email            NVARCHAR(150),
    @Mobile_No        NVARCHAR(20),
    @Department_Id    INT,
    @Designation_Id   INT,
    @Salary           DECIMAL(18,2),
    @EmployeeImage    NVARCHAR(255),
    @flag             CHAR(1)
AS
BEGIN
    SET NOCOUNT ON;

    -- Insert
    IF @flag = 'I'
    BEGIN
        INSERT INTO Employee_Info (
            Employee_Code,
            First_Name,
            Last_Name,
            DOB,
            Email,
            Mobile_No,
            Department_Id,
            Designation_Id,
            Salary,
            EmployeeImage
        )
        VALUES (
            @Employee_Code,
            @First_Name,
            @Last_Name,
            @DOB,
            @Email,
            @Mobile_No,
            @Department_Id,
            @Designation_Id,
            @Salary,
            @EmployeeImage
        );
    END

    -- Update
    ELSE IF @flag = 'U'
    BEGIN
        UPDATE Employee_Info
        SET
            Employee_Code  = @Employee_Code,
            First_Name     = @First_Name,
            Last_Name      = @Last_Name,
            DOB            = @DOB,
            Email          = @Email,
            Mobile_No      = @Mobile_No,
            Department_Id  = @Department_Id,
            Designation_Id = @Designation_Id,
            Salary         = @Salary,
            EmployeeImage  = @EmployeeImage
        WHERE Employee_Id = @Employee_Id;
    END
END;

Files Names:


Sql Connection Code:


Model Code:


Controller Code:

Login Controller:


Employee Controller:

View Code:

Employee View:

 

Get Data View:


Get Details View:


Index View Code:


Login Index View Code:



User Interface:





Link: https://tinyurl.com/2mntkwj7







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 ...

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. Ens...

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 ...