Simple Lead Management Application in ASP.NET MVC ~ MiTechDev.com

Mitechdev.com is a programming blog which focused on Web Programming and development

Tuesday, 18 April 2017

Simple Lead Management Application in ASP.NET MVC

21:44:00 Posted by raviteja swayampu , 1 comment
Hi every one welcome again with another simple ASP.NET MVC application.
Name: Lead Management
It is a simple lead management application with consists of few functionalities like below.
1.Contains both Admin and User Screens.
2.User can add,edit and delete the Lead data through user screen
3.Contains both Visisted and non visited user grids(This application is mainly developed for real estate lead management Here the visited and non visited screens displays the people's data who visited site and not visited).
3.Admin can See the deleted leads and also can undelete also..
4.Admin can add,delete and give roles to users.
5.Simple and attrative UI for both admin and user screens.
Technologies Used:
ASP.NET MVC,
Entity Framework,
Jquery,
Unity Container for dependency injection,
Sql Server,
Gentellela Admin Theme,
Jquery Data tables for Grids

Screen shots:
loginpage:


Admin Home:


Add User screen:


New Leas screen:


Visited Customers screen:


Add or Edit New Lead screen:
Database Schema and Sample Data:
USE [master]
GO
/****** Object:  Database [LandBDB_Test]    Script Date: 4/19/2017 10:11:31 AM ******/
CREATE DATABASE [LandBDB_Test] ON  PRIMARY 
( NAME = N'LandBDB_Test', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\LandBDB_Test.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'LandBDB_Test_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\LandBDB_Test_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [LandBDB_Test] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [LandBDB_Test].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [LandBDB_Test] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [LandBDB_Test] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [LandBDB_Test] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [LandBDB_Test] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [LandBDB_Test] SET ARITHABORT OFF 
GO
ALTER DATABASE [LandBDB_Test] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [LandBDB_Test] SET AUTO_CREATE_STATISTICS ON 
GO
ALTER DATABASE [LandBDB_Test] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [LandBDB_Test] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [LandBDB_Test] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [LandBDB_Test] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [LandBDB_Test] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [LandBDB_Test] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [LandBDB_Test] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [LandBDB_Test] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [LandBDB_Test] SET  DISABLE_BROKER 
GO
ALTER DATABASE [LandBDB_Test] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [LandBDB_Test] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [LandBDB_Test] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [LandBDB_Test] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [LandBDB_Test] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [LandBDB_Test] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [LandBDB_Test] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [LandBDB_Test] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [LandBDB_Test] SET  MULTI_USER 
GO
ALTER DATABASE [LandBDB_Test] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [LandBDB_Test] SET DB_CHAINING OFF 
GO
USE [LandBDB_Test]
GO
/****** Object:  StoredProcedure [dbo].[sp_DeleteCustomer]    Script Date: 4/19/2017 10:11:32 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:  Raviteja Swayampu
-- Create date: 11/04/2017
-- Description: Deleted record from Customers table and inserts same record in DeletedCustomer table
-- =============================================
CREATE PROCEDURE [dbo].[sp_DeleteCustomer] 
 -- Add the parameters for the stored procedure here
 @CustomerID int
AS
BEGIN
 -- SET NOCOUNT ON added to prevent extra result sets from
 -- interfering with SELECT statements.
 SET NOCOUNT ON;

 IF(@CustomerID>0)
 BEGIN
  INSERT INTO DeletedCustomer(FirstName,LastName,EmailID,IsVisited,Status,LeadSource,PhoneNumber)
  SELECT FirstName,LastName,EmailID,IsVisited,Status,LeadSource,PhoneNumber FROM Customers WHERE [email protected]

  --DElete record from Customers tables
  DELETE FROM Customers WHERE [email protected]
  return 1;
 END
END

GO
/****** Object:  Table [dbo].[Customers]    Script Date: 4/19/2017 10:11:32 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Customers](
 [CustomerID] [int] IDENTITY(1,1) NOT NULL,
 [FirstName] [nvarchar](max) NULL,
 [LastName] [nvarchar](max) NULL,
 [EmailID] [nvarchar](max) NULL,
 [IsVisited] [nvarchar](5) NULL,
 [Status] [nvarchar](max) NULL,
 [LeadSource] [nvarchar](max) NULL,
 [PhoneNumber] [nvarchar](max) NULL,
 [ContactDate] [datetime] NULL,
 [OtherReason] [nvarchar](255) NULL,
 CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED 
(
 [CustomerID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[DeletedCustomers]    Script Date: 4/19/2017 10:11:32 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DeletedCustomers](
 [ID] [int] IDENTITY(1,1) NOT NULL,
 [FirstName] [nvarchar](max) NOT NULL,
 [LastName] [nvarchar](max) NOT NULL,
 [EmailID] [nvarchar](max) NOT NULL,
 [IsVisited] [nvarchar](max) NOT NULL,
 [Status] [nvarchar](max) NOT NULL,
 [LeadSource] [nvarchar](max) NOT NULL,
 [PhoneNumber] [nvarchar](max) NOT NULL,
 [DeletedBy] [nvarchar](max) NULL,
 [OtherReason] [nvarchar](255) NULL,
 CONSTRAINT [PK_DeletedCustomers] PRIMARY KEY CLUSTERED 
(
 [ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[TUsers]    Script Date: 4/19/2017 10:11:32 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TUsers](
 [ID] [int] IDENTITY(1,1) NOT NULL,
 [Name] [nvarchar](max) NULL,
 [UserName] [nvarchar](max) NULL,
 [Password] [nvarchar](max) NULL,
 [Role] [nvarchar](max) NULL,
 [EmailAddress] [nvarchar](max) NULL,
 [PhoneNumber] [nvarchar](max) NULL,
 [Gender] [nvarchar](10) NULL,
 [CreatedDate] [datetime] NULL,
 CONSTRAINT [PK_TUsers] PRIMARY KEY CLUSTERED 
(
 [ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET IDENTITY_INSERT [dbo].[Customers] ON 

GO
INSERT [dbo].[Customers] ([CustomerID], [FirstName], [LastName], [EmailID], [IsVisited], [Status], [LeadSource], [PhoneNumber], [ContactDate], [OtherReason]) VALUES (5, N'Puri', N'Jagannad', N'[email protected]', N'yes', N'rgfj yjtgjyukttyurfghgfhgfh', N'Through Property website', N'8435498544', NULL, NULL)
GO
INSERT [dbo].[Customers] ([CustomerID], [FirstName], [LastName], [EmailID], [IsVisited], [Status], [LeadSource], [PhoneNumber], [ContactDate], [OtherReason]) VALUES (7, N'simha', N'nandi', N'[email protected]', N'yes', N'edgdhjghgfgkgjkhj', N'Through Broucher', N'9043543548', NULL, NULL)
GO
INSERT [dbo].[Customers] ([CustomerID], [FirstName], [LastName], [EmailID], [IsVisited], [Status], [LeadSource], [PhoneNumber], [ContactDate], [OtherReason]) VALUES (9, N'Ashok', N'knodurthi', N'[email protected]', N'yes', N'rfdhgfhfghhg', N'Through Friend', N'4574353487', NULL, NULL)
GO
INSERT [dbo].[Customers] ([CustomerID], [FirstName], [LastName], [EmailID], [IsVisited], [Status], [LeadSource], [PhoneNumber], [ContactDate], [OtherReason]) VALUES (10, N'Venkat', N'krishna', N'[email protected]', N'no', N'fsdfksdjfdssd dsfjksdfdsgs', N'Through Banners', N'4574353487', NULL, NULL)
GO
INSERT [dbo].[Customers] ([CustomerID], [FirstName], [LastName], [EmailID], [IsVisited], [Status], [LeadSource], [PhoneNumber], [ContactDate], [OtherReason]) VALUES (11, N'hgdfdsjfsd', N'jhfsdhfbds', N'[email protected]', N'no', N'fsgdbdbgfnfghfg', N'other', N'4574353487', NULL, N'nsafsdjksdgjkdfgjkf')
GO
INSERT [dbo].[Customers] ([CustomerID], [FirstName], [LastName], [EmailID], [IsVisited], [Status], [LeadSource], [PhoneNumber], [ContactDate], [OtherReason]) VALUES (12, N'Prabas', N'P', N'[email protected]', N'yes', N'jksgfgkjdfngfmn', N'Through Broucher', N'4545565757', NULL, NULL)
GO
SET IDENTITY_INSERT [dbo].[Customers] OFF
GO
SET IDENTITY_INSERT [dbo].[TUsers] ON 

GO
INSERT [dbo].[TUsers] ([ID], [Name], [UserName], [Password], [Role], [EmailAddress], [PhoneNumber], [Gender], [CreatedDate]) VALUES (1, N'Raviteja', N'thebadboy', N'welcome', N'admin', N'[email protected]', N'9052567697', N'male', NULL)
GO
INSERT [dbo].[TUsers] ([ID], [Name], [UserName], [Password], [Role], [EmailAddress], [PhoneNumber], [Gender], [CreatedDate]) VALUES (2, N'Narasimha', N'simha007', N'welcome', N'user', N'[email protected]', N'5839454358', N'male', NULL)
GO
SET IDENTITY_INSERT [dbo].[TUsers] OFF
GO
USE [master]
GO
ALTER DATABASE [LandBDB_Test] SET  READ_WRITE 
GO

Download source code from Github through below link:
Source code: LandBClient

1 comment:

  1. Could you please explain step by step this application, regards

    ReplyDelete