Skip to content

akashCF/MachineForm

Repository files navigation

MachineForm - User Registration System

A modern .NET Core 8.0 MVC application with a responsive user registration form and listing page.

Features

  • User Registration Form with comprehensive validation
  • User Listing Page with search and filtering capabilities
  • Dynamic State/City Cascading based on database data
  • Photo Upload with JPG/PNG validation
  • Modern UI using Bootstrap 5.3
  • Responsive Design for all device sizes
  • Database-First Approach with Entity Framework Core

Technology Stack

  • .NET Core 8.0 with MVC Razor Pages
  • Entity Framework Core 8.0
  • SQL Server (LocalDB)
  • Bootstrap 5.3 for modern UI
  • Font Awesome 6.4 for icons
  • jQuery for client-side interactions

Database Setup

  1. Execute the SQL script in Database/CreateDatabase.sql to create the database and tables
  2. The script includes sample data for Countries, States, Cities, and Hobbies

Form Validations

  • Name: Required, max 25 characters
  • Gender: Required (Male/Female radio buttons)
  • Date of Birth: Required, date format
  • Email: Optional, valid email format if provided
  • Contact: Either Mobile or Phone number is required
  • State/City: Required, cascading dropdown from database
  • Photo: Optional, only JPG/PNG files allowed
  • Terms: Required only when all other validations pass

Key Features

Registration Form

  • Real-time client-side validation
  • Dynamic city loading based on state selection
  • Photo upload with preview
  • Conditional terms and conditions validation

User Listing

  • Search by name (case-insensitive, partial match)
  • Filter by gender and state
  • Pagination (10 records per page)
  • Clickable email links in name column
  • Photo thumbnails display

API Endpoints

  • GET /api/Location/countries - Get list of countries
  • GET /api/Location/states/{countryCode} - Get states by country
  • GET /api/Location/cities/{stateCode} - Get cities by state
  • GET /User/GetCitiesByState?stateId={id} - Get cities by state ID (internal)

Running the Application

  1. Ensure SQL Server LocalDB is installed
  2. Execute the database creation script
  3. Run dotnet build to build the project
  4. Run dotnet run to start the application
  5. Navigate to https://localhost:5001 or http://localhost:5000

Project Structure

MachineForm/
├── Controllers/          # MVC Controllers
├── Models/              # Entity Models and DbContext
├── ViewModels/          # View Models for forms
├── Views/               # Razor Views
├── wwwroot/             # Static files (CSS, JS, uploads)
├── Database/            # SQL scripts
└── appsettings.json     # Configuration

Notes

  • Default route redirects to User Registration form
  • Uploaded photos are stored in wwwroot/uploads/
  • Form follows exact specifications from the provided requirements
  • All validations match the specified business rules

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published