You are on page 1of 253

INTRODUCTION OF THE PROJECT

According to World Bank definition, "E-government refers to the use by


government agencies of information technologies like wide area network, the internet
and mobile computing that have the ability to transform relations with citizens,
businesses and other arms of government”. It contributes to public security. The police
personal would also be able to identify any criminals and this is possible if a database is
available for any citizens including criminals' and innocents' all information. For the
public safety there would be record about the wanted persons, suspected criminals'
history, wanted cars, stolen cars, cases, news and events, contact details,
recommendations and so on.

The objectives of this work are free access of the citizens for their queries and
complaints, establishing database for citizens and police personnel. The normal public
in India are afraid to give an complaint in police station because they are filled with a
false fear about the police department. An online complaint registering system will
solve the fears of public and will also help the police department in catching
criminals. An online solution is very useful as the solution is inherently distributive.

E – Police : Online Crime Reporting System is intended to provide total


computerized information system support for the work of the police. Its primary
activities are not transparency-related, but help provide police officers with
information on criminal cases and on criminals. The person who registered the case
could also get access to case details and progress at any point, either by going to any
police station and requesting an officer to access their case on E-police , or by
accessing their case details online via the application using an FIR code number that
is issued at the time of registration. Available case details would include the FIR,
actions taken, actions pending, other crime details, etc. The victim could lodge a
complaint if they see from accessing case details that the case has not been registered
properly, or that there has been no progress made on the case since it was last
accessed. Finally, senior officers in the police service could also use E-police to
monitor case details and progress. All of this affects the transparency of case
handling, and the accountability of police officers.
OBJECTIVES

The main purpose behind the E-Police System is to improve the effectiveness
of policy performance; to improve the efficiency of police procedures; for example,
by eliminating redundant processes in the registration of criminal cases; and to
improve the quality of management information provided for senior policy decision-
making, particularly through integration of previously separate information systems.

The basic objectives of developing this project are:

 The system at any point of time can provide the details of the police station and
the employees.

 The system at any point of time can provide the details of victims and the
registered FIR’s
 The system at any point of time can provide the details of evidence and their
sequence
 The system at any point of time can provide the details of existing charge sheets
and their statuses.
 Ensure data privacy and security, and system reliability

 Citizens not need to go police station to see the criminals information. they can
directly see information on site .

 Visitor can easily get the information about the crime and criminal.

 Reduce the man power , and also reduce the time.

 Member can view the current status of the criminal.

2
SCOPE OF THE PROJECT

This project will definitely help the police system in making the police work
more efficient through equipping the police with modern solutions i.e. it aims to ensure
solutions and means for the police officers that support their main activity and it will
be interesting for audience in the context of law and order situation in our country. The
main intent of this project is to upgrade the developing countries’ police administration
to the world standard by using modern information and communication technologies.
At last we recommend to developing countries that to take necessary steps for
upgrading the present police system to e-police system by overcoming the issues and
challenges. In future we can add and use new technologies, wireless communication
systems, modern IP networks etc.This project has also provided facilities of RTI act,
link verification and encryption algorithm that will help validate users identity as well
as secure document given by user. An image comparison algorithm is written to help
cops check an existing person online.

3
SYSTEM DEVELOPMENT LIFE CYCLE

The Systems Life Cycle (SLC) is a type of methodology used to describe the
process for building information systems, intended to develop information systems in
a very deliberate, structured and methodical way, reiterating each stage of the life cycle.

Any SDLC should result in a high quality system that meets or exceeds customer
expectations, reaches completion within time and cost estimates, works effectively and
efficiently in the current and planned Information Technology infrastructure, and is
inexpensive to maintain and cost-effective to enhance.The System Development Life
Cycle framework provides a sequence of activities for system designers and developers
to follow. It consists of a set of steps or phases in which each phase of the SDLC uses
the results of the previous one.

SDLC Phases

Phases in SDLC are Planning, Analysis, Design, Implementation, and Maintenance.

 Project planning, feasibility study: Establishes a high-level view of the intended


project and determines its goals.
 Systems analysis, requirements definition: Defines project goals into defined
functions and operation of the intended application. Analyzes end-user
information needs.
 Systems design: Describes desired features and operations in detail, including
screen layouts, business rules, process diagrams, pseudo code and other
documentation.
 Coding: The real code is written here.
 Integration and testing: Brings all the pieces together into a special testing
environment, then checks for errors, bugs and interoperability.

4
 Acceptance, installation, deployment: The final stage of initial development,
where the software is put into production and runs actual business.
 Maintenance: What happens during the rest of the software's life: changes,
correction, additions, moves to a different computing platform and more. This, the
least glamorous and perhaps most important step of all, goes on seemingly forever.

5
REQUIREMENT ANALYSIS

Functional Requirements

 Administrator should be able to create/edit a virtual police station (PS) which


represents a real police station as a first time setup.

 Appointing of police officers to a particular police station which is present in a


specific zone or to a specific district as a first time setup, he should be
transferable at later time.

 Police Station should have areas of control which can be modified at later
time.

 Police station has several departments like Law and Order, Women Protection,
Cybercrime, Traffic and control, CBI, etc. Separate module for each dept
would be needed.

 When a complaint is made it undergoes various processes like FIR, Charge


Sheet, Property Seizure, court disposal etc all these activities are performed by
a PS.

 Traffic and Control has important part where the Traffic inspector would be
filing a charge sheet from a mobile or PDA.

 Maintaining the criminal information state wise/area wise/age wise is


mandatory

 Sharing of case details with Police Station in other states is needed.

 Communication between officers is mandatory through forum, chat, polls.

 The magistrate should be able to access the case details and provide/deny the
arrest warrant
6
 Citizens should be able to apply for various licenses like Arms, loud speaker,
Hotel/lodge, browsing centre, mass meetings etc., and the officer should be
able to approve/reject which will be notified to the applicant via SMS and Mail

 Secured registration of citizens is needed where they need to provide proof of


citizenship, which will be cross checked by the police officer of that area.

 Police officers often export the FIR copy to PDF format.

 Complaints filed in a day and action taken to it. It should also report unattended
complaints.

Non-Functional Requirements

 Secure access of confidential data (user’s details/FIR details). SSL can be used.

 24 X 7 availability.

 Better component design to get better performance at peak time.

 Flexible service based architecture will be highly desirable for future extension

Optional Features

 Video and Audio promos (if provided by the owner).

 Complaint/Suggestion logs received from all kinds of user.

 Integration of E cops with Prison management and Court is an immediate


requirement

7
FEASIBILITY STUDY

Definition Of Feasibility Study:

A Project Feasibility Study is an exercise that involves documenting each of


the potential solutions to a particular business problem or opportunity. Feasibility
Studies can be undertaken by any type of business, project or team and they are a
critical part of the Project Life Cycle.

A Feasibility Study Report is a business plan for a specific project. It provides


the rationale and the support for that rationale to pursue a specific project from the
feasibility phase, pre-construction, construction and occupancy through investment
and technical management.

A feasibility study should provide management with enough information to

decide:

1.Whether the project can be done

2.Whether the final product will benefit its intended users

3. What are the alternatives among which a solution will be chosen (during
subsequent phases)

4.Whether there exists a preferred alternative

When to use a Feasibility Study?

The purpose of a Feasibility Study is to identify the likelihood of one or


more solutions meeting the stated business requirements. In other words, if you are
unsure whether your solution will deliver the outcome you want, then a Project
Feasibility Study will help gain that clarity. During the Feasibility Study, a variety of
'assessment' methods are undertaken. The outcome of the Feasibility Study is a
confirmed solution for implementation.

8
The very first phase in any system developing life cycle is the preliminary
investigation. The feasibility study is the major part of this phase. We studied how
feasible the development of the software is going to be in terms of the following
aspects:

OPERATIONAL FEASIBILITY:

The system will computerize the manual process carried out at present. On the
contrary it will reduce some redundant entities. As the system has a very user friendly
interface there is no for the operators to undergo any separate training. Any person
having minimal know how of computers can operate the system with ease. This will
help the staff by reducing the time consuming and cumbersome jobs. The working with
the new system will be very easy and every bit of current information will be available
on the fingertips at any time.
Because of all these reasons we found the system operationally feasible.

TECHNICAL FEASIBILITY:

Proposed software will require hardware configurations:-

 Intel(R) Core(TM) i3 CPU


 4 GB of RAM.
 Color Monitor.
 Keyboard.
 Mouse.
 Minimum 10 GB of Hard Disk Space.
Also the college, which wishes to install this software, Should have a licensed
copy of Microsoft Visual Studio 2012 . Since we will install the product, the college
should fulfill the above specified software and hardware specifications.

9
ECONOMICAL FEASIBILITY:

Once the required hardware and software specifications are fulfilled, there is
no need for the college to spend for additional overhead.
The system will be economically feasible considering the following aspects:

► The system will save a lot of stationary.

► It will save time, which is otherwise wasted in manual process.

► At the same time the system will require less manual power as compared
to the current system.

► There is no training cost.

► The storage and the handling problem with respect to records and registers
will be solved.

10
HARDWARE AND SOFTWARE SPECIFICATIONS

HARDWARE REQUIREMENTS

 PROCESSOR : Pentium i3/i5 with at least 1.66Ghz

 RAM : 4 GB

 HDD : 40 GB or HIGHER

 OTHERS : MONITOR,KEYBORD,MOUSE

SOFTWARE REQUIREMENTS

 OS : WINDOWS 7/8/10 or 2012 server

 BROWSER : INTERNET EXPLORER OR ANY HTTP


BROWSER

 DATABASE : SQL SERVER 2012


LAYER

 WEB SERVER : IIS WEB SERVER 7

 SERVER SIDE : ASP.NET with C#4.5 (VISUAL STUDIO 2012)


SCRIPTING

 WEB PAGE : HTML5, CSS3, AJAX


DESIGNING

 CLIENT SIDE : JAVA SCRIPT, JQUERY, ANGULAR JS


SCRIPTING

 PROTOCOL : HTTPS,SMTP,MIME

11
PROJECT PLANNING AND SCHEDULING

Scheduling of a project can be correlated to prioritizing various jobs with respect to


their cost, time and duration. Scheduling can be done with resource constraint or time
constraint in mind.

E – Police System

Testing
Requirement Analysis
Maintenance

Problem Coding
Definition System testing

Design Unit
Requirement
Planning
specification
and Integration testing
scheduling
Data Design Modular
S/w and h/w design
requirement

12
GANTT CHART

PHASE TIME REQUIRED(IN WEEKS)

WK WK WK WK WK WK
1 2 4 5 8 9

REQUIREMEN
T
GATHERING

REQUIREMEN
T ANALYSIS

DESIGN

CODING

TESTING

IMPLEMENTA
-TION

13
PERT CHART

Req.Gathering Analysis Design

01 Aug- 13 Aug 15 Aug- 27 Aug 29 Aug - 10 Sep


Wk1 & 2 Wk 3& 4 Wk 5 & 6

Coding

12 Sep- 28 Sep
Wk 6 ,7 & 8

Testing

29 Sep – 06 Oct
Wk9 + 4 days

Implementation

07 Oct – 11 Oct

14
DATA FLOW DIAGRAM

A Data Flow Diagram (DFD) is a graphical technique that depicts information


flow and the transforms that are applied as data move from input to output.On a DFD,
data items flow from an external data source or an internal data store to an internal data
store or an external data sink, via an internal process.A DFD provides no information
about the timing of processes, or about whether processes will operate in sequence or
in parallel.

CONTEXT LEVEL DFD

15
(For User)

(For Police Station)

16
(For Higher Authority)

17
LEVEL -1 DFD

(For User)

18
(For Police Dept)

19
(For Higher Authority)

20
ENTITY RELATIONSHIP DIAGRAM

21
22
INPUT MODULES

There are total three main parts included in user system first is user then
constable ant last is higher authority. Let us see brief about each starting with
user.

A. USER
The user first have to do registration on site, this include email verification. After
doing registration it’s email verification is automatically done by the system and
after verifying it’s email it provide ID and password to user with the help of this
the user will permit to enter in the system, that means after entering correct id
and password the user will allow to login in the system.

B.CONSTABLE

Constable first have to login in the system, then there are three sections on which
constable have to work these are data entry then search engine is there and status
update. In data entry section the constable enter any newly added data in the
system. Search engine is to search any information about user in the system, with
the help of search engine the constable searches any information about FIR then
with the help of status update the constable will permit to update the status of
recent case in the system.

C. HIGHER AUTHORITY

The last part of the system is higher authority area in this the higher authority
first have to login in the system. The higher authority first check out the fir
submitted by the user is there any fake information present in it or not. It would
check the importance of FIR and an assigned to level of authority according to
their importance. Then the image base verification is performed by higher
23
authority and he will also give the progress report on the fir on which the police
working is properly done or not is there delay in the work etc in short the higher
authority will give the feedback on the fir i.e. he will give progress report on the
FIR on which police work.

Description of Modules

 Police stations registration module: This module maintains the information


about all the police stations that are registered as per the jurisdiction of the
system. It also gets integrated with the employees who are working in these
stations along with their designation.

 Victims FIR registration module: This module maintains the information


related to the first investigation report of the crime sequences that have taken
place. The Fir registers all that a data that is necessary for the investigation to
take place in proper length. It identifies the crime category and the crime nature.

 Investigating evidence registration module: This module makes a collection


of information related to all the evidences that become categorically important
under the normal sequence of the investigation, this module dynamically
concentrates upon the changes that take place while the system of investigation
is under process.

 Department Module:Department module has the following categories


o Law and Order
o Traffic and control
o Cyber Crime
o Women Protection
o CBI
The above categories satisfy the following activities

24
 Maintain departments wise employees
 Maintain department wise cases
 Maintain department wise criminals according to area wise/district
wise/state wise/age wise also.
 Maintain department wise FIR, Charge Sheet information.
 Maintain department wise most wanted criminal information.
 Maintain department wise employee transfers and promotions

 Reports Module : This system gives the following reports


o Complaints filed in a day and action taken to it. It should also report
unattended complaints

o Crime rate due to various types of crimes in a month/year and also in


district/state wise.

o Report regarding most wanted criminals and bounty information if


available.

o Police officers often export the FIR copy to document format

25
UML DIAGRAMS

ACTIVITY DIAGRAMS:

An activity diagram is a special kind of a state chart diagram that shows the
flow from activity to activity within a system. Here we are having four forms they
areComplaints, User, Administrator, Police.

1 .COMPLAINTS

COMPLAINTS

CID LOC CRIME DESCRIPTION

SUBMIT

26
2. USER

USER

LOGIN

SEND COMPLAINTS

GETS COMPLAINT ID

VIEW STATUS & MESSAGES

3. POLICE

POLICE

LOGIN

VIEW COMPLAINT

VIEW CAUTION SEND STATUS

27
4. ADMINSTARTOR

ADMIN

LOGIN

ALERT CAUTION

SEND ALERT SELECT LOC

SELECT COMPLALINT

ENTER CAUTION AND STATUS

28
Sequence Diagram: A sequence diagram represents the interaction between different
objects in the system. The important aspect of a sequence diagram is that it is time-
ordered. Different objects in the sequence diagram interact with each other.

Admin Police User

login
Registration,login

login

lodge Complaint

View Complaint

View Complaint

Send Status

notify notify

View Status

View Status

29
Use Case Diagram: The use case diagram is used to identify the primary elements
and processes that form the system. The primary elements are termed as "actors" and
the processes are called "use cases." The use case diagram shows which actors interact
with each use case.

Login

Registration

Lodge Complaint Admin

View User Complaint

View Complaint Status


User

Send Status
Police Personell

Send Reports

View Report

Logout

30
Collaboration Diagram:A collaboration diagram groups together the interactions
between different objects. The interactions are listed as numbered interactions that help
to trace the sequence of the interactions. The collaboration diagram helps to identify all
the possible interactions that each object has with other objects.

1: login
7: View Complaint
12: View Status

Admin

3: login
5: 6: View Complaint
2: Registration,login 8: Send Status
11: View Status
9: notify

4: lodge Complaint
Police
User

10: notify

31
DATABASE STRUCTURE

The database approach used in this system is relational database model. Data
specification that needed to form the logical database model has been identified during
input and output of system modules determination. Data elements at input and output
have been analyzed and the relationship among data also has been identified.

1. AdminLogin Table

2. Contact Table

32
3. CyberCrime Table

4. Feedback Table

33
5. GeneralComplaint Table

6. MissingMaster Table

34
7. MissingDetail Table

8. MissingPerson Table

35
9. MostWanted Table

10. UserRegistration Table

36
11. News Table

12. PoliceStation Table

37
(i) Home Page

38
(ii) Search Page

(iii) UserLogin Page

39
(iv) AboutUs Page

40
(v) User registration Page

41
Coding
Database.sql

CREATE TABLE [dbo].[Contact] (

[Id] INT NOT NULL,

[Name_of_distt] VARCHAR (100) NULL,

[Off_Rank] VARCHAR (20) NULL,

[telephone_no] VARCHAR (20) NULL,

[camp_off_phn_no] VARCHAR (30) NULL,

[mobile] VARCHAR (15) NULL,

[emailid] VARCHAR (100) NULL,

PRIMARY KEY CLUSTERED ([Id] ASC)

);

CREATE TABLE [dbo].[Feedback]

[Id] INT NOT NULL PRIMARY KEY,

[Name] VARCHAR(100) NOT NULL,

[EmailAddress] VARCHAR(100) NOT NULL,

[ContactNo] VARCHAR(20) NOT NULL,

[Comment] VARCHAR(MAX) NOT NULL,

[FeedbackDate] DATE NOT NULL

);

CREATE TABLE [dbo].[UserRegistration] (

[RegId] INT NOT NULL,

[EmailId] VARCHAR (100) NOT NULL,

[UserName] VARCHAR (100) NOT NULL,

42
[UserPassword] VARCHAR (100) NOT NULL,

[Gender] VARCHAR (10) NOT NULL,

[Address] VARCHAR (100) NOT NULL,

[District] VARCHAR (50) NOT NULL,

[Pincode] NUMERIC (6) NOT NULL,

[ContactNo] VARCHAR (15) NOT NULL,

[Qualification] VARCHAR (50) NOT NULL,

[AADHARNo] VARCHAR (12) NULL,

[IDProof] VARCHAR (50) NOT NULL,

[DocumentNo] VARCHAR (50) NOT NULL,

[PoliceStationId] VARCHAR (50) NOT NULL,

[LoginStatus] VARCHAR(50) NULL,

CONSTRAINT [PK_Table] PRIMARY KEY CLUSTERED ([EmailId] ASC)

);

CREATE TABLE [dbo].[PoliceStation] (

[PoliceStationId] VARCHAR (50) NOT NULL,

[Password] VARCHAR (50) NOT NULL,

[PoliceStationName] VARCHAR (50) NOT NULL,

[PoliceStationArea] VARCHAR (50) NOT NULL,

[District] VARCHAR (50) NOT NULL,

[ChowkiInchargeName] VARCHAR (50) NOT NULL,

[Address] VARCHAR (100) NOT NULL,

[ContactNo] VARCHAR (50) NOT NULL,

[EmailId] VARCHAR (100) NOT NULL

43
);

CREATE TABLE [dbo].[GeneralComplaint] (

[ComplaintId] NUMERIC (18) NOT NULL,

[ComplaintMatter] VARCHAR(50) NOT NULL,

[AreaOfOffence] VARCHAR(100) NOT NULL,

[Message] VARCHAR (MAX) NOT NULL,

[Date] DATE NOT NULL,

[EmailId] VARCHAR (100) NOT NULL,

[RegId] INT NOT NULL,

[History] VARCHAR (MAX) NOT NULL,

[Status] VARCHAR (500) NOT NULL,

[Attachment] VARCHAR(500) NOT NULL,

[PoliceStationId] VARCHAR (50) NOT NULL,

PRIMARY KEY CLUSTERED ([ComplaintId] ASC)

);

CREATE TABLE [dbo].[MissingMaster] (

[Id] INT NOT NULL,

[Date] INT NOT NULL,

[Month] INT NOT NULL,

[Year] INT NOT NULL,

[Name] VARCHAR (50) NOT NULL,

[Hour] INT NOT NULL,

[Minute] INT NOT NULL,

[Type] VARCHAR (50) NOT NULL,

[Address] VARCHAR (100) NOT NULL,

44
[Area] VARCHAR (50) NOT NULL,

[EmailId] VARCHAR (50) NOT NULL,

[Status] VARCHAR (MAX) NOT NULL,

[DateOfComplaint] DATE NOT NULL,

[PoliceStationId] VARCHAR(50) NOT NULL,

PRIMARY KEY CLUSTERED ([Id] ASC)

);

CREATE TABLE [dbo].[MissingDetails] (

[Id] INT NOT NULL,

[Things] VARCHAR (50) NOT NULL,

[Cost] INT NOT NULL

);

CREATE TABLE [dbo].[CyberCrime] (

[Cyber_id] INT NOT NULL,

[Date] DATE NOT NULL,

[ObserveDate] VARCHAR (50) NOT NULL,

[ObserveTime] VARCHAR (50) NOT NULL,

[WebUrl] VARCHAR (500) NOT NULL,

[Info] VARCHAR (MAX) NOT NULL,

[EmailId] VARCHAR (50) NOT NULL,

PRIMARY KEY CLUSTERED ([Cyber_id] ASC)

);

45
CREATE TABLE [dbo].[MissingPerson]

MP_id int NOT NULL,

Name varchar(50) NOT NULL,

mDate int NOT NULL,

mMonth int NOT NULL ,

mYear int NOT NULL ,

Hour int NOT NULL ,

minute int NOT NULL ,

Type varchar(50) NOT NULL ,

Date int NOT NULL ,

Month int NOT NULL ,

Year int NOT NULL ,

Address varchar(50) NOT NULL ,

ifReward int NOT NULL ,

marea varchar(50) NOT NULL ,

Contactno int NOT NULL ,

Contactperson varchar(50) NOT NULL ,

Photo varchar(50) NOT NULL ,

);

CREATE TABLE [dbo].[AdminLogin]

[AdminId] VARCHAR(50) NOT NULL PRIMARY KEY,

46
[AdminPassword] VARCHAR(50) NOT NULL );

CREATE TABLE [dbo].[News] (

[NewsId] INT NOT NULL,

[News] VARCHAR (100) NOT NULL,

[Date] DATE NOT NULL,

PRIMARY KEY CLUSTERED ([NewsId] ASC)

);

CREATE TABLE [dbo].[MostWanted] (

[CriminalId] INT NOT NULL,

[CriminalName] VARCHAR (100) NOT NULL,

[Age] int NOT NULL,

[CrimeType] VARCHAR(100) NOT NULL,

[BirthMark] VARCHAR(100) NOT NULL,

[Sex] VARCHAR(10) NOT NULL,

[CrimeDetails] VARCHAR (MAX) NOT NULL,

[Reward] NUMERIC (18) NOT NULL,

[Photo] VARCHAR (100) NOT NULL,

PRIMARY KEY CLUSTERED ([CriminalId] ASC)

);

CREATE SEQUENCE [DBO].[CriminalSeq] AS INT

START WITH 1

INCREMENT BY 1

GO

CREATE SEQUENCE [DBO].[CyberCrimeSequence] AS INT

47
START WITH 10001

INCREMENT BY 1

GO

CREATE SEQUENCE [DBO].[ComplaintSequence] AS INT

START WITH 1001

INCREMENT BY 1

GO

CREATE SEQUENCE [DBO].[FeedbackSequence] AS INT

START WITH 1

INCREMENT BY 1

GO

CREATE SEQUENCE [DBO].[UserRegistrationSeq] AS INT

START WITH 101

INCREMENT BY 1

GO

CREATE SEQUENCE [DBO].[MissingDetailsSeq] AS INT

START WITH 2001

INCREMENT BY 1

GO

CREATE SEQUENCE [DBO].[MissingPersonSeq] AS INT

START WITH 5001

48
INCREMENT BY 1 GO

HomePage.aspx

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"


AutoEventWireup="true" CodeFile="HomePage.aspx.cs" Inherits="HomePage" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"


tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/jquery.flip.min.js"></script>
<script>
$(function () {
$(".flip").flip({
trigger: 'hover'
});
});
</script>
<link href="StyleSheet1.css" rel="stylesheet" />
<style>
.flip {
height: 199px;
width: 300px;
margin: 0 auto;
}
.flip img {
width: 300px;
height: auto;
}
.flip .back {
background: #2184cd;
color: #fff;
text-align: center;
}
</style>
<style type="text/css">
.auto-style7
{
width: 100%;
}
.auto-style8
{
height: 381px;
}

49
.auto-style9
{
width: 315px;
}
.auto-style11
{
width: 697px;
}
.auto-style12
{
height: 381px;
width: 697px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left" class="auto-style9">
<asp:Panel ID="Panel3" runat="server" Height="657px"
Width="300px">
<div class="flip">
<div class="front">
<img src="imgs/images2.jpg" alt="" />
</div>
<div class="back">

<h3 align="center">Women Power Line<br />Call 1090</h3>


</div>
</div>
<br />
<div class="flip">
<div class="front">
<img src="imgs/images5.jpg" alt="" />
</div>
<div class="back">

50
<h3 align="center">Child Help Line<br />Call 1090</h3>
</div>
</div>
<br />
<div class="flip">
<div class="front">
<img src="imgs/images6.jpg" alt="" />
</div>
<div class="back">

<h3 align="center">Railway HelpLine GRP<br />Call 1512</h3>


</div>
</div>
</asp:Panel>
</td>
<td class="auto-style12">

<cc1:TabContainer ID="TabContainer1" runat="server"


ActiveTabIndex="0" Height="657px" Width="665px">
<cc1:TabPanel ID="TabPanel1" runat="server"
HeaderText="LATEST NEWS/UPDATES">

<ContentTemplate>
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource1"
runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString
%>" SelectCommand="SELECT TOP 10 [News] FROM [News]"></asp:SqlDataSource>
<marquee bgcolor="#2E9AFE" scrollamount="2"
direction="up" loop="true">
<asp:DataList ID="DataList1"
runat="server" DataSourceID="SqlDataSource1" Width="647px">
<ItemTemplate>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;<asp:Label ID="Label1" runat="server" Text='<%# Eval("News")
%>'></asp:Label>
<br />
<hr />
</ItemTemplate>
</asp:DataList>
</marquee>
</ContentTemplate>

</cc1:TabPanel>

51
<cc1:TabPanel ID="TabPanel2" runat="server"
HeaderText="MISSING PERSON">
<ContentTemplate>
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource2"
runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString
%>" SelectCommand="SELECT [Name], [Address], [Photo], [Contactno] FROM
[MissingPerson]"></asp:SqlDataSource>
<asp:DataList ID="DataList2" runat="server"
DataSourceID="SqlDataSource2" GridLines="Both" RepeatColumns="4">
<ItemTemplate>
&nbsp; &nbsp;<asp:Image ID="Image1"
runat="server" Height="134px" ImageUrl='<%# Eval("photo") %>'
Width="150px" />
<br />
&nbsp;&nbsp; Name :
<asp:Label ID="Label2" runat="server"
Text='<%# Eval("Name") %>'></asp:Label>
<br />
&nbsp;&nbsp; Address :
<asp:Label ID="Label3" runat="server"
Text='<%# Eval("Address") %>'></asp:Label>
<br />
&nbsp;&nbsp; Contact:&nbsp;
<asp:Label ID="Label4" runat="server"
Text='<%# Eval("Contactno") %>'></asp:Label>
</ItemTemplate>
</asp:DataList>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel3" runat="server"
HeaderText="MOST WANTED">
<ContentTemplate>
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource3"
runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString
%>" SelectCommand="SELECT [CriminalName], [Reward], [Photo] FROM
[MostWanted]"></asp:SqlDataSource>
<asp:DataList ID="DataList3" runat="server"
DataSourceID="SqlDataSource3" GridLines="Both" RepeatColumns="4">
<ItemTemplate>
<asp:Image ID="Image2" runat="server"
Height="124px" Width="146px" ImageUrl='<%# Eval("photo") %>' />
<br />

52
Name :
<asp:Label ID="Label5" runat="server"
Text='<%# Eval("CriminalName") %>'></asp:Label>
<br />
Reward: Rs.
<asp:Label ID="Label6" runat="server"
Text='<%# Eval("Reward") %>'></asp:Label>
</ItemTemplate>
</asp:DataList>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>

</td>
<td class="auto-style8" align="right">
<asp:Panel ID="Panel2" runat="server" Height="657px">
<div class="flip">
<div class="front">
<img src="imgs/images1.jpg" alt="" />
</div>
<div class="back">

<h3 align="center">Control Room<br />Call 100</h3>


</div>
</div>
<br />
<div class="flip">
<div class="front">
<img src="imgs/images4.jpg" alt="" />
</div>
<div class="back">

<h3 align="center">Fire Brigrade<br />Call 101</h3>


</div>
</div>
<br />
<div class="flip">
<div class="front">
<img src="imgs/images3.jpg" alt="" />
</div>
<div class="back">

<h3 align="center">Ambulance<br />Call 108</h3>


</div>
</div> <br />

53
</asp:Panel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

About Page

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"


AutoEventWireup="true" CodeFile="About.aspx.cs" Inherits="Contact" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<style type="text/css">
.newStyle1
{
font-family: Arial, Helvetica, sans-serif;
font-size: large;
background-color:#3366FF;
color:white;
}
.footer-main {
background-color: #143584;
float: left;
width: 100%;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #FFF;
}
.auto-style7
{
width: 100%;
}
.auto-style8
{
width: 50%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
<div class="newStyle1">
&nbsp;&nbsp;&nbsp;&nbsp;

54
GENERAL INFORMATION
</div>
&nbsp;&nbsp;&nbsp;<p style="font-family:Roboto, sans-serif">
&nbsp;&nbsp;&nbsp;&nbsp;
With an area of appx. 243,286 Sq.Km. and a population of over 20
Crores apporx (census 2011), Uttar Pradesh has the distinction of being
the largest single Police force not only in the country but of the entire
world. The Director General of UP Police commands a force of approx. 2.5
Lacs aprox. personnel spread over 75 districts, 33 armed Battalions and
other specialised wings/ branches relating to Intelligence,
Investigation, Anti-corruption, Technical, Training, Forensic Science
etc.

The present police system in the country was created following the
recommendation of the Police Commission headed by Mr. H.M. Court in 1860
which led to the enactment of the Police Act of 1861, which is in force
even today. The same Mr. Court became the first Inspector General of
Police of the then North West Province and Avadh which comprised the
territory of the present state of Uttar Pradesh. The Police structure was
erected in the form of the following eight organisations :
<ul style="font-family:Roboto, sans-serif">
<li> Provincial Police</li>
<li> Government Railway Police</li>
<li>Municipal Police</li>
<li>Cantonment Police</li>
<li>Town Police</li>
<li>Rural and Road Police</li>
<li>Canal Police</li>
<li>Barkandaj Guard (to protect the courts)</li>
</ul>
<p style="font-family:Roboto, sans-serif">
&nbsp;&nbsp;&nbsp;&nbsp;The Civil Police too continued to grow and
Mr. B.N. Lahiri was the first Indian IGP of the state after independence.
The performance of the State Police in the spheres of Crime control and
maintenance of Law and Order was highly appreciated and it had the proud
privilege of being the first police force in the country to be conferred
the honour of receiving the Colors on 13th November, 1952 by the then
Prime Minister of India, Pt. Jawahar Lal Nehru. Since then it has
maintained its glorious tradition of keeping communal and social harmony,
maintaining Law and Order and keeping a check on crime so that a sense of
security is inculcated amongst the people and all round development of
the state is ensured. Various Specialised wings for combating organised
crimes, economic offences etc. have since come into existence.
Modernisation is being given due emphasis in the fields of training,
technical aids like computers, telecommunications, Forensic science,
latest gadgetry, modern weapons and new vehicles.

55
Today the Police force had mainly divided into several important units
mentioned below to strengthen the efficiency in crime prevention,
detection along with its own administration<br />
&nbsp;</p><div class="newStyle1">
&nbsp;&nbsp;&nbsp;&nbsp;
UP POLICE IS DIVIDED INTO FOLLOWING RANGES & DISTRICTS
</div>
<br />
<table class="auto-style7">
<tr>
<td align="center" class="auto-style8">
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" DataKeyNames="Sno"
DataSourceID="SqlDataSource1" BackColor="White" BorderColor="#DEDFDE"
BorderStyle="None" BorderWidth="1px" CellPadding="4" PageSize="20" Font-
Size="Large" GridLines="Vertical" Width="1058px" ForeColor="Black">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="Sno" HeaderText="Sno"
ReadOnly="True" SortExpression="Sno" />
<asp:BoundField DataField="Name of Distt./ Range"
HeaderText="Name of Distt./ Range" SortExpression="Name of Distt./ Range"
/>
<asp:BoundField DataField="Rank" HeaderText="Rank"
SortExpression="Rank" />
<asp:BoundField DataField="Telephone No. police office"
HeaderText="Telephone No. police office" SortExpression="Telephone No.
police office" />
<asp:BoundField DataField="Telephone No. Camp office"
HeaderText="Telephone No. Camp office" SortExpression="Telephone No. Camp
office" />
<asp:BoundField DataField="Mobile(CUG)"
HeaderText="Mobile(CUG)" SortExpression="Mobile(CUG)" />
<asp:BoundField DataField="Email Address"
HeaderText="Email Address" SortExpression="Email Address" />
</Columns>
<FooterStyle BackColor="#CCCC99" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True"
ForeColor="White" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black"
HorizontalAlign="Right" />
<RowStyle BackColor="#F7F7DE" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True"
ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FBFBF2" />

56
<SortedAscendingHeaderStyle BackColor="#848384" />
<SortedDescendingCellStyle BackColor="#EAEAD3" />
<SortedDescendingHeaderStyle BackColor="#575357" />
</asp:GridView>
</td>

</tr>
</table>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Id] as Sno, [Name_of_distt] as 'Name of Distt./
Range', [Off_Rank] as Rank, [telephone_no] as 'Telephone No. police
office', [camp_off_phn_no] as 'Telephone No. Camp office', [mobile] as
'Mobile(CUG)', [emailid] as 'Email Address' FROM
[Contact]"></asp:SqlDataSource>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">

</asp:Content>

Captcha.aspx Page

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Text;
using System.Drawing.Imaging;

public partial class captcha : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{
Bitmap objBMP = new System.Drawing.Bitmap(80, 40);
Graphics objGraphics = System.Drawing.Graphics.FromImage(objBMP);
objGraphics.Clear(Color.Green);

57
objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;
//' Configure font to use for text
Font objFont = new Font("Arial",18, FontStyle.Bold);
string randomStr = "";
int[] myIntArray = new int[5];
int x;
//That is to create the random # and add it to our string
Random autoRand = new Random();

for (x = 0; x < 5; x++)


{
myIntArray[x] = System.Convert.ToInt32(autoRand.Next(0, 9));
randomStr += (myIntArray[x].ToString());

}
//This is to add the string to session cookie, to be compared
later
Session.Add("randomStr", randomStr);

//' Write out the text

objGraphics.DrawString(randomStr, objFont, Brushes.White, 3, 3);


//' Set the content type and return the image
Response.ContentType = "image/GIF";
objBMP.Save(Response.OutputStream, ImageFormat.Gif);
objFont.Dispose();
objGraphics.Dispose();
objBMP.Dispose();
}
}

ContactUs.aspx Page
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="ContactUs.aspx.cs" Inherits="ContactUs"
%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

<script type="text/javascript">
function fun1(msg) {
alert(msg);
}

58
</script>

<link href="StyleSheet1.css" rel="stylesheet" />


<style type="text/css">

.auto-style7
{
width: 100%;
}
.auto-style8
{
width: 201px;
}
.auto-style10
{
width: 284px;
}
.auto-style11
{
width: 201px;
height: 36px;
}
.auto-style13
{
width: 284px;
height: 36px;
}
.newStyle1
{
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style15
{
width: 201px;
height: 21px;
}
.auto-style17
{
width: 284px;
height: 21px;
}
.auto-style18
{
height: 21px;

59
}
.auto-style19
{
height: 23px;
}
.auto-style20
{
width: 201px;
height: 15px;
}
.auto-style22
{
width: 284px;
height: 15px;
}
.auto-style23
{}
.auto-style24
{
width: 290px;
height: 270px;
}
.auto-style25
{
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
width: 185px;
}
.auto-style26
{
width: 185px;
height: 15px;
}
.auto-style27
{
width: 185px;
}
.auto-style28
{
width: 185px;
height: 21px;
}
</style>

</asp:Content>

60
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div style="height: 404px">

<table class="auto-style7">
<tr>
<td colspan="4" class="auto-style19" >&nbsp;</td>
</tr>
<tr>
<td class="auto-style20"></td>
<td class="auto-style26"></td>
<td class="auto-style22"></td>
<td class="auto-style23" rowspan="5">
<img class="auto-style24"
src="imgs/30_3_2016_13_16_17_contact-us-1.png" align="right" /></td>
</tr>
<tr>
<td class="auto-style11"></td>
<td class="auto-style25">Your Name:</td>
<td class="auto-style13">
<asp:TextBox ID="TxtName" runat="server"
Width="250px" CssClass="form-control"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style25">Your Email address :</td>
<td class="auto-style10">
<asp:TextBox ID="TxtEmail" runat="server"
Width="250px" CssClass="form-control"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style25">Your Contact No.:</td>
<td class="auto-style10">
<asp:TextBox ID="TxtContact" runat="server"
Width="250px" CssClass="form-control" MaxLength="16">+91 - </asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style25">Comments/Suggestions/
<br />
Complaints/Appreciations</td>

61
<td class="auto-style10">
<asp:TextBox ID="TxtComment" runat="server"
Height="112px" TextMode="MultiLine" Width="250px" CssClass="form-control"
></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style27">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style15"></td>
<td class="auto-style28"></td>
<td class="auto-style17">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="BtnSubmit" runat="server"
Text="Sumbit" CssClass="btn-success" Height="31px" Width="86px"
OnClick="BtnSubmit_Click" />
&nbsp;&nbsp;&nbsp;
<asp:Button ID="BtnReset" runat="server" Text="Reset"
CssClass="btn-danger" Height="31px" Width="86px" OnClick="BtnReset_Click"
/>
</td>
<td class="auto-style18"></td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style27">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style27">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">

62
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
using System.Data.SqlClient;
public partial class ContactUs : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void BtnReset_Click(object sender, EventArgs e)
{
TxtName.Text = string.Empty;
TxtEmail.Text = string.Empty;
TxtContact.Text = string.Empty;
TxtComment.Text = string.Empty;

}
protected bool EmailValidate(string patt)
{
string pattern = null;
pattern = @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";

if (Regex.IsMatch(patt, pattern))

return true;

else

return false;

}
protected void BtnSubmit_Click(object sender, EventArgs e)
{
if (TxtName.Text == string.Empty || TxtEmail.Text == string.Empty
|| TxtContact.Text == string.Empty || TxtComment.Text == string.Empty)
{

63
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('please fill all values');", true);
return;

}
if (!EmailValidate(TxtEmail.Text))
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('please enter valid email id');", true);
TxtEmail.Focus();
return;
}
SqlConnection con = new SqlConnection();
con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "insert into Feedback values(NEXT VALUE FOR
DBO.FeedbackSequence,@Name,@EmailAddress,@ContactNo,@Comment,@FeedbackDat
e)";
cmd.Parameters.AddWithValue("@Name", TxtName.Text);
cmd.Parameters.AddWithValue("@EmailAddress", TxtEmail.Text);
cmd.Parameters.AddWithValue("@ContactNo", TxtContact.Text);
cmd.Parameters.AddWithValue("@Comment", TxtComment.Text);
cmd.Parameters.AddWithValue("@FeedbackDate", DateTime.Now);
cmd.Connection = con;
con.Open();
try
{
cmd.ExecuteNonQuery();
con.Close();
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Thank you for feedback/contact,we will respond you shortly');",
true);
}
catch (Exception ex)
{
Response.Write(ex.Message);
con.Close();
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Something went wrong, please try again');", true);
}

}
}

64
Default.aspx Page

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"


AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<script type="text/javascript">
function fun1(msg) {
alert(msg);
}

</script>
<link href="StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.auto-style7
{
width: 100%;

font-family:'Roboto', Arial, Helvetica, sans-serif;


font-size: 16px;
}
.auto-style8
{
width: 279px;
}
</style>

</asp:Content>
<asp:Content ID="Content2" runat="server"
contentplaceholderid="ContentPlaceHolder1">
<div style="height: 550px">

<table class="auto-style7">
<tr>
<td class="auto-style8">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;&nbsp;&nbsp;&nbsp; Enter
Your Email ID</td>
<td>

65
<asp:TextBox ID="TxtEmailId" runat="server"
CssClass="form-control" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;&nbsp;&nbsp;&nbsp; Enter
Your Password</td>
<td>
<asp:TextBox ID="TxtPassword" runat="server"
CssClass="form-control" TextMode="Password" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" Text="Login" Width="101px" CssClass="btn-success"
Height="40px" />
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>

66
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>

67
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
</table>

</div>
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from UserRegistration where
EmailId='" + TxtEmailId.Text + "'";

cmd.Connection = con;
con.Open();

SqlDataReader r = cmd.ExecuteReader();

68
if (r.Read())
{
if (TxtPassword.Text==r["UserPassword"].ToString())
{
Session["RegId"] = r["RegId"].ToString();
Session["EmailId"] = r["EmailId"].ToString();
Session["UserName"] = r["UserName"].ToString();
Session["LoginStatus"] = r["LoginStatus"].ToString();
Session["PoliceStationId"] =
r["PoliceStationId"].ToString();
Session["UserAddress"] = r["Address"].ToString();
con.Close();
Response.Redirect("user/UserHome.aspx");
}
else
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Invalid Password');", true);

}
else
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('No Such email id / password');", true);

}
}

MasterPage.Master

<%@ Master Language="C#" AutoEventWireup="true"


CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

69
<head runat="server">
<script type="text/javascript">
function display_c() {
var refresh = 1000; // Refresh rate in milli seconds
mytime = setTimeout('display_ct()', refresh)
}

function display_ct() {
var strcount
var x = new Date()
document.getElementById('Panel1').innerHTML = x;
tt = display_c();
}
</script>
<title>E - Police : Online Crime Reporting System </title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">

.button-main {
background-color: #183883;
float: left;
height: 50px;
width: 100%;
margin:0px auto;
margin-top: 10px;
border-top-width: 1px;
border-bottom-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-top-color: #0f2459;
border-bottom-color: #0f2459;
}
.btn {
height: 50px;
width: 1033px;
margin:0px auto;
}

.btn ul
{
padding:0px;
margin:0px auto;
margin-top:8px;
}

70
.btn li{
display: inline;
margin: 0px auto;
text-align: center;
border-right: 1px solid #214aa9;
float:left;
}

.btn a {
font-family: Roboto;
font-size: 18px;
color: #FFF;
text-decoration: none;
border: 1px solid #183883;
border-radius:3px;
font-weight:500;
display:block;
border-right: 1px solid #112960;
padding:0px 25px;
line-height:35px;
}

.btn a:hover {
border: 1px solid #FFF;
}
.btn .active {
border: 1px solid #FFF;
}

.auto-style1
{
width: 100%;
height: 150px;
}
.auto-style2
{
width: 132px;
height: 150px;
}
.auto-style3
{
width: 88px;
}

71
.auto-style5
{
width: 773px;
}

.auto-style6
{
width: 275px;
height: 76px;
}
.footer-main {
background-color: #143584;
float: left;
width: 100%;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #FFF;
}

</style>
</head>
<body onload=display_ct();>

<form id="form1" runat="server">


<div style="height: 153px">

<table class="auto-style1">
<tr>
<td class="auto-style3">
<img class="auto-style2" src="imgs/4.bmp" /></td>
<td class="auto-style5"
background="imgs/header_bckg.jpg">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="#" style="color:#FFFFFF; text-
decoration:none; text-align:center ;font-weight:bold; height:36px; font-
size:26px; text-transform:uppercase;">Our Mission - City Without
Crime</a>

72
</td>

<td>
<img class="auto-style6" src="imgs/control-room-
im.jpg" /><br />
<br />
<asp:Panel ID="Panel1" runat="server" Font-
Names="Microsoft Sans Serif" Font-Size="Large" style="margin-left: 9px">
</asp:Panel>
</td>

</tr>
</table>

</div>

<div class="button-main">
<div class="btn">
<ul>
<li><a href="HomePage.aspx">HOME</a></li>
<li><a class="" href="About.aspx" data-flexmenu="flexmenu1"
stylez="position:relative;left:900px;top:200px">ABOUT US</a></li>
<li><a class="" href="UserRegistration.aspx" data-
flexmenu="flexmenu2"
stylez="position:relative;left:900px;top:200px">REGISTRATION</a><span
class="btn-line"></span></li>
<li><a class="" href="Search.aspx" data-flexmenu="flexmenu3"
stylez="position:relative;left:900px;top:200px">SEARCH</a></li>
<li><a class="" href="Default.aspx" data-flexmenu="flexmenu5"
stylez="position:relative;left:900px;top:200px">LOGIN</a></li>
<li><a href="ContactUs.aspx" data-flexmenu="flexmenu6"
stylez="position:relative;left:900px;top:200px">CONTACT US</a></li>

</div>

</div>

<br />
<br />
<br />
<div>

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">


</asp:ContentPlaceHolder>

73
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>

</div>

</form>
<div class="footer-main">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td align="left" style="color:white;">&copy;
</td>
<td align="right">&nbsp;</td>
</tr>
</tbody></table>
<table style="color:white" >
<tr><td>
Best viewed in 1024*768 pixel resolution.<br />
256 bit Secured Socket Server (SSL)<br />
Digital Certification<br />
Secured Login Page

</td></tr>

</table>
</div>
</body>
</html>

Search.aspx Page

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"


AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<style type="text/css">
.btn-success{color:#fff;background-color:#5cb85c;border-
color:#4cae4c}.btn-success.focus,.btn-
success:focus{color:#fff;background-color:#449d44;border-
color:#255625}.btn-success:hover{color:#fff;background-
color:#449d44;border-color:#398439}.btn-success.active,.btn-
success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-
color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-
success.active:focus,.btn-success.active:hover,.btn-
success:active.focus,.btn-success:active:focus,.btn-
success:active:hover,.open>.dropdown-toggle.btn-

74
success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-
toggle.btn-success:hover{color:#fff;background-color:#398439;border-
color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-
toggle.btn-success{background-image:none}.btn-
success.disabled.focus,.btn-success.disabled:focus,.btn-
success.disabled:hover,.btn-success[disabled].focus,.btn-
success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled]
.btn-success.focus,fieldset[disabled] .btn-
success:focus,fieldset[disabled] .btn-success:hover{background-
color:#5cb85c;border-color:#4cae4c}.btn-success
.badge{color:#5cb85c;background-color:#fff}
.form-control{display:block;width:100%;padding:6px 12px;font-
size:14px;line-height:1.42857143;color:#555;background-
color:#fff;background-image:none;border:1px solid #ccc;border-
radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-
shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color
ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-
transition:border-color ease-in-out .15s,box-shadow ease-in-out
.15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s
}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-
shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-
shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px
rgba(102,175,233,.6)}.form-control::-moz-
placeholder{color:#999;opacity:1}.form-control:-ms-input-
placeholder{color:#999}.form-control::-webkit-input-
placeholder{color:#999}.form-control::-ms-expand{background-
color:transparent;border:0}.form-control[disabled],.form-
control[readonly],fieldset[disabled] .form-control{background-
color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-
control{cursor:not-allowed}

.style1
{
width: 100%;
}
.newStyle1
{
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
background-color: #FF9933;
}
.style2
{
width: 388px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;

75
}
.style3
{
width: 126px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style7
{
width: 340px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style8
{
width: 300px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
<table class="style1">

<tr class="newStyle1">
<td colspan="3">
&nbsp;&nbsp;
Search Police Station</td>
</tr>
<tr>
<td colspan="3">
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;&nbsp;
Enter Keyword(Area Name/District/Address)</td>
<td class="auto-style8">
<asp:TextBox ID="TextBox1" runat="server" Width="280px"
style="margin-left: 0px" CssClass="form-control"
Height="25px"></asp:TextBox>
&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Search"
onclick="Button1_Click" CssClass="btn-success" Height="31px" Width="92px"
/>

76
</td>
</tr>
<tr>
<td colspan="3">
<asp:DataList ID="DataList1" runat="server"
GridLines="Both" RepeatColumns="4"
DataSourceID="SqlDataSource1" CssClass="form-control"
Font-Names="Microsoft Sans Serif">
<ItemTemplate>
<table class="style1">
<tr>
<td colspan="2">
<h3><%# Eval("PoliceStationName")
%></h3><hr /></td>
</tr>
<tr>
<td class="style3">
District</td>
<td>
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("District") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
Chowky Incharge</td>
<td>
<asp:Label ID="Label2" runat="server"
Text='<%#
Eval("ChowkiInchargeName") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
Address</td>
<td>
<asp:Label ID="Label3" runat="server"
Text='<%# Eval("Address") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
Contact No</td>
<td>
<asp:Label ID="Label4" runat="server"
Text='<%# Eval("ContactNo") %>'></asp:Label>

77
</td>
</tr>
<tr>
<td>
Email Id</td>
<td>
<a href="mailto:'<%# Eval("EmailId")
%>'"> <asp:Label ID="Label5" runat="server" Text='<%# Eval("EmailId")
%>'></asp:Label></a>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
<tr>
<td colspan="3">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Policestationname],
[District], [ChowkiInchargeName], [Address], [Contactno], [EmailId] FROM
[Policestation] WHERE (([PolicestationArea] LIKE '%' + @PolicestationArea
+ '%') OR([District] LIKE '%' + @District + '%') OR ([Address] LIKE '%' +
@Address + '%'))">
<SelectParameters>
<asp:ControlParameter ControlID="TextBox1"
DefaultValue="000"
Name="PolicestationArea" PropertyName="Text"
/>
<asp:ControlParameter ControlID="TextBox1"
DefaultValue="000" Name="District"
PropertyName="Text" />
<asp:ControlParameter ControlID="TextBox1"
DefaultValue="000" Name="Address"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

78
UserRegistration.aspx Page

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"


AutoEventWireup="true" CodeFile="UserRegistration.aspx.cs"
Inherits="UserRegistration" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"


tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<script type="text/javascript">
function fun1(msg) {
alert(msg);
}

</script>
<link href="StyleSheet1.css" rel="stylesheet" />

<style type="text/css">

.newStyle1
{
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style7
{
width: 100%;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 776px;
}
.auto-style8
{
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style9
{font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
width: 139px;
height: 18px;
}

79
.auto-style10
{font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 18px;
}
.auto-style11
{font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
width: 245px;
}
.auto-style12
{font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 18px;
width: 245px;
}
.auto-style13
{
width: 285px;
}
.auto-style14
{
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 18px;
width: 285px;
}
.auto-style15
{
width: 139px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 22px;
}
.auto-style16
{
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
width: 245px;
height: 22px;
}
.auto-style17
{
width: 285px;
height: 22px;
}

80
.auto-style18
{
height: 22px;
}
.auto-style19
{
width: 139px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 38px;
}
.auto-style20
{
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
width: 245px;
height: 38px;
}
.auto-style21
{
width: 285px;
height: 38px;
}
.auto-style22
{
height: 38px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div style="height: 908px">

<br />
<table class="auto-style7">
<tr>
<td class="auto-style8" colspan="4" style="font-family:
Arial, Helvetica, sans-serif;
font-size: large;
background-color:#3366FF;
color:white;

">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp; User Registration&nbsp;</td>
</tr>
<tr>

81
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td class="auto-style13">&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style19"></td>
<td class="auto-style20">Enter your Email Id</td>
<td class="auto-style21">
<asp:TextBox ID="TxtEmail" runat="server"
Width="250px" CssClass="form-control"></asp:TextBox>
</td>
<td class="auto-style22">
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TxtEmail" ErrorMessage="*(Please enter valid email
id)" ForeColor="Red" ValidationGroup="v" ValidationExpression="\w+([-
+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
<br />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator7" runat="server" ControlToValidate="TxtEmail"
ErrorMessage="*(Please enter email id)" ForeColor="Red"
ValidationGroup="v"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="auto-style9"></td>
<td class="auto-style12">Enter your Name</td>
<td class="auto-style14">
<asp:TextBox ID="TxtName" runat="server"
Width="250px" CssClass="form-control"></asp:TextBox>
</td>
<td class="auto-style10">
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtName"
ErrorMessage="*(Please enter your name)" ForeColor="Red"
ValidationGroup="v"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Enter Password</td>
<td class="auto-style13">
<asp:TextBox ID="TxtPassword" runat="server"
Width="250px" CssClass="form-control" TextMode="Password"></asp:TextBox>

82
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server" ErrorMessage="*(Please enter
your password)" ForeColor="Red" ValidationGroup="v"
ControlToValidate="TxtPassword"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">ReEnter Password</td>
<td class="auto-style13">
<asp:TextBox ID="TxtrePassword" runat="server"
Width="250px" CssClass="form-control" TextMode="Password"></asp:TextBox>
</td>
<td>
<asp:CompareValidator ID="CompareValidator1"
runat="server" ControlToCompare="TxtPassword"
ControlToValidate="TxtrePassword" ErrorMessage="*(Please type same
password)" ForeColor="Red" ValidationGroup="v"></asp:CompareValidator>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Select Gender</td>
<td class="auto-style13">
<asp:RadioButtonList ID="RadioButtonList1"
runat="server" RepeatDirection="Horizontal">
<asp:ListItem Selected="True"
Value="Male">Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</asp:RadioButtonList>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Enter Address</td>
<td class="auto-style13">
<asp:TextBox ID="TxtAddress" runat="server"
Width="250px" CssClass="form-control"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server" ErrorMessage="*(Please enter

83
Adress)" ForeColor="Red" ValidationGroup="v"
ControlToValidate="TxtAddress"></asp:RequiredFieldValidator>
</td>
</tr>

<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Select District</td>
<td class="auto-style13">
<asp:DropDownList ID="DdlDistrict" runat="server"
Height="32px" Width="275px">
<asp:ListItem>---Select---</asp:ListItem>
<asp:ListItem>Kanpur</asp:ListItem>
<asp:ListItem>Lucknow</asp:ListItem>
<asp:ListItem>Barabanki</asp:ListItem>
<asp:ListItem>Allahabad</asp:ListItem>
<asp:ListItem>Agra</asp:ListItem>
</asp:DropDownList>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Enter Pincode</td>
<td class="auto-style13">
<asp:TextBox ID="TxtPincode" runat="server"
Width="250px" CssClass="form-control" MaxLength="6"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator4" runat="server" ErrorMessage="*(Please enter
your pincode)" ForeColor="Red" ValidationGroup="v"
ControlToValidate="TxtPincode"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Enter Contact No</td>
<td class="auto-style13">
<asp:TextBox ID="TxtContact" runat="server"
Width="250px" CssClass="form-control" MaxLength="13"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator5" runat="server" ErrorMessage="*(Please enter

84
your contactno)" ForeColor="Red" ValidationGroup="v"
ControlToValidate="TxtContact"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Select Educational
Qualification</td>
<td class="auto-style13">
<asp:DropDownList ID="DdlEducational" runat="server"
Height="32px" Width="275px">
<asp:ListItem>---Select---</asp:ListItem>
<asp:ListItem>Below 10th</asp:ListItem>
<asp:ListItem>Highschool</asp:ListItem>
<asp:ListItem>Intermediate</asp:ListItem>
<asp:ListItem>Graduation</asp:ListItem>
<asp:ListItem>Post Graduation</asp:ListItem>
<asp:ListItem>Others</asp:ListItem>
</asp:DropDownList>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Enter AADHAR No (optional)</td>
<td class="auto-style13">
<asp:TextBox ID="TxtAadhar" runat="server"
Width="250px" CssClass="form-control"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Select ID Proof</td>
<td class="auto-style13">
<asp:DropDownList ID="DdlIdproof" runat="server"
Height="32px" Width="275px">
<asp:ListItem>---Select---</asp:ListItem>
<asp:ListItem>PAN Card</asp:ListItem>
<asp:ListItem>AADHAR</asp:ListItem>
<asp:ListItem>Voter ID Card</asp:ListItem>
<asp:ListItem>Driving Lisence</asp:ListItem>
<asp:ListItem>Passport</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</asp:DropDownList>
</td>

85
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Enter ID Proof Document No</td>
<td class="auto-style13">
<asp:TextBox ID="TxtDocumentNo" runat="server"
Width="250px" CssClass="form-control"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator6" runat="server" ErrorMessage="*(Please enter
your selected document no)" ForeColor="Red"
ControlToValidate="TxtDocumentNo"
ValidationGroup="v"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">Select Nearest Police
Station</td>
<td class="auto-style13">
<asp:DropDownList ID="DdlNearestPoliceStation"
runat="server" Height="32px" Width="275px" AppendDataBoundItems="True"
DataSourceID="SqlDataSource1" DataTextField="PoliceStationName"
DataValueField="PoliceStationId">
<asp:ListItem>----Select----</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [PoliceStationId], [PoliceStationName] FROM
[PoliceStation]"></asp:SqlDataSource>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td class="auto-style13">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td class="auto-style13" align="center">

86
<asp:Image ID="Image1" runat="server"
ImageUrl="~/captcha.aspx" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style15"></td>
<td class="auto-style16">Enter Captcha</td>
<td class="auto-style17">
<asp:TextBox ID="TxtCaptcha" runat="server"
Width="250px" CssClass="form-control" MaxLength="6"></asp:TextBox>
</td>
<td class="auto-style18"></td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td class="auto-style13">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td class="auto-
style13">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="BtnSubmit" runat="server"
Text="Submit" CssClass="btn-primary" Height="32px" Width="73px"
ValidationGroup="v" OnClick="BtnSubmit_Click" />
&nbsp;&nbsp;&nbsp;<input id="Reset1" class="btn-danger" type="reset"
value="Reset" />&nbsp;&nbsp;
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td class="auto-style13">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11"><asp:Label ID="LblOtp"
runat="server" Text="Enter OTP recieved in Mail" Visible="False"
ForeColor="Black"></asp:Label>
</td>
<td class="auto-style13">

87
<asp:TextBox ID="TxtOTP" runat="server" Width="250px"
CssClass="form-control" MaxLength="6" Visible="False"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style15"></td>
<td class="auto-style16"></td>
<td class="auto-style17"></td>
<td class="auto-style18"></td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td class="auto-
style13">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="BtnRegister" runat="server"
CssClass="btn-success" Height="32px" Text="Register" Width="73px"
Visible="False" OnClick="BtnRegister_Click" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td class="auto-style13">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;

88
using System.Net;
using System.Data.SqlClient;
public partial class UserRegistration : System.Web.UI.Page
{
static string password="";
protected void Page_Load(object sender, EventArgs e)
{

}
protected void BtnSubmit_Click(object sender, EventArgs e)
{
if (Session["randomStr"].ToString() != TxtCaptcha.Text)
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Please enter valid captcha code');", true);
TxtCaptcha.Focus();
return;
}

if (!CheckDropDown())
{
DdlDistrict.Focus();
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Please select district/educational qualification/ID Proof/Nearest
Police Station');", true);
return;
}
if (!CheckEmail())
{
TxtEmail.Focus();
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('This Email Id is already registered');", true);
return;
}

password = TxtPassword.Text;
Random r=new Random();

string Otp="";
for(int i=1;i<=6;i++)
{
Otp=Otp+r.Next(0,9).ToString();
}
Session["Otp"] = Otp;
MailMessage msg = new MailMessage();
msg.To.Add(TxtEmail.Text);

89
msg.Subject = "OTP for Registration in Online Crime Reporting
System";
msg.Body = "Dear " + TxtName.Text + ",<br>Your One Time Password
is : <h3> " + Otp + " </h3><br>Please use this OTP for complete
registration<br><br>Thanks,<br><br>regard's<br><br> Team Online Crime
Reporting System";

msg.From = new MailAddress( "dotnet.demobyas@gmail.com");


msg.IsBodyHtml = true;
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.Credentials = new
NetworkCredential("dotnet.demobyas@gmail.com", "Arun@1439");

client.EnableSsl = true;
try
{
client.Send(msg);

ScriptManager.RegisterStartupScript(Page, GetType(), "",


"fun1('Please Check Ur Email For OTP');", true);

LblOtp.Visible = true;
TxtOTP.Visible = true;
BtnRegister.Visible = true;

TxtOTP.Focus();

}
catch (Exception ex)
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Something went wrong please try again later');", true);

protected bool CheckDropDown()


{
if (DdlDistrict.SelectedIndex == 0 ||
DdlEducational.SelectedIndex == 0 || DdlIdproof.SelectedIndex == 0 ||
DdlNearestPoliceStation.SelectedIndex == 0)
return false;
else
return true;

90
}
protected void BtnRegister_Click(object sender, EventArgs e)
{
if (TxtOTP.Text != Session["Otp"].ToString())
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Please Enter Valid OTP');", true);
TxtOTP.Focus();
return;

SqlConnection con = new SqlConnection();


con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "insert into UserRegistration values(NEXT VALUE
FOR DBO.UserRegistrationSeq,@b,@c,@d,@e,@f,@g,@h,@i,@j,@k,@l,@m,@n,@o)";
cmd.Parameters.AddWithValue("@b", TxtEmail.Text);
cmd.Parameters.AddWithValue("@c", TxtName.Text);
cmd.Parameters.AddWithValue("@d", password);
cmd.Parameters.AddWithValue("@e",
RadioButtonList1.SelectedItem.Value);
cmd.Parameters.AddWithValue("@f", TxtAddress.Text);
cmd.Parameters.AddWithValue("@g",
DdlDistrict.SelectedItem.Value);
cmd.Parameters.AddWithValue("@h", long.Parse(TxtPincode.Text));
cmd.Parameters.AddWithValue("@i", TxtContact.Text);
cmd.Parameters.AddWithValue("@j",
DdlEducational.SelectedItem.Value);
if(TxtAadhar.Text==string.Empty)
cmd.Parameters.AddWithValue("@k", "N/A");
else
cmd.Parameters.AddWithValue("@k", TxtAadhar.Text);
cmd.Parameters.AddWithValue("@l", DdlIdproof.SelectedItem.Value);
cmd.Parameters.AddWithValue("@m", TxtDocumentNo.Text);
cmd.Parameters.AddWithValue("@n",
DdlNearestPoliceStation.SelectedItem.Value);
cmd.Parameters.AddWithValue("@o", "Login Created At : " +
DateTime.Now.ToString());

cmd.Connection = con;

91
con.Open();

try
{
cmd.ExecuteNonQuery();
con.Close();

ScriptManager.RegisterStartupScript(Page, GetType(), "",


"fun1('Thank you for registration');", true);

}
catch (Exception ex)
{
con.Close();
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Something went wrong please try again later');", true);

}
}
protected bool CheckEmail()
{
bool var;
SqlConnection con = new SqlConnection();
con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from UserRegistration where
EmailId=@EmailId";
cmd.Parameters.AddWithValue("@EmailId", TxtEmail.Text);

cmd.Connection = con;
con.Open();
SqlDataReader r = cmd.ExecuteReader();
if (r.Read())
{
var = false;
}
else
{
var = true;
}
con.Close();
return var;
}

92
}

UserMasterPage.Master

<%@ Master Language="C#" AutoEventWireup="true"


CodeFile="UserMasterPage.master.cs" Inherits="User_UserMasterPage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script type="text/javascript">
function display_c() {
var refresh = 1000; // Refresh rate in milli seconds
mytime = setTimeout('display_ct()', refresh)
}

function display_ct() {
var strcount
var x = new Date()
document.getElementById('Panel1').innerHTML = x;
tt = display_c();
}
</script>
<title>E - Police : Online Crime Reporting System</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">

.button-main {
background-color: #183883;
float: left;
height: 50px;
width: 100%;
margin:0px auto;
margin-top: 10px;
border-top-width: 1px;
border-bottom-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-top-color: #0f2459;
border-bottom-color: #0f2459;
}
.btn {

93
height: 50px;
width: 1033px;
margin:0px auto;
}

.btn ul
{
padding:0px;
margin:0px auto;
margin-top:8px;
}

.btn li{
display: inline;
margin: 0px auto;
text-align: center;
border-right: 1px solid #214aa9;
float:left;
}

.btn a {
font-family: Roboto;
font-size: 18px;
color: #FFF;
text-decoration: none;
border: 1px solid #183883;
border-radius:3px;
font-weight:500;
display:block;
border-right: 1px solid #112960;
padding:0px 25px;
line-height:35px;
}

.btn a:hover {
border: 1px solid #FFF;
}
.btn .active {
border: 1px solid #FFF;
}

.auto-style1
{

94
width: 100%;
height: 150px;
}
.auto-style2
{
width: 132px;
height: 150px;
}
.auto-style3
{
width: 88px;
}

.auto-style5
{
width: 773px;
}

.auto-style6
{
width: 275px;
height: 76px;
}
.footer-main {
background-color: #143584;
float: left;
width: 100%;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #FFF;
}

</style>
</head>
<body onload=display_ct();>

<form id="form1" runat="server">


<div style="height: 153px">

<table class="auto-style1">
<tr>

95
<td class="auto-style3">
<img class="auto-style2" src="../imgs/4.bmp"
/></td>
<td class="auto-style5"
background="../imgs/header_bckg.jpg">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="#" style="color:#FFFFFF; text-
decoration:none; text-align:center ;font-weight:bold; height:36px; font-
size:26px; text-transform:uppercase;">Our Mission - City Without
Crime</a>

</td>

<td>
<img class="auto-style6" src="../imgs/control-
room-im.jpg" /><br />
<br />
<asp:Panel ID="Panel1" runat="server" Font-
Names="Microsoft Sans Serif" Font-Size="Large" style="margin-left: 9px">
</asp:Panel>
</td>

</tr>
</table>

</div>

<div class="button-main">
<div class="btn">
<ul>
<li><a href="UserHome.aspx">HOME</a></li>
<li><a class="" href="../About.aspx" data-flexmenu="flexmenu1"
stylez="position:relative;left:900px;top:200px">ABOUT US</a></li>
<li><a class="MissingReport.aspx"
href="listmissingvaluables.aspx" data-flexmenu="flexmenu5"
stylez="position:relative;left:900px;top:200px">MISSING VALUABLE
REPORT</a></li>

<li><a class="#" href="ChangePassword.aspx" data-


flexmenu="flexmenu3"
stylez="position:relative;left:900px;top:200px">CHANGE PASSWORD</a></li>

96
</div>

</div>

<br />
<br />
<br />
<div>

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">


</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>

</div>

</form>
<div class="footer-main">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td align="left" style="color:white;">&copy; Indian Police 2016
All Right Reserved

</td>
<td align="right">&nbsp;</td>
</tr>
</tbody></table>
<table style="color:white" >
<tr><td>
Best viewed in 1024*768 pixel resolution.<br />
256 bit Secured Socket Server (SSL)<br />
Digital Certification<br />
Secured Login Page

</td></tr>

</table>
</div>
</body>
</html>
UserHome.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/User/UserMasterPage.master" AutoEventWireup="true"
CodeFile="UserHome.aspx.cs" Inherits="User_UserHome" %>

97
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">

.auto-style7
{
width: 100%;
}
.auto-style8
{
width: 201px;
}
.auto-style12
{
width: 202px;
}
.auto-style13
{
width: 203px;
}
.auto-style14
{
width: 201px;
height: 24px;
}
.auto-style15
{
width: 202px;
height: 24px;
}
.auto-style16
{
width: 203px;
height: 24px;
}
.auto-style17
{
height: 24px;
width: 401px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style18
{
width: 401px;

98
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style19
{
height: 22px;
}
.auto-style20
{
width: 201px;
height: 22px;
}
.auto-style21
{
width: 202px;
height: 22px;
}
.auto-style22
{
width: 203px;
height: 22px;
}
.auto-style23
{
width: 401px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 22px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div style="height: 160px">

<table class="auto-style7">
<tr>
<td class="auto-style14"></td>
<td class="auto-style15"></td>
<td class="auto-style16"></td>
<td class="auto-style15"></td>
<td class="auto-style17">
<asp:Label ID="LblUserName" runat="server" Font-
Size="Large"></asp:Label>

99
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style12">&nbsp;</td>
<td class="auto-style13">&nbsp;</td>
<td class="auto-style12">&nbsp;</td>
<td class="auto-style18">
<asp:Label ID="LblLoginStatus" runat="server" Font-
Size="Large"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style20"></td>
<td class="auto-style21"></td>
<td class="auto-style22"></td>
<td class="auto-style21"></td>
<td class="auto-style23" align="right">
<asp:LinkButton ID="LinkButton1" runat="server"
OnClick="LinkButton1_Click">Logout</asp:LinkButton>
</td>
</tr>
<tr>
<td class="auto-style8" align="right">
<asp:Button ID="Button1" runat="server" Height="32px"
Text="General Complain" Width="150px" CssClass="btn-success"
PostBackUrl="~/User/GeneralComplaint.aspx" />
</td>
<td class="auto-style12" align="right">&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button2" runat="server" Height="32px"
Text="Missing Person" Width="150px" CssClass="btn-primary"
PostBackUrl="~/User/MissingPerson.aspx" />
</td>
<td class="auto-style13" align="right">
<asp:Button ID="Button3" runat="server" Height="32px"
Text="Missing Valuable" Width="150px" CssClass="btn-warning"
PostBackUrl="~/User/MissingValuable.aspx" />
</td>
<td class="auto-style12" align="right">
<asp:Button ID="Button4" runat="server" Height="32px"
Text="Crime Complain" Width="150px" CssClass="btn-danger" />
</td>
<td align="center" class="auto-style18">
<asp:Button ID="Button5" runat="server" Height="32px"
Text="Cyber Crime Complain" Width="150px" CssClass="btn-info"
PostBackUrl="~/User/CyberCrime.aspx" />

100
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style12">&nbsp;</td>
<td class="auto-style13">&nbsp;</td>
<td class="auto-style12">&nbsp;</td>
<td class="auto-style18">&nbsp;</td>
</tr>

</table>

</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<table class="auto-style7">
<tr>
<td style="font-family: Arial, Helvetica, sans-serif;
font-size: large;
background-color:#3366FF;
color:white;
">User Information</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" BackColor="White" Width="100%"
BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"
CellPadding="3" DataKeyNames="EmailId" DataSourceID="SqlDataSource1"
ForeColor="Black" GridLines="Vertical">
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
<asp:BoundField DataField="RegId"
HeaderText="RegId" SortExpression="RegId" />
<asp:BoundField DataField="EmailId"
HeaderText="EmailId" ReadOnly="True" SortExpression="EmailId" />
<asp:BoundField DataField="UserName"
HeaderText="UserName" SortExpression="UserName" />
<asp:BoundField DataField="Gender"
HeaderText="Gender" SortExpression="Gender" />

101
<asp:BoundField DataField="Address"
HeaderText="Address" SortExpression="Address" />
<asp:BoundField DataField="District"
HeaderText="District" SortExpression="District" />
<asp:BoundField DataField="Pincode"
HeaderText="Pincode" SortExpression="Pincode" />
<asp:BoundField DataField="ContactNo"
HeaderText="ContactNo" SortExpression="ContactNo" />
<asp:BoundField DataField="Qualification"
HeaderText="Qualification" SortExpression="Qualification" />
<asp:BoundField DataField="IDProof"
HeaderText="IDProof" SortExpression="IDProof" />
<asp:BoundField DataField="DocumentNo"
HeaderText="DocumentNo" SortExpression="DocumentNo" />
<asp:BoundField DataField="PoliceStationName"
HeaderText="PoliceStationName" SortExpression="PoliceStationName" />
<asp:BoundField DataField="AADHARNo"
HeaderText="AADHARNo" SortExpression="AADHARNo" />
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<HeaderStyle BackColor="Black" Font-Bold="True"
ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-
Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#808080" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#383838" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT u.[RegId], u.[EmailId], u.[UserName], u.[Gender],
u.[Address], u.[District], u.[Pincode], u.[ContactNo], u.[Qualification],
u.[IDProof], u.[DocumentNo], p.[PoliceStationName], u.[AADHARNo] FROM
[UserRegistration] u ,[PoliceStation] p WHERE (u.[EmailId] = @EmailId)
and (u.[PoliceStationId]=p.[PoliceStationId])">
<SelectParameters>
<asp:SessionParameter Name="EmailId"
SessionField="EmailId" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>

102
<td>&nbsp;</td>
</tr>
<tr>
<td style="font-family: Arial, Helvetica, sans-serif;
font-size: large;
background-color:#3366FF;
color:white;
">General Complaints</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridView2" runat="server"
AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966"
BorderStyle="None" BorderWidth="1px" CellPadding="4"
DataKeyNames="ComplaintId" DataSourceID="SqlDataSource2" Width="100%"
AllowPaging="True" PageSize="5" EmptyDataText="No Complaints">
<Columns>
<asp:BoundField DataField="ComplaintId"
HeaderText="ComplaintId" ReadOnly="True" SortExpression="ComplaintId" />
<asp:BoundField DataField="ComplaintMatter"
HeaderText="ComplaintMatter" SortExpression="ComplaintMatter" />
<asp:BoundField DataField="AreaOfOffence"
HeaderText="AreaOfOffence" SortExpression="AreaOfOffence" />
<asp:BoundField DataField="Message"
HeaderText="Message" SortExpression="Message" />
<asp:BoundField DataField="Date"
HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="EmailId"
HeaderText="EmailId" SortExpression="EmailId" />
<asp:BoundField DataField="RegId"
HeaderText="RegId" SortExpression="RegId" />
<asp:BoundField DataField="History"
HeaderText="History" SortExpression="History" />
<asp:BoundField DataField="Status"
HeaderText="Status" SortExpression="Status" />
<asp:TemplateField HeaderText="Attachment"
SortExpression="Attachment">
<ItemTemplate>
<a href="../<%# Eval("Attachment")
%>">Click Here</a>
</ItemTemplate>
</asp:TemplateField>

103
<asp:BoundField DataField="PoliceStationId"
HeaderText="PoliceStationId" SortExpression="PoliceStationId" />
</Columns>
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099"
/>
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="#FFFFCC" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099"
HorizontalAlign="Center" />
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-
Bold="True" ForeColor="#663399" />
<SortedAscendingCellStyle BackColor="#FEFCEB" />
<SortedAscendingHeaderStyle BackColor="#AF0101" />
<SortedDescendingCellStyle BackColor="#F6F0C0" />
<SortedDescendingHeaderStyle BackColor="#7E0000" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [GeneralComplaint]">
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td class="auto-style19"></td>
</tr>
<tr>
<td style="font-family: Arial, Helvetica, sans-serif;
font-size: large;
background-color:#3366FF;
color:white;
">Cyber Crime Report</td>
</tr>
<tr>
<td class="auto-style19"></td>
</tr>
<tr>
<td class="auto-style19">
<asp:GridView ID="GridView4" runat="server"
AllowPaging="True" AutoGenerateColumns="False" BackColor="White"
BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3"
CellSpacing="1" DataKeyNames="Cyber_id" DataSourceID="SqlDataSource4"
EmptyDataText="NO COMPLAINTS" GridLines="None" PageSize="5" Width="100%">
<Columns>
<asp:BoundField DataField="Info"
HeaderText="Info" SortExpression="Info" />

104
<asp:BoundField DataField="WebUrl"
HeaderText="WebUrl" SortExpression="WebUrl" />
<asp:BoundField DataField="ObserveTime"
HeaderText="ObserveTime" SortExpression="ObserveTime" />
<asp:BoundField DataField="ObserveDate"
HeaderText="ObserveDate" SortExpression="ObserveDate" />
<asp:BoundField DataField="Date"
HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Cyber_id"
HeaderText="Cyber_id" ReadOnly="True" SortExpression="Cyber_id" />
</Columns>
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True"
ForeColor="#E7E7FF" />
<PagerStyle BackColor="#C6C3C6" ForeColor="Black"
HorizontalAlign="Right" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<SelectedRowStyle BackColor="#9471DE" Font-
Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#594B9C" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#33276A" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Cyber_id], [Date], [ObserveDate], [ObserveTime],
[WebUrl], [Info] FROM [CyberCrime] WHERE ([EmailId] = @EmailId)">
<SelectParameters>
<asp:SessionParameter Name="EmailId"
SessionField="EmailId" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>

<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>

105
<tr>
<td>
&nbsp;</td>
</tr>

<tr>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class User_UserHome : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["RegId"] != null && Session["EmailId"] != null &&
Session["LoginStatus"] != null && Session["UserName"] != null)
{
LblUserName.Text = "Welcome , "+
Session["UserName"].ToString();
LblLoginStatus.Text = Session["LoginStatus"].ToString();
UpdateStatus();
}
else
{
Response.Redirect("../HomePage.aspx");
}

}
protected void UpdateStatus()
{
SqlConnection con = new SqlConnection();
con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();

106
cmd.CommandText = "update UserRegistration set
LoginStatus=@LoginStatus where EmailId='" + Session["EmailId"].ToString()
+ "'";
cmd.Parameters.AddWithValue("@LoginStatus", "Last Login At : " +
DateTime.Now.ToString());

cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();

}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Session.Abandon();
Session["EmailId"] = null;
Response.Redirect("../Homepage.aspx");
}
}

ChangePassword.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/User/UserMasterPage.master" AutoEventWireup="true"
CodeFile="ChangePassword.aspx.cs" Inherits="PoliceStation_ChangePassword"
%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<script type="text/javascript">
function fun1(msg) {
alert(msg);
}

</script>
<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">

.auto-style7
{
width: 100%;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;

107
}
.auto-style8
{
width: 142px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style9
{
width: 192px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3"style="font-family: Arial, Helvetica, sans-
serif;
font-size: large;
background-color:#3366FF;
color:white;
" align="center">Change Password</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter New Password</td>
<td>
<asp:TextBox ID="TextBox1" runat="server" Width="150px"
CssClass="form-control" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>

108
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Retype New Passwod</td>
<td>
<asp:TextBox ID="TextBox2" runat="server" Width="150px"
CssClass="form-control" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server" CssClass="btn-
warning" Height="33px" OnClick="Button1_Click" Text="Change Password"
Width="150px" />
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>

109
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class PoliceStation_ChangePassword : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["EmailId"] != null)
{

}
else
{

Response.Redirect("../HomePage.aspx");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text != TextBox2.Text)
{

110
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Please Set Both Values Equal');", true);
return;
}

SqlConnection cn;
SqlCommand cmd;
cn = new SqlConnection();
cn.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;

String s;
s = "UPDATE UserRegistration set UserPassword='" + TextBox1.Text
+ "' where EmailId='" + Session["EmailId"].ToString() + "'";
cn.Open();
cmd = new SqlCommand(s, cn);
cmd.ExecuteNonQuery();
cn.Close();
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Password Successfully Changed');", true);

}
}

CyberCrime.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/User/UserMasterPage.master" AutoEventWireup="true"
CodeFile="CyberCrime.aspx.cs" Inherits="User_CyberCrime" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"
tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.style1
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.style2
{

111
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.newStyle1
{
background-color: #FF9933;
font-size: large;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.style3
{
width: 284px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style7
{
width: 114px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
<table class="style1">
<tr class="newStyle1">
<td class="style2" colspan="3">
&nbsp;&nbsp; Cyber crime report&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</td>
</tr>
<tr>
<td class="style3">
&nbsp; Crime reference number&nbsp;</td>
<td colspan="2">
<asp:TextBox ID="TextBox1" runat="server" ReadOnly="True"
Width="200px" CssClass="form-control"></asp:TextBox>
</td>
</tr>

112
<tr>
<td class="style3">
&nbsp; Observe date&nbsp;</td>
<td colspan="2">
<asp:TextBox ID="TextBox2" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
<cc1:MaskedEditExtender ID="TextBox2_MaskedEditExtender"
runat="server"
Mask="99/99/9999" MaskType="Date"
TargetControlID="TextBox2">
</cc1:MaskedEditExtender>
</td>
</tr>
<tr>
<td class="style3">
&nbsp; Observe time(in 24 hrs format)</td>
<td colspan="2">
<asp:TextBox ID="TextBox3" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
<cc1:MaskedEditExtender ID="TextBox3_MaskedEditExtender"
runat="server"
Mask="99:99" MaskType="Time"
TargetControlID="TextBox3">
</cc1:MaskedEditExtender>
</td>
</tr>
<tr>
<td class="style3">
&nbsp;&nbsp; Web Url</td>
<td class="auto-style7">
<asp:TextBox ID="TextBox4" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox4" ErrorMessage="Invalid
web url"
ValidationExpression="http(s)?://([\w-]+\.)+[\w-
]+(/[\w- ./?%&amp;=]*)?"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="style3">
&nbsp;&nbsp; Information(any)</td>
<td colspan="2">

113
<asp:TextBox ID="TextBox5" runat="server"
TextMode="MultiLine" Width="200px" CssClass="form-
control"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click" Text="Submit" CssClass="btn-success"
Height="32px" Width="80px" />
</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
<asp:Label ID="Label1" runat="server" ForeColor="Green"
Text="Thanks for your compaint, we will contact you
shortly" Visible="False"></asp:Label>
</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>

114
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td colspan="2">
&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;

115
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class User_CyberCrime : System.Web.UI.Page


{
SqlConnection cn;
SqlCommand cmd;
static int cid;
protected void Page_Load(object sender, EventArgs e)
{

if (Session["RegId"] != null && Session["EmailId"] != null &&


Session["LoginStatus"] != null && Session["UserName"] != null)
{

}
else
{
Response.Redirect("../HomePage.aspx");
}

cn = new SqlConnection();
cn.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
if (!IsPostBack)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT NEXT VALUE FOR
[DBO].[CyberCrimeSequence] ";
cmd.Connection = cn;
cn.Open();
cid = int.Parse(cmd.ExecuteScalar().ToString());

cn.Close();
TextBox1.Text = cid.ToString();
}

}
protected void Button1_Click(object sender, EventArgs e)
{
string str = "";

116
if (TextBox5.Text != "")

str = TextBox5.Text;

else
str = "";
String s = null;
string s1;
s = Session["EmailId"].ToString();
s1 = "insert into Cybercrime values(" + TextBox1.Text + ",'" +
DateTime.Now.ToShortDateString() + "','" + TextBox2.Text + "','" +
TextBox3.Text + "','" + TextBox4.Text + "','" + str + "','" + s + "')";
cn.Open();
cmd = new SqlCommand(s1, cn);
cmd.ExecuteNonQuery();
cn.Close();
Label1.Visible = true;
Button1.Enabled = false;
}

GeneralComplaint.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/User/UserMasterPage.master" AutoEventWireup="true"
CodeFile="GeneralComplaint.aspx.cs" Inherits="User_GeneralComplaint" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<script type="text/javascript">
function fun1(msg) {
alert(msg);
}
function fun2(msg) {
window.open(msg, '_new');
}

</script>
<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">

117
.auto-style7
{
width: 100%;
}
.auto-style8
{
width: 311px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style9
{
width: 82px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style10
{
width: 203px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style11
{
width: 308px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;

}
.auto-style12
{
width: 82px;
height: 26px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style13
{
width: 203px;
height: 26px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style14

118
{
width: 308px;
height: 46px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style15
{
height: 26px;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style16
{
width: 82px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 23px;
}
.auto-style17
{
width: 203px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 23px;
}
.auto-style18
{
width: 308px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 23px;
}
.auto-style19
{
height: 23px;
}
.auto-style20
{
width: 82px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 64px;
}
.auto-style21
{

119
width: 203px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 64px;
}
.auto-style22
{
width: 308px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
height: 64px;
}
.auto-style23
{
height: 64px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">

<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8" colspan="4" style="font-family: Arial,
Helvetica, sans-serif;
font-size: large;
background-color:#5cb85c;
color:white;

">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp; General Complain&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
</tr> <tr>
<td class="auto-style9">&nbsp;</td>

120
<td class="auto-style10">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
</tr> <tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">Complaint About Matter</td>
<td class="auto-style11">
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Horizontal" Width="429px">
<asp:ListItem Selected="True">Crime</asp:ListItem>
<asp:ListItem>Law and Order</asp:ListItem>
<asp:ListItem>Law and Order and Crime</asp:ListItem>
</asp:RadioButtonList>
</td>
<td>&nbsp;</td>
</tr> <tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">Area of Offence Happened</td>
<td class="auto-style11">
<asp:TextBox ID="TextBox3" runat="server" CssClass="form-
control"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>

<tr>
<td class="auto-style20"></td>
<td class="auto-style21">Complaint Detail</td>
<td class="auto-style22">
<asp:TextBox ID="TextBox1" runat="server"
TextMode="MultiLine" CssClass="form-control" Height="46px"></asp:TextBox>
</td>
<td class="auto-style23"></td>
</tr>
<tr>
<td class="auto-style12"></td>
<td class="auto-style13">Complaint Date</td>
<td class="auto-style14">
<asp:TextBox ID="TextBox2" runat="server" CssClass="form-
control" ReadOnly="True"></asp:TextBox>
</td>
<td class="auto-style15"></td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>

121
<td class="auto-style10">Select Police Station</td>
<td class="auto-style11">
<asp:DropDownList ID="DropDownList1" runat="server"
AppendDataBoundItems="True" DataSourceID="SqlDataSource1"
DataTextField="PoliceStationName" DataValueField="PoliceStationId"
Height="30px" Width="310px">
<asp:ListItem>----Select-----</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [PoliceStationId], [PoliceStationName] FROM
[PoliceStation]"></asp:SqlDataSource>
</td>
<td style="font-family:'Roboto', Arial, Helvetica, sans-
serif;
font-size: 16px;">&nbsp;(If you want to register complaint at
other station or leave it if you want to register at your nearest police
station)</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">Attachment (Any)</td>
<td class="auto-style11">
<asp:FileUpload ID="FileUpload1" runat="server"
Height="25px" Width="300px" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style16"></td>
<td class="auto-style17"></td>
<td class="auto-style18"></td>
<td class="auto-style19"></td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td class="auto-style11" align="center">
<asp:Button ID="Button1" runat="server" Text="Submit
Complaint" CssClass="btn-success" OnClick="Button1_Click" Height="36px"
/>
</td>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>

122
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class User_GeneralComplaint : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

if (Session["RegId"] != null && Session["EmailId"] != null &&


Session["LoginStatus"] != null && Session["UserName"] != null)
{

}
else
{
Response.Redirect("../HomePage.aspx");
}

TextBox2.Text = DateTime.Now.ToShortDateString();

}
protected void Button1_Click(object sender, EventArgs e)
{
string policestationid,filepath="N/A";
if (TextBox1.Text == string.Empty || TextBox3.Text==string.Empty)
{

ScriptManager.RegisterStartupScript(Page, GetType(), "",


"fun1('Please enter complaint or area of offence happened');", true);
TextBox1.Focus();
return;
}

if (DropDownList1.SelectedIndex == 0)
policestationid = Session["PoliceStationId"].ToString();
else

123
policestationid = DropDownList1.SelectedItem.Value;

SqlConnection con = new SqlConnection();


con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT NEXT VALUE FOR
[DBO].[ComplaintSequence] ";
cmd.Connection = con;
con.Open();
int cid= int.Parse(cmd.ExecuteScalar().ToString());

con.Close();

if (FileUpload1.HasFile)
{
filepath= GetFilePath(cid);
}

cmd.CommandText = "insert into GeneralComplaint


values(@id,@cm,@ar,@msg,@dt,@email,@reg,@his,@status,@attach,@polid)";
cmd.Parameters.AddWithValue("@id", cid);
cmd.Parameters.AddWithValue("@cm",
RadioButtonList1.SelectedItem.Value);
cmd.Parameters.AddWithValue("@ar", TextBox3.Text);
cmd.Parameters.AddWithValue("@msg", TextBox1.Text);
cmd.Parameters.AddWithValue("@dt", DateTime.Now);
cmd.Parameters.AddWithValue("@email",
Session["EmailId"].ToString());
cmd.Parameters.AddWithValue("@reg", Session["RegId"].ToString());
cmd.Parameters.AddWithValue("@his", "Application Recieved");
cmd.Parameters.AddWithValue("@status", DateTime.Now.ToString() +
" : Application Received and in process");
cmd.Parameters.AddWithValue("@attach", filepath);
cmd.Parameters.AddWithValue("@polid", policestationid);
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();

string s="fun2('" +"print.aspx?id=" + cid +


"&pid="+policestationid+"');";

124
ScriptManager.RegisterStartupScript(Page, GetType(), "", s, true);

protected string GetFilePath(int f)


{
string loc = Server.MapPath("~/complaintfiles/") + f.ToString() +
"_" + FileUpload1.FileName;
FileUpload1.PostedFile.SaveAs(loc);
return "complaintfiles/" + f.ToString() + "_" +
FileUpload1.FileName;

}
}

listmissingvaluables.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/User/UserMasterPage.master" AutoEventWireup="true"
CodeFile="listmissingvaluables.aspx.cs"
Inherits="PoliceStation_listmissingvaluables" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.auto-style7
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
</style>
<script type ="text/javascript">

function fun2()
{

window.open('listmissingvaluablesdetails.aspx', '_new');
}

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

125
<table class="auto-style7">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridView1" runat="server"
AllowPaging="True" AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="Id" DataSourceID="SqlDataSource1" ForeColor="#333333"
GridLines="None" Width="100%">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Date"
HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Month"
HeaderText="Month" SortExpression="Month" />
<asp:BoundField DataField="Year"
HeaderText="Year" SortExpression="Year" />
<asp:BoundField DataField="Name"
HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Minute"
HeaderText="Minute" SortExpression="Minute" />
<asp:BoundField DataField="Hour"
HeaderText="Hour" SortExpression="Hour" />
<asp:BoundField DataField="Type"
HeaderText="Type" SortExpression="Type" />
<asp:BoundField DataField="Address"
HeaderText="Address" SortExpression="Address" />
<asp:BoundField DataField="Area"
HeaderText="Area" SortExpression="Area" />
<asp:BoundField DataField="EmailId"
HeaderText="EmailId" SortExpression="EmailId" />
<asp:BoundField DataField="Status"
HeaderText="Status" SortExpression="Status" />
<asp:BoundField DataField="DateOfComplaint"
HeaderText="DateOfComplaint" SortExpression="DateOfComplaint" />
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333"
HorizontalAlign="Center" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />

126
<SelectedRowStyle BackColor="#FFCC66" Font-
Bold="True" ForeColor="Navy" />
<SortedAscendingCellStyle BackColor="#FDF5AC" />
<SortedAscendingHeaderStyle BackColor="#4D0000" />
<SortedDescendingCellStyle BackColor="#FCF6C0" />
<SortedDescendingHeaderStyle BackColor="#820000" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Id], [Date], [Month], [Year], [Name], [Minute],
[Hour], [Type], [Address], [Area], [EmailId], [Status], [DateOfComplaint]
FROM [MissingMaster] WHERE ([EmailId] = @EmailId) ORDER BY
[DateOfComplaint] DESC">
<SelectParameters>
<asp:SessionParameter Name="EmailId"
SessionField="EmailID" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td align="center">
&nbsp;</td>
</tr>
<tr>
<td align="center">
<asp:Button ID="Button1" runat="server" Text="Go For
Details" Height="34px" Width="130px" CssClass="btn-success"
OnClick="Button1_Click" OnClientClick="fun2();" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

127
listmissingvaluablesdetails.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/User/UserMasterPage.master" AutoEventWireup="true"
CodeFile="listmissingvaluablesdetails.aspx.cs"
Inherits="PoliceStation_listmissingvaluablesdetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.style1
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.style2
{
width: 39px;
}
.style3
{
}
.style4
{
width: 596px;
}
.style5
{
width: 200px;
}
.style6
{
width: 39px;
height: 24px;
}
.style7
{
width: 200px;
height: 24px;
}
.style8
{
width: 596px;

128
height: 24px;
}
.style9
{
height: 24px;
}
.auto-style7
{
width: 228px;
}
.auto-style8
{
width: 228px;
height: 24px;
}
.auto-style9
{
width: 39px;
height: 38px;
}
.auto-style10
{
width: 200px;
height: 38px;
}
.auto-style11
{
width: 228px;
height: 38px;
}
.auto-style12
{
height: 38px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="style1">
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>

129
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">
</td>
<td class="auto-style10">
Enter missing Id</td>
<td class="auto-style11">
<asp:TextBox ID="Txtmid" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
</td>
<td class="auto-style12">
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click"
style="height: 26px" Text="Show" CssClass="btn-
success" Height="32px" Width="80px" />
</td>
<td class="auto-style12">
<asp:Label ID="Label9" runat="server"></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server"
ControlToValidate="Txtmid" ErrorMessage="*(Please
Enter the value)"></asp:RequiredFieldValidator>
</td>
<td class="auto-style12">
</td>
<td class="auto-style12">
</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
Person</td>
<td class="auto-style7">
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
<td>
&nbsp;</td>

130
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
Date</td>
<td class="auto-style7">
<asp:Label ID="Label2" runat="server"></asp:Label>
&nbsp;<asp:Label ID="Label5" runat="server"></asp:Label>
&nbsp;
<asp:Label ID="Label6" runat="server"></asp:Label>
</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
Time</td>
<td class="auto-style7">
<asp:Label ID="Label3" runat="server"></asp:Label>
&nbsp;
<asp:Label ID="Label7" runat="server"></asp:Label>
&nbsp;
<asp:Label ID="Label8" runat="server"></asp:Label>
</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>

131
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
Address</td>
<td class="auto-style7">
<asp:Label ID="Label4" runat="server"></asp:Label>
</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
User Email ID</td>
<td class="auto-style8">
<asp:Label ID="Label10" runat="server"></asp:Label>
</td>
<td class="style9">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
Status</td>
<td class="auto-style8">
<asp:TextBox ID="TextBox1" runat="server" Width="200px"
CssClass="form-control" Height="69px" TextMode="MultiLine"></asp:TextBox>
</td>
<td class="style9">

132
</td>
<td class="style9">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
<strong>Details</strong></td>
<td class="auto-style8">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3" colspan="2" rowspan="5">
<asp:GridView ID="GridView1" runat="server" Width="488px"
>
</asp:GridView>
</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>

133
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>

134
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>

135
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

136
using System.Data;
public partial class PoliceStation_listmissingvaluablesdetails :
System.Web.UI.Page
{
SqlConnection cn;
SqlCommand cmd;
SqlDataReader rd;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["RegId"] != null && Session["EmailId"] != null &&
Session["LoginStatus"] != null && Session["UserName"] != null)
{

}
else
{
Response.Redirect("../HomePage.aspx");
}

cn = new SqlConnection();
cn.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;

}
protected void Button1_Click(object sender, EventArgs e)
{
String s;
s="Select * from Missingmaster where id ="+Txtmid.Text+"and
EmailId='"+Session["EmailId"].ToString()+"'";

cn.Open();
cmd=new SqlCommand(s,cn);
rd=cmd.ExecuteReader();
if(rd.Read())
{

Label2.Text=rd[1].ToString();
Label5.Text=rd[2].ToString();
Label6.Text=rd[3].ToString();
Label1.Text = rd[4].ToString();
Label3.Text = rd[5].ToString();
Label7.Text=rd[6].ToString();
Label8.Text=rd[7].ToString();
Label4.Text = rd[8].ToString();
Label10.Text=rd[10].ToString();

137
TextBox1.Text=rd["Status"].ToString();
TextBox1.ReadOnly = true;
}
else
{
Label9.Text="Record not found";
cn.Close();
return;

}
rd.Close();
cmd = new SqlCommand ( "Select * from Missingdetails where
id="+Txtmid.Text,cn);
SqlDataAdapter ap = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
ap.Fill(ds, "ff");
GridView1.DataSource = ds.Tables["ff"];
GridView1.DataBind();

cn.Close();
}

MissingPerson.aspx

<%@ Page Title="" Language="C#"


MasterPageFile="~/User/UserMasterPage.master" AutoEventWireup="true"
CodeFile="MissingPerson.aspx.cs" Inherits="User_MissingPerson" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<style type="text/css">
.style1
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;

}
.style2
{
width: 157px;
}
.style3

138
{
width: 279px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
<table class="style1">
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2" rowspan="5">
<asp:ImageButton ID="ImageButton1" runat="server"
Height="157px"
ImageUrl="~/imgs/mp2.jpg" Width="152px" />
</td>
<td class="style3">
Missing Person Id</td>
<td>
<asp:TextBox ID="TxtMPid" runat="server"
ReadOnly="True"></asp:TextBox>
&nbsp;<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtMPid"
ErrorMessage="*(Please Enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style3">
Name</td>
<td>
<asp:TextBox ID="Txtname"
runat="server"></asp:TextBox>
&nbsp;<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server" ControlToValidate="Txtname"

139
ErrorMessage="*(Please enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style3">
Missing date</td>
<td>
<asp:DropDownList ID="DDLmdate" runat="server"
Height="16px">
</asp:DropDownList>
&nbsp;<asp:DropDownList ID="DDLmmonth" runat="server">
</asp:DropDownList>
&nbsp;<asp:DropDownList ID="DDLmyear" runat="server">
</asp:DropDownList>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style3">
Missing Time</td>
<td>
<asp:DropDownList ID="DDLhour"
runat="server">
</asp:DropDownList>
&nbsp;<asp:DropDownList ID="DDLminute"
runat="server">
</asp:DropDownList>
&nbsp;<asp:DropDownList ID="DDLtype"
runat="server">
<asp:ListItem>am</asp:ListItem>
<asp:ListItem>pm</asp:ListItem>
</asp:DropDownList>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style3">
Date Of Birth</td>
<td>
<asp:DropDownList ID="DDLdate" runat="server">
</asp:DropDownList>

140
&nbsp;<asp:DropDownList ID="DDLmonth" runat="server">
</asp:DropDownList>
&nbsp;<asp:DropDownList ID="DDLyear" runat="server">
</asp:DropDownList>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
Address</td>
<td>
<asp:TextBox ID="Txtadd"
runat="server"></asp:TextBox>
&nbsp;<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server" ControlToValidate="Txtadd"
ErrorMessage="*(Please enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
if reward</td>
<td>
<asp:TextBox ID="Txtrew" runat="server"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
Missing Area</td>
<td>
<asp:TextBox ID="Txtmarea"
runat="server"></asp:TextBox>
&nbsp;<asp:RequiredFieldValidator
ID="RequiredFieldValidator4" runat="server" ControlToValidate="Txtmarea"

141
ErrorMessage="*(Please enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
Contact No</td>
<td>
<asp:TextBox ID="Txtconno"
runat="server"></asp:TextBox>
&nbsp;<asp:RequiredFieldValidator
ID="RequiredFieldValidator5" runat="server" ControlToValidate="Txtconno"
ErrorMessage="*(Please enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
Contact Person</td>
<td>
<asp:TextBox ID="Txtconper"
runat="server"></asp:TextBox>
&nbsp;<asp:RequiredFieldValidator
ID="RequiredFieldValidator6" runat="server" ControlToValidate="Txtconper"
ErrorMessage="*(Please enter the value
)"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
Missing Person photo</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td>

142
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
&nbsp;
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click" Text="save"
Width="79px" />
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
&nbsp;</td>
<td>

143
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
</table>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class User_MissingPerson : System.Web.UI.Page
{
SqlConnection cn;
SqlCommand cmd;
static int cid;
protected void Page_Load(object sender, EventArgs e)
{

if (Session["RegId"] != null && Session["EmailId"] != null &&


Session["LoginStatus"] != null && Session["UserName"] != null)
{

}
else
{
Response.Redirect("../HomePage.aspx");
}

144
cn = new SqlConnection();
cn.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
if (!IsPostBack)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT NEXT VALUE FOR
[DBO].[MissingPersonSeq] ";
cmd.Connection = cn;
cn.Open();
cid = int.Parse(cmd.ExecuteScalar().ToString());

cn.Close();
TxtMPid.Text = cid.ToString();
for (int i = 1; i <= 31; i++)
DDLmdate.Items.Add(i.ToString());

for (int i = 1; i <= 12; i++)


DDLmmonth.Items.Add(i.ToString());

for (int i = 1980; i <= 2020; i++)


DDLmyear.Items.Add(i.ToString());

for (int i = 1; i <= 12; i++)


DDLhour.Items.Add(i.ToString());

for (int i = 0; i <= 59; i++)


DDLminute.Items.Add(i.ToString());

for (int i = 1; i <= 31; i++)


DDLdate.Items.Add(i.ToString());

for (int i = 1; i <= 12; i++)


DDLmonth.Items.Add(i.ToString());

for (int i = 1980; i <= 2020; i++)


DDLyear.Items.Add(i.ToString());
}

145
protected void Button1_Click(object sender, EventArgs e)
{
string loc = "";
if (FileUpload1.HasFile)
{
loc=Server.MapPath("~/MPphoto/")+
TxtMPid.Text+"_"+FileUpload1.FileName;
FileUpload1.PostedFile.SaveAs(loc);
loc="~/MPphoto/"+ TxtMPid.Text+"_"+FileUpload1.FileName;

}
String s;
s = "insert into MissingPerson values(" + TxtMPid.Text + ",'" +
Txtname.Text + "'," + DDLmdate.Text + "," + DDLmmonth.Text + "," +
DDLmyear.Text + "," + DDLhour.Text + "," + DDLminute.Text + ",'" +
DDLtype.Text + "'," + DDLdate.Text + "," + DDLmonth.Text + "," +
DDLyear.Text + ",'" + Txtadd.Text + "'," + Txtrew.Text + ",'" +
Txtmarea.Text + "'," + Txtconno.Text + ",'" + Txtconper.Text + "','" +
loc + "')";
// Label1.Text = s;
cn.Open();
cmd = new SqlCommand(s, cn);
cmd.ExecuteNonQuery();
cn.Close();

}
}

MissingValuables.aspx

<%@ Page Title="" Language="C#"


MasterPageFile="~/User/UserMasterPage.master" AutoEventWireup="true"
CodeFile="MissingValuable.aspx.cs" Inherits="User_MissingValuable" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.auto-style7
{
width: 114px;
}

</style>
<script type="text/javascript">
function fun1(msg) {

146
alert(msg);
}

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />

<table class="style1" style="font-family:'Roboto', Arial, Helvetica,


sans-serif;
font-size: 16px;width:100%">
<tr>
<td class="auto-style7" rowspan="4">
<asp:Image ID="Image1" runat="server" Height="102px"
ImageUrl="~/imgs/mv2.bmp"
Width="98px" />
</td>
<td class="style3">
&nbsp;</td>
<td>
&nbsp;&nbsp;
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Missing Valuables Date</td>
<td>
<asp:DropDownList ID="DDLmvdate" runat="server">
</asp:DropDownList>
&nbsp;
<asp:DropDownList ID="DDLmvmonth" runat="server">
</asp:DropDownList>
&nbsp;
<asp:DropDownList ID="DDLmvyear" runat="server">
</asp:DropDownList>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style3">
Person Name</td>

147
<td>
<asp:TextBox ID="Txtpname" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
&nbsp;&nbsp;
<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
runat="server"
ControlToValidate="Txtpname" ErrorMessage="*(Please
Enter the value)" ValidationGroup="v"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style3">
Missing valuable Time</td>
<td>
<asp:DropDownList ID="DDLmvhour" runat="server">
</asp:DropDownList>
&nbsp;
<asp:DropDownList ID="DDLmvminute" runat="server">
</asp:DropDownList>
&nbsp;
<asp:DropDownList ID="DDLmvtype" runat="server">
<asp:ListItem>am</asp:ListItem>
<asp:ListItem>pm</asp:ListItem>
</asp:DropDownList>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
Address</td>
<td>
<asp:TextBox ID="Txtadd" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
&nbsp;&nbsp;
<asp:RequiredFieldValidator ID="RequiredFieldValidator3"
runat="server"
ControlToValidate="Txtadd" ErrorMessage="*(Please
Enter the value)" ValidationGroup="v"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>

148
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
Area</td>
<td>
<asp:TextBox ID="Txtarea" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
Phone no</td>
<td>
<asp:TextBox ID="txtpho" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3" style="font-family: Arial, Helvetica,
sans-serif;
font-size: large;
background-color:#3366FF;
color:white;
" colspan="2">
Missing Valuable Detail</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
Missing things</td>
<td>
<asp:TextBox ID="Txtmthings" runat="server"
CssClass="form-control" Width="200px"></asp:TextBox>

149
&nbsp;&nbsp;
<asp:RequiredFieldValidator ID="RequiredFieldValidator4"
runat="server"
ControlToValidate="Txtmthings" ErrorMessage="*(Please
Enter the value)" ValidationGroup="v1"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
Cost</td>
<td>
<asp:TextBox ID="Txtcost" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
&nbsp;&nbsp;
<asp:RequiredFieldValidator ID="RequiredFieldValidator5"
runat="server"
ControlToValidate="Txtcost" ErrorMessage="*(Please
Enter the value)" ValidationGroup="v1"></asp:RequiredFieldValidator>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click" Text="Add" ValidationGroup="v1" CssClass="btn-
primary" Height="32px" Width="70px" />
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>

150
<asp:GridView ID="GridView1" runat="server" BackColor="White"
BorderColor="#CC9966"
BorderStyle="None" BorderWidth="1px" CellPadding="4"
Width="307px">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<RowStyle BackColor="White" ForeColor="#330099" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True"
ForeColor="#663399" />
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="#FFFFCC" />
</asp:GridView>
</td>
<td>
&nbsp;</td>
</tr>

<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">Select Police Station</td>
<td class="auto-style11">
<asp:DropDownList ID="DropDownList1" runat="server"
AppendDataBoundItems="True" DataSourceID="SqlDataSource1"
DataTextField="PoliceStationName" DataValueField="PoliceStationId"
Height="30px" Width="310px">
<asp:ListItem>----Select-----</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [PoliceStationId], [PoliceStationName] FROM
[PoliceStation]"></asp:SqlDataSource>
</td>
<td style="font-family:'Roboto', Arial, Helvetica, sans-
serif;
font-size: 16px;">&nbsp;(If you want to register complaint at
other station or leave it if you want to register at your nearest police
station)</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
&nbsp;</td>

151
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
<asp:Button ID="Button2" runat="server" onclick="Button2_Click"
Text="Submit" ValidationGroup="v" CssClass="btn-success" Height="32px"
Width="80px" />
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style7">
&nbsp;</td>
<td class="style3">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
</table>
<p>

</p>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

152
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class User_MissingValuable : System.Web.UI.Page
{
SqlConnection cn;
SqlCommand cmd;
static int cid;
protected void Page_Load(object sender, EventArgs e)
{
cn = new SqlConnection();
cn.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;

try
{
if (Session["RegId"] != null && Session["EmailId"] != null &&
Session["LoginStatus"] != null && Session["UserName"] != null)
{
Txtpname.Text = Session["UserName"].ToString();
Txtadd.Text = Session["UserAddress"].ToString();
}
else
{
Response.Redirect("../Homepage.aspx");
}
}
catch
{
Response.Redirect("../Homepage.aspx");
}

if (!IsPostBack)
{
for (int i = 1; i <= 31; i++)
DDLmvdate.Items.Add(i.ToString());

for (int i = 1; i <= 12; i++)

153
DDLmvmonth.Items.Add(i.ToString());

for (int i = 1990; i <= 2020; i++)


DDLmvyear.Items.Add(i.ToString());

for (int i = 1; i <= 12; i++)


DDLmvhour.Items.Add(i.ToString());

for (int i = 00; i <= 59; i++)


DDLmvminute.Items.Add(i.ToString());

SqlCommand cmd = new SqlCommand();


cmd.CommandText = "SELECT NEXT VALUE FOR
[DBO].[MissingDetailsSeq] ";
cmd.Connection = cn;
cn.Open();
cid = int.Parse(cmd.ExecuteScalar().ToString());

cn.Close();

}
}
protected void Button2_Click(object sender, EventArgs e)
{
string policestationid;
if (DropDownList1.SelectedIndex == 0)
policestationid = Session["PoliceStationId"].ToString();
else
policestationid = DropDownList1.SelectedItem.Value;
String s;
s = "insert into Missingmaster values(" + cid + "," +
DDLmvdate.Text + "," + DDLmvmonth.Text + "," + DDLmvyear.Text + ",'" +
Txtpname.Text + "'," + DDLmvhour.Text + "," + DDLmvminute.Text + ",'" +
DDLmvtype.Text + "','" + Txtadd.Text + "','" + Txtarea.Text + "','" +
Session["EmailId"].ToString() + "','Application Recieved','" +
DateTime.Now + "','"+policestationid+"')";
cn.Open();
cmd = new SqlCommand(s, cn);
cmd.ExecuteNonQuery();
cn.Close();
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Message Recieved');", true);
Button2.Enabled = false;
Button1.Enabled = false;

154
}
protected void Button1_Click(object sender, EventArgs e)
{
String s;
s = "insert into Missingdetails values(" + cid + ",'" +
Txtmthings.Text + "'," + Txtcost.Text + ")";
cn.Open();
cmd = new SqlCommand(s, cn);
cmd.ExecuteNonQuery();
Txtmthings.Text = "";
Txtcost.Text = "";
Txtmthings.Focus();
cmd = new SqlCommand("select things,cost from missingdetails
where id = " + cid, cn);
SqlDataAdapter ap = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
ap.Fill(ds, "ff");
GridView1.DataSource = ds.Tables["ff"];
GridView1.DataBind();

cn.Close();

}
}

Print.aspx Page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Print.aspx.cs"


Inherits="User_Print" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
</style>
</head>

155
<body>
<form id="form1" runat="server">
<div style="height: 467px">

<table class="auto-style1">
<tr>
<td align="center">E - Police&nbsp; System (Online FIR
Submission)<br />
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td align="right">
<asp:LinkButton ID="LinkButton1"
OnClientClick="JavaScript:print();" runat="server">Print</asp:LinkButton>
&nbsp;</td>
</tr>
<tr>
<td>To,</td>
</tr>
<tr>
<td>Mr./Mrs.&nbsp;
<asp:Label ID="LblChowkiInchargeName"
runat="server"></asp:Label>
,</td>
</tr>
<tr>
<td>
<asp:Label ID="LblPoliceStationName"
runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="LblAddress" runat="server"
Height="50px"></asp:Label>
,</td>
</tr>
<tr>
<td>
<asp:Label ID="LblContactNo"
runat="server"></asp:Label>
</td>
</tr>
<tr>

156
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:Label ID="LblComplaintNo" runat="server" Font-
Size="Large" Font-Underline="True"></asp:Label>
</td>
</tr>
<tr>
<td>Sir/Ma&#39;am,</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:Label ID="LblMessage" runat="server"
Height="100px"></asp:Label>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>From,</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:Label ID="LblUserName"
runat="server"></asp:Label>
,</td>
</tr>
<tr>
<td>
<asp:Label ID="LblUserAddress"
runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>

157
<asp:Label ID="LblUserContact"
runat="server"></asp:Label>
</td>
</tr>
</table>

</div>
</form>
</body>
</html>
C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class User_Print : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["id"] != null &&
Request.QueryString["pid"] != null)
{
SqlConnection con = new SqlConnection();
con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select Message from GeneralComplaint where
ComplaintId=" + Request.QueryString["id"].ToString() + "";
cmd.Connection = con;
con.Open();
SqlDataReader r = cmd.ExecuteReader();
r.Read();
LblMessage.Text = r["Message"].ToString();
con.Close();

cmd.CommandText = "select
ChowkiInchargeName,PoliceStationName,Address,ContactNo from PoliceStation
where PoliceStationId='" + Request.QueryString["pid"].ToString() + "'";
cmd.Connection = con;

158
con.Open();
SqlDataReader r1 = cmd.ExecuteReader();

r1.Read();
LblChowkiInchargeName.Text =
r1["ChowkiInchargeName"].ToString();
LblPoliceStationName.Text =
r1["PoliceStationName"].ToString();
LblAddress.Text = r1["Address"].ToString();
LblContactNo.Text = r1["ContactNo"].ToString();
con.Close();

LblComplaintNo.Text ="Complaint Number : "+


Request.QueryString["id"].ToString();
LblUserName.Text = Session["UserName"].ToString();
LblUserAddress.Text = Session["UserAddress"].ToString();
LblUserContact.Text = Session["EmailId"].ToString();
Label1.Text = DateTime.Now.ToString();
}
else
{
Response.Redirect("UserHome.aspx");
}
}
}

PoliceStation/Default.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/PoliceStation/PoliceMasterPage.master"
AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="PoliceStation_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.auto-style7
{
width: 100%;
}
.auto-style8
{
height: 23px;
}
.auto-style9
{

159
width: 149px;
}
.auto-style10
{
height: 23px;
width: 149px;
}
.auto-style11
{
width: 229px;
}
.auto-style12
{
height: 23px;
width: 229px;
}
.auto-style13
{
width: 149px;
height: 22px;
}
.auto-style14
{
width: 229px;
height: 22px;
}
.auto-style15
{
height: 22px;
}
</style>
<script type="text/javascript">
function fun1(msg) {
alert(msg);
}

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7" style="font-family:'Roboto', Arial,
Helvetica, sans-serif;
font-size: 16px;">
<tr>
<td class="auto-style9">&nbsp;</td>

160
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style10"></td>
<td class="auto-style12">Enter Your Police Station ID</td>
<td class="auto-style8">
<asp:TextBox ID="TextBox1" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td class="auto-style8"></td>
</tr>
<tr>
<td class="auto-style10"></td>
<td class="auto-style12">Enter Your Password</td>
<td class="auto-style8">
<asp:TextBox ID="TextBox2" runat="server" Width="200px"
CssClass="form-control" TextMode="Password"></asp:TextBox>
</td>
<td class="auto-style8"></td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style13"></td>
<td class="auto-style14"></td>
<td class="auto-style15">
<asp:Button ID="Button1" runat="server" Height="32px"
Text="Submit" Width="80px" CssClass="btn-success" OnClick="Button1_Click"
/>
</td>
<td class="auto-style15"></td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>

161
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

162
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class PoliceStation_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from PoliceStation where
PoliceStationId='" + TextBox1.Text + "'";

cmd.Connection = con;
con.Open();

SqlDataReader r = cmd.ExecuteReader();

if (r.Read())
{
if (TextBox2.Text == r["Password"].ToString())
{

163
Session["_PoliceStationId"] =
r["PoliceStationId"].ToString();
con.Close();
Response.Redirect("ListComplaints.aspx");
}
else
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Invalid Password');", true);

}
else
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('No Such email id / password');", true);

}
}
}

PoliceStation/ListComplaints.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/PoliceStation/PoliceMasterPage.master"
AutoEventWireup="true" CodeFile="listcomplaints.aspx.cs"
Inherits="PoliceStation_listcomplaints" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.auto-style7
{
width: 100%;
}

.auto-style8
{
height: 23px;
}

164
</style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">
<tr>
<td class="auto-style8"></td>
</tr>
<tr>
<td align="right">
<asp:LinkButton ID="LinkButton1" runat="server" Font-
Size="Large" OnClick="LinkButton1_Click">Logout</asp:LinkButton>
</td>
</tr>
</table>
<br />

<table class="auto-style7">
<tr>
<br />
<td>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="100%">
<Columns>
<asp:BoundField DataField="PoliceStationId"
HeaderText="PoliceStationId" SortExpression="PoliceStationId" />
<asp:BoundField DataField="PoliceStationName"
HeaderText="PoliceStationName" SortExpression="PoliceStationName" />
<asp:BoundField DataField="District"
HeaderText="District" SortExpression="District" />
<asp:BoundField DataField="PoliceStationArea"
HeaderText="PoliceStationArea" SortExpression="PoliceStationArea" />
<asp:BoundField DataField="ChowkiInchargeName"
HeaderText="ChowkiInchargeName" SortExpression="ChowkiInchargeName" />
<asp:BoundField DataField="ContactNo"
HeaderText="ContactNo" SortExpression="ContactNo" />
<asp:BoundField DataField="Address"
HeaderText="Address" SortExpression="Address" />
<asp:BoundField DataField="EmailId"
HeaderText="EmailId" SortExpression="EmailId" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [PoliceStationId], [PoliceStationName], [District],

165
[PoliceStationArea], [ChowkiInchargeName], [ContactNo], [Address],
[EmailId] FROM [PoliceStation] WHERE ([PoliceStationId] =
@PoliceStationId)">
<SelectParameters>
<asp:SessionParameter Name="PoliceStationId"
SessionField="_PoliceStationId" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
<table class="auto-style7">
<tr>
<td class="auto-style8" colspan="4" style="font-family:
Arial, Helvetica, sans-serif;
font-size: large;
background-color:#3366FF;
color:white;
" align="center"> General Complaints&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridView2" runat="server"
AllowPaging="True" AutoGenerateColumns="False" BackColor="White"
BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
CellPadding="4" DataKeyNames="ComplaintId" DataSourceID="SqlDataSource2"
Width="100%">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="ComplaintId"
HeaderText="ComplaintId" ReadOnly="True" SortExpression="ComplaintId" />
<asp:BoundField DataField="ComplaintMatter"
HeaderText="ComplaintMatter" SortExpression="ComplaintMatter" />
<asp:BoundField DataField="AreaOfOffence"
HeaderText="AreaOfOffence" SortExpression="AreaOfOffence" />
<asp:BoundField DataField="Message"
HeaderText="Message" SortExpression="Message" />
<asp:BoundField DataField="Date"
HeaderText="Date" SortExpression="Date" />

166
<asp:BoundField DataField="EmailId"
HeaderText="EmailId" SortExpression="EmailId" />
<asp:BoundField DataField="RegId"
HeaderText="RegId" SortExpression="RegId" />
<asp:BoundField DataField="History"
HeaderText="History" SortExpression="History" />
<asp:BoundField DataField="Status"
HeaderText="Status" SortExpression="Status" />
<asp:TemplateField HeaderText="Attachment"
SortExpression="Attachment">
<ItemTemplate>
<a href='../<%# Eval("Attachment")
%>'>Click Here</a>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="PoliceStationId"
HeaderText="PoliceStationId" SortExpression="PoliceStationId" />
<asp:HyperLinkField HeaderText="User Details"
NavigateUrl="~/PoliceStation/userdetails.aspx" Text="Get User Details" />
</Columns>
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099"
/>
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="#FFFFCC" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099"
HorizontalAlign="Center" />
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-
Bold="True" ForeColor="#663399" />
<SortedAscendingCellStyle BackColor="#FEFCEB" />
<SortedAscendingHeaderStyle BackColor="#AF0101" />
<SortedDescendingCellStyle BackColor="#F6F0C0" />
<SortedDescendingHeaderStyle BackColor="#7E0000" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [ComplaintId], [ComplaintMatter], [AreaOfOffence],
[Message], [Date], [EmailId], [RegId], [History], [Status], [Attachment],
[PoliceStationId] FROM [GeneralComplaint] WHERE ([PoliceStationId] =
@PoliceStationId) ORDER BY [Date] DESC" UpdateCommand="UPDATE
[GeneralComplaint] SET [History]=@History, [Status]=@Status WHERE
[ComplaintId]=@ComplaintId">
<SelectParameters>
<asp:SessionParameter Name="PoliceStationId"
SessionField="_PoliceStationId" Type="String" />
</SelectParameters>

167
<UpdateParameters>
<asp:Parameter Name="History" />
<asp:Parameter Name="Status" />
<asp:Parameter Name="ComplaintId" />
</UpdateParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>

C# Code

public partial class PoliceStation_listcomplaints : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["_PoliceStationId"] != null)
{

}
else
{

Response.Redirect("Default.aspx");
}
}
protected void LinkButton1_Click(object sender, EventArgs e)

168
{
Session.Abandon();
Session["_PoliceStation"] = null;
Response.Redirect("../Homepage.aspx");

}
}

PoliceStation/ListMissingPerson.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/PoliceStation/PoliceMasterPage.master"
AutoEventWireup="true" CodeFile="listmissingperson.aspx.cs"
Inherits="PoliceStation_listmissingperson" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="style1">
<tr>
<td>
&nbsp;</td>
<td class="style2" rowspan="20">
&nbsp;&nbsp;
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False"
BackColor="White" BorderColor="#CC9966"
BorderStyle="None" BorderWidth="1px"
CellPadding="4" DataSourceID="SqlDataSource1"
Width="100%"
>
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099"
/>
<RowStyle BackColor="White" ForeColor="#330099" />
<Columns>
<asp:BoundField DataField="MP_id"
HeaderText="MP_id" SortExpression="MP_id" />
<asp:BoundField DataField="Name"
HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="mDate"
HeaderText="mDate" SortExpression="mDate" />
<asp:BoundField DataField="mMonth"
HeaderText="mMonth"
SortExpression="mMonth" />

169
<asp:BoundField DataField="mYear"
HeaderText="mYear" SortExpression="mYear" />
<asp:BoundField DataField="Hour"
HeaderText="Hour" SortExpression="Hour" />
<asp:BoundField DataField="minute"
HeaderText="minute"
SortExpression="minute" />
<asp:BoundField DataField="Type"
HeaderText="Type" SortExpression="Type" />
<asp:BoundField DataField="Date"
HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Month"
HeaderText="Month" SortExpression="Month" />
<asp:BoundField DataField="Year"
HeaderText="Year" SortExpression="Year" />
<asp:BoundField DataField="Address"
HeaderText="Address"
SortExpression="Address" />
<asp:BoundField DataField="ifReward"
HeaderText="ifReward"
SortExpression="ifReward" />
<asp:BoundField DataField="marea"
HeaderText="marea" SortExpression="marea" />
<asp:BoundField DataField="Contactno"
HeaderText="Contactno"
SortExpression="Contactno" />
<asp:BoundField DataField="Contactperson"
HeaderText="Contactperson"
SortExpression="Contactperson" />
<asp:TemplateField HeaderText="Photo"
SortExpression="Photo">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Bind("Photo") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Image ID="Image1" runat="server"
Height="93px" ImageUrl='<%# Bind("Photo") %>' Width="93px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-
Bold="True" ForeColor="#663399" />

170
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="#FFFFCC" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM
[MissingPerson]"></asp:SqlDataSource>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

171
<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
<tr>

<td>
&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

PoliceStation/ listmissingvaluables.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/PoliceStation/PoliceMasterPage.master"

172
AutoEventWireup="true" CodeFile="listmissingvaluables.aspx.cs"
Inherits="PoliceStation_listmissingvaluables" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.auto-style7
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
</style>
<script type ="text/javascript">

function fun2()
{

window.open('listmissingvaluablesdetails.aspx', '_new');
}

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridView1" runat="server"
AllowPaging="True" AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="Id" DataSourceID="SqlDataSource1" ForeColor="#333333"
GridLines="None" Width="100%">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Date"
HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Month"
HeaderText="Month" SortExpression="Month" />
<asp:BoundField DataField="Year"
HeaderText="Year" SortExpression="Year" />

173
<asp:BoundField DataField="Name"
HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Minute"
HeaderText="Minute" SortExpression="Minute" />
<asp:BoundField DataField="Hour"
HeaderText="Hour" SortExpression="Hour" />
<asp:BoundField DataField="Type"
HeaderText="Type" SortExpression="Type" />
<asp:BoundField DataField="Address"
HeaderText="Address" SortExpression="Address" />
<asp:BoundField DataField="Area"
HeaderText="Area" SortExpression="Area" />
<asp:BoundField DataField="EmailId"
HeaderText="EmailId" SortExpression="EmailId" />
<asp:BoundField DataField="Status"
HeaderText="Status" SortExpression="Status" />
<asp:BoundField DataField="DateOfComplaint"
HeaderText="DateOfComplaint" SortExpression="DateOfComplaint" />
</Columns>
<EditRowStyle BackColor="#7C6F57" />
<FooterStyle BackColor="#1C5E55" Font-Bold="True"
ForeColor="White" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True"
ForeColor="White" />
<PagerStyle BackColor="#666666" ForeColor="White"
HorizontalAlign="Center" />
<RowStyle BackColor="#E3EAEB" />
<SelectedRowStyle BackColor="#C5BBAF" Font-
Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F8FAFA" />
<SortedAscendingHeaderStyle BackColor="#246B61" />
<SortedDescendingCellStyle BackColor="#D4DFE1" />
<SortedDescendingHeaderStyle BackColor="#15524A" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Id], [Date], [Month], [Year], [Name], [Minute],
[Hour], [Type], [Address], [Area], [EmailId], [Status], [DateOfComplaint]
FROM [MissingMaster] WHERE ([PoliceStationId] = @PoliceStationId) ORDER
BY [DateOfComplaint] DESC">
<SelectParameters>
<asp:SessionParameter Name="PoliceStationId"
SessionField="_PoliceStationId" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>

174
</tr>
<tr>
<td align="center">
&nbsp;</td>
</tr>
<tr>
<td align="center">
<asp:Button ID="Button1" runat="server" Text="Go For
Details" Height="34px" Width="130px" CssClass="btn-success"
OnClick="Button1_Click" OnClientClick="fun2();" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

PoliceStation/listmissingvaluablesdetails.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/PoliceStation/PoliceMasterPage.master"
AutoEventWireup="true" CodeFile="listmissingvaluablesdetails.aspx.cs"
Inherits="PoliceStation_listmissingvaluablesdetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.style1
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.style2

175
{
width: 39px;
}
.style3
{
}
.style4
{
width: 596px;
}
.style5
{
width: 200px;
}
.style6
{
width: 39px;
height: 24px;
}
.style7
{
width: 200px;
height: 24px;
}
.style8
{
width: 596px;
height: 24px;
}
.style9
{
height: 24px;
}
.auto-style7
{
width: 228px;
}
.auto-style8
{
width: 228px;
height: 24px;
}
.auto-style9
{
width: 39px;
height: 38px;

176
}
.auto-style10
{
width: 200px;
height: 38px;
}
.auto-style11
{
width: 228px;
height: 38px;
}
.auto-style12
{
height: 38px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="style1">
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">
</td>
<td class="auto-style10">
Enter missing Id</td>
<td class="auto-style11">
<asp:TextBox ID="Txtmid" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
</td>
<td class="auto-style12">

177
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click"
style="height: 26px" Text="Show" CssClass="btn-
success" Height="32px" Width="80px" />
</td>
<td class="auto-style12">
<asp:Label ID="Label9" runat="server"></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server"
ControlToValidate="Txtmid" ErrorMessage="*(Please
Enter the value)"></asp:RequiredFieldValidator>
</td>
<td class="auto-style12">
</td>
<td class="auto-style12">
</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
Person</td>
<td class="auto-style7">
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
Date</td>
<td class="auto-style7">
<asp:Label ID="Label2" runat="server"></asp:Label>
&nbsp;<asp:Label ID="Label5" runat="server"></asp:Label>
&nbsp;
<asp:Label ID="Label6" runat="server"></asp:Label>
</td>
<td>

178
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
Time</td>
<td class="auto-style7">
<asp:Label ID="Label3" runat="server"></asp:Label>
&nbsp;
<asp:Label ID="Label7" runat="server"></asp:Label>
&nbsp;
<asp:Label ID="Label8" runat="server"></asp:Label>
</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
Address</td>
<td class="auto-style7">
<asp:Label ID="Label4" runat="server"></asp:Label>
</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>

179
<tr>
<td class="style6">
</td>
<td class="style7">
User Email ID</td>
<td class="auto-style8">
<asp:Label ID="Label10" runat="server"></asp:Label>
</td>
<td class="style9">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
Status</td>
<td class="auto-style8">
<asp:TextBox ID="TextBox1" runat="server" Width="200px"
CssClass="form-control" Height="69px" TextMode="MultiLine"></asp:TextBox>
</td>
<td class="style9">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
<td class="style9">
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
<strong>Details</strong></td>
<td class="auto-style8">
</td>
<td class="style9">
</td>
<td class="style9">
</td>

180
<td class="style9">
</td>
<td class="style9">
</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style3" colspan="2" rowspan="5">
<asp:GridView ID="GridView1" runat="server" Width="488px"
>
</asp:GridView>
</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>

181
<tr>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">

182
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
<asp:Button ID="Button2" runat="server" CssClass="btn-
success" Height="32px" OnClick="Button2_Click" Text="Update"
Width="100px" />
</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>

183
<td class="style2">
&nbsp;</td>
<td class="style5">
&nbsp;</td>
<td class="auto-style7">
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class PoliceStation_listmissingvaluablesdetails :
System.Web.UI.Page
{
SqlConnection cn;
SqlCommand cmd;
SqlDataReader rd;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["_PoliceStationId"] != null)
{

}
else
{

184
Response.Redirect("Default.aspx");
}
cn = new SqlConnection();
cn.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;

}
protected void Button1_Click(object sender, EventArgs e)
{
String s;
s="Select * from Missingmaster where id ="+Txtmid.Text+"and
PoliceStationId='"+Session["_PoliceStationId"].ToString()+"'";

cn.Open();
cmd=new SqlCommand(s,cn);
rd=cmd.ExecuteReader();
if(rd.Read())
{

Label2.Text=rd[1].ToString();
Label5.Text=rd[2].ToString();
Label6.Text=rd[3].ToString();
Label1.Text = rd[4].ToString();
Label3.Text = rd[5].ToString();
Label7.Text=rd[6].ToString();
Label8.Text=rd[7].ToString();
Label4.Text = rd[8].ToString();
Label10.Text=rd[10].ToString();
TextBox1.Text=rd["Status"].ToString();
}
else
{
Label9.Text="Record not found";
cn.Close();
return;

}
rd.Close();
cmd = new SqlCommand ( "Select * from Missingdetails where
id="+Txtmid.Text,cn);
SqlDataAdapter ap = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
ap.Fill(ds, "ff");
GridView1.DataSource = ds.Tables["ff"];
GridView1.DataBind();

185
cn.Close();
}
protected void Button2_Click(object sender, EventArgs e)
{
String s;
s = "UPDATE Missingmaster set Status='"+TextBox1.Text+"'where id
=" + Txtmid.Text + "and PoliceStationId='" +
Session["_PoliceStationId"].ToString() + "'";

cn.Open();
cmd = new SqlCommand(s, cn);
cmd.ExecuteNonQuery();
cn.Close();
}
}

PoliceStation/ListMostWanted.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/PoliceStation/PoliceMasterPage.master"
AutoEventWireup="true" CodeFile="listmostwanted.aspx.cs"
Inherits="PoliceStation_listmostwanted" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.auto-style7
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
<table class="auto-style7">

<tr>
<td class="auto-style8" colspan="4" style="font-family:
Arial, Helvetica, sans-serif;
font-size: large;
background-color:#3366FF;
color:white;

186
" align="center">Most Wanted Criminal Details</td>

</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" EmptyDataText="No Records" BackColor="White"
BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px"
CellPadding="4" ShowFooter="True" Width="100%"
DataSourceID="SqlDataSource1" ShowHeaderWhenEmpty="True">
<Columns>
<asp:TemplateField HeaderText="Criminal ID">
<FooterTemplate>
<asp:Button ID="Button1" runat="server"
Text="Add" OnClick="Add" CssClass="btn-primary" Height="32px"
Width="80px" />
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("CriminalId") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Criminal Name">
<FooterTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Height="25px" Width="150px" CssClass="form-control"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server"
Text='<%# Eval("CriminalName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Age">
<FooterTemplate>
<asp:TextBox ID="TextBox4"
runat="server"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server"
Text='<%# Eval("Age") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Crime Type">

187
<FooterTemplate>
<asp:TextBox ID="TextBox5"
runat="server"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server"
Text='<%# Eval("CrimeType") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Birth Mark">
<FooterTemplate>
<asp:TextBox ID="TextBox6"
runat="server"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label7" runat="server"
Text='<%# Eval("BirthMark") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sex">
<FooterTemplate>
<asp:RadioButtonList
ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</asp:RadioButtonList>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label8" runat="server"
Text='<%# Eval("Sex") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Crime Details">
<FooterTemplate>
<asp:TextBox ID="TextBox2" runat="server"
CssClass="form-control" Height="31px" TextMode="MultiLine"
Width="150px"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server"
Text='<%# Eval("CrimeDetails") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Reward">
<FooterTemplate>

188
<asp:TextBox ID="TextBox3" runat="server"
CssClass="form-control" Width="150px"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server"
Text='<%# Eval("Reward") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Photo">
<FooterTemplate>
<asp:FileUpload ID="FileUpload1"
runat="server" />
</FooterTemplate>
<ItemTemplate>
<asp:Image ID="Image1" runat="server"
Height="85px" ImageUrl='<%# Eval("photo") %>' Width="85px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField></asp:TemplateField>
</Columns>
<FooterStyle BackColor="#99CCCC" ForeColor="#003399"
/>
<HeaderStyle BackColor="#003399" Font-Bold="True"
ForeColor="#CCCCFF" />
<PagerStyle BackColor="#99CCCC" ForeColor="#003399"
HorizontalAlign="Left" />
<RowStyle BackColor="White" ForeColor="#003399" />
<SelectedRowStyle BackColor="#009999" Font-
Bold="True" ForeColor="#CCFF99" />
<SortedAscendingCellStyle BackColor="#EDF6F6" />
<SortedAscendingHeaderStyle BackColor="#0D4AC4" />
<SortedDescendingCellStyle BackColor="#D6DFDF" />
<SortedDescendingHeaderStyle BackColor="#002876" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="delete from Mostwanted where CriminalId=@CriminalId"
SelectCommand="SELECT [CriminalId],[Age],[CrimeType],[BirthMark],[Sex],
[CrimeDetails], [CriminalName], [Reward], [Photo] FROM [MostWanted]"
UpdateCommand="UPDATE MostWanted SET CriminalName = @CriminalName,
CrimeDetails = @CrimeDetails, Reward = @Reward, Photo = @Photo where
CriminalId=@CriminalId">
<DeleteParameters>
<asp:Parameter Name="CriminalId" />
</DeleteParameters>
<UpdateParameters>

189
<asp:Parameter Name="CriminalName" />
<asp:Parameter Name="CrimeDetails" />
<asp:Parameter Name="Reward" />
<asp:Parameter Name="Photo" />
<asp:Parameter Name="CriminalId" />
</UpdateParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

190
public partial class PoliceStation_listmostwanted : System.Web.UI.Page
{
SqlConnection cn;
SqlCommand cmd;
SqlDataReader rd;
static int cid;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["_PoliceStationId"] != null)
{

}
else
{

Response.Redirect("Default.aspx");
}
cn = new SqlConnection();
cn.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
if (!IsPostBack)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT NEXT VALUE FOR [DBO].[CriminalSeq]
";
cmd.Connection = cn;
cn.Open();
cid = int.Parse(cmd.ExecuteScalar().ToString());

cn.Close();

}
}

protected void Add(object sender, EventArgs e)


{
Control control = null;
if (GridView1.FooterRow != null)
{
control = GridView1.FooterRow;
}
else
{
control = GridView1.Controls[0].Controls[0];
}

191
string Name = (control.FindControl("TextBox1") as TextBox).Text;
string CrimeDetails = (control.FindControl("TextBox2") as
TextBox).Text;
int age = int.Parse((control.FindControl("TextBox3") as
TextBox).Text);
string crimeType = (control.FindControl("TextBox5") as
TextBox).Text;
string BirthMark = (control.FindControl("TextBox6") as
TextBox).Text;
string gen = (control.FindControl("RadioButtonList1") as
RadioButtonList).SelectedItem.Value;
string Rewards = (control.FindControl("TextBox3") as
TextBox).Text;
FileUpload upload = (control.FindControl("FileUpload1") as
FileUpload);
if (!upload.HasFile)
{
return;
}
string loc = Server.MapPath("~/MWPhoto/") + cid.ToString() + "_"
+ upload.FileName;
upload.PostedFile.SaveAs(loc);

loc = "~/MWPhoto/" + cid.ToString() + "_" + upload.FileName;


cmd = new SqlCommand();
cmd.Connection = cn;

cmd.CommandText = "INSERT INTO [MostWanted] VALUES("+cid+",


'"+Name+"',"+age+",'"+crimeType+"','"+BirthMark+"','"+gen+"','"+CrimeDeta
ils+"', "+Rewards+",'"+loc+"')";

cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
SqlDataSource1.DataBind();
GridView1.DataBind();
}

PoliceStation/Report.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/PoliceStation/PoliceMasterPage.master"
AutoEventWireup="true" CodeFile="Report.aspx.cs"
Inherits="PoliceStation_Report" %>

192
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"
tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">

.auto-style7
{
width: 100%;
}
.newStyle1
{
font-family: Arial, Helvetica, sans-serif;
font-size: large;
background-color: #0066FF;
color:white
}
.auto-style8
{
width: 222px;
}
.auto-style9
{
width: 114px;
}
.auto-style11
{
width: 92px;
}
.auto-style13
{
width: 91px;
}
.auto-style16
{
width: 206px;
}
.auto-style17
{
width: 60px;
height: 45px;
}
.auto-style18
{

193
width: 222px;
height: 45px;
}
.auto-style19
{
width: 114px;
height: 45px;
}
.auto-style20
{
width: 92px;
height: 45px;
}
.auto-style21
{
width: 206px;
height: 45px;
}
.auto-style22
{
width: 91px;
height: 45px;
}
.auto-style23
{
height: 45px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
<table class="auto-style7">
<tr class="newStyle1">
<td align="center">Reports</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:Panel ID="Panel2" runat="server" BorderColor="Black"
BorderStyle="Solid" Height="100px">
<table class="auto-style7" style="font-family:'Roboto',
Arial, Helvetica, sans-serif;
font-size: 16px;">

194
<tr>
<td
class="auto-style8">&nbsp;</td>
<td
class="auto-style9">&nbsp;</td>
<td
class="auto-style11">&nbsp;</td>
<td
class="auto-style16">
&nbsp;</td>
<td class="auto-style13">&nbsp;</td>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td class="auto-style18">&nbsp;&nbsp; Select Type
of Report</td>
<td class="auto-style19">
<asp:DropDownList ID="DropDownList1"
runat="server" Height="30px" Width="200px">
<asp:ListItem>---Select----
</asp:ListItem>
<asp:ListItem>General
Complaints</asp:ListItem>
<asp:ListItem>Missing
person</asp:ListItem>
<asp:ListItem>Missing
Valuables</asp:ListItem>
<asp:ListItem>Most Wanted</asp:ListItem>
</asp:DropDownList>
</td>
<td class="auto-style20">&nbsp;</td>
<td class="auto-style21">
<asp:Button ID="Button1" runat="server"
CssClass="btn-success" Height="32px" OnClick="Button1_Click" Text="Go"
Width="50px" />
</td>
<td class="auto-style22">
&nbsp;</td>
<td class="auto-style17">
&nbsp;</td>
<td class="auto-style18">
&nbsp;</td>
<td class="auto-style23">
&nbsp;</td>
</tr>

</table>
</asp:Panel>
</td>
</tr>

195
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [ComplaintId], [Message], [Date], [EmailId],
[RegId], [History], [Status] FROM [GeneralComplaint] WHERE
([PoliceStationId] = @PoliceStationId)">
<SelectParameters>
<asp:SessionParameter Name="PoliceStationId"
SessionField="_PoliceStationId" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td align="center">
<asp:LinkButton ID="LinkButton1" runat="server"
OnClientClick="JavaScript:print()" Visible="False">Print</asp:LinkButton>
&nbsp;|
<asp:LinkButton ID="LinkButton2" runat="server"
OnClick="LinkButton2_Click" Visible="False">Export to
Excel</asp:LinkButton>
</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridView1" runat="server" BackColor="White"
BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
CellPadding="4" Width="100%">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="#FFFFCC" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099"
HorizontalAlign="Center" />
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True"
ForeColor="#663399" />
<SortedAscendingCellStyle BackColor="#FEFCEB" />
<SortedAscendingHeaderStyle BackColor="#AF0101" />
<SortedDescendingCellStyle BackColor="#F6F0C0" />
<SortedDescendingHeaderStyle BackColor="#7E0000" />
</asp:GridView>
</td>

196
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data;
using System.Drawing;

197
using System.Data.SqlClient;
using System.Configuration;

public partial class PoliceStation_Report : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["_PoliceStationId"] != null)
{

}
else
{

Response.Redirect("Default.aspx");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (DropDownList1.SelectedIndex == 1)
{

GridView1.DataSource = SqlDataSource1;
GridView1.DataBind();
if (GridView1.Rows.Count >= 1)
{
LinkButton1.Visible = true;
LinkButton2.Visible = true;
}

}
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
if (DropDownList1.SelectedIndex == 1)
{
ExportToExcel(GridView1);
}
}
protected void ExportToExcel(GridView GrdView)
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition",
"attachment;filename=GridViewExport.xls");
Response.Charset = "";

198
Response.ContentType = "application/vnd.ms-excel";
using (StringWriter sw = new StringWriter())
{
HtmlTextWriter hw = new HtmlTextWriter(sw);

//To Export all pages


GrdView.AllowPaging = false;
GrdView.HeaderRow.BackColor = Color.White;
foreach (TableCell cell in GrdView.HeaderRow.Cells)
{
cell.BackColor = GrdView.HeaderStyle.BackColor;
}
foreach (GridViewRow row in GridView1.Rows)
{
row.BackColor = Color.White;
foreach (TableCell cell in row.Cells)
{
if (row.RowIndex % 2 == 0)
{
cell.BackColor =
GrdView.AlternatingRowStyle.BackColor;
}
else
{
cell.BackColor = GrdView.RowStyle.BackColor;
}
cell.CssClass = "textmode";
}
}

GridView1.RenderControl(hw);

//style to format numbers to string


string style = @"<style> .textmode { } </style>";
Response.Write(style);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();

}
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}

199
}

PoliceStation/userdetails.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/PoliceStation/PoliceMasterPage.master"
AutoEventWireup="true" CodeFile="userdetails.aspx.cs"
Inherits="PoliceStation_userdetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">

.auto-style7
{
width: 100%;
}
.auto-style8
{
height: 23px;
}
.auto-style9
{
width: 278px;
height: 39px;
}
.auto-style10
{
width: 248px;
height: 39px;
}
.auto-style11
{
height: 39px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
<table class="auto-style7">
<tr>
<td align="center" style=" font-family:'Roboto', Arial,
Helvetica, sans-serif;

200
font-size: 16px;background-color:#3366FF;
color:white;" colspan="3">&nbsp; User Details</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td style=" font-family:'Roboto', Arial, Helvetica, sans-
serif;
font-size: 16px;" class="auto-
style9">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Enter EmailID of the
User&nbsp;&nbsp;&nbsp;
&nbsp;
</td>
<td style=" font-family:'Roboto', Arial, Helvetica, sans-
serif;
font-size: 16px;" class="auto-style10"><asp:TextBox
ID="TextBox1" runat="server" Width="200px" CssClass="form-control"
Height="22px"></asp:TextBox>
</td>
<td style=" font-family:'Roboto', Arial, Helvetica, sans-
serif;
font-size: 16px;" class="auto-style11">
<asp:Button ID="Button1" runat="server" Text="Sumbit"
CssClass="btn-primary" Height="32px" Width="80px" OnClick="Button1_Click"
/>
</td>
</tr>
<tr>
<td class="auto-style8" colspan="3"></td>
</tr>
<tr>
<td colspan="3" align="center" style=" font-family:'Roboto',
Arial, Helvetica, sans-serif;">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [RegId], [EmailId], [UserName], [Gender],
[Address], [District], [PoliceStationId], [DocumentNo], [IDProof],
[ContactNo], [Pincode], [Qualification], [AADHARNo] FROM
[UserRegistration] WHERE ([EmailId] = @EmailId)">
<SelectParameters>
<asp:ControlParameter ControlID="TextBox1"
DefaultValue="000" Name="EmailId" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>

201
<asp:Button ID="Button2" runat="server" CssClass="btn-
primary" OnClick="Button2_Click" Text="Export To Excel" Visible="False"
/>
<br />
<br />
<asp:GridView ID="GridView1" runat="server"
DataSourceID="SqlDataSource1" Width="100%">
</asp:GridView>
</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>

202
<tr>
<td colspan="3">&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Drawing;
using System.IO;
public partial class PoliceStation_userdetails : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
Button2.Visible = true;
}
protected void ExportToExcel(GridView GrdView)
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition",
"attachment;filename=GridViewExport.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
using (StringWriter sw = new StringWriter())
{
HtmlTextWriter hw = new HtmlTextWriter(sw);

//To Export all pages


GrdView.AllowPaging = false;
GrdView.HeaderRow.BackColor = Color.White;
foreach (TableCell cell in GrdView.HeaderRow.Cells)

203
{
cell.BackColor = GrdView.HeaderStyle.BackColor;
}
foreach (GridViewRow row in GridView1.Rows)
{
row.BackColor = Color.White;
foreach (TableCell cell in row.Cells)
{
if (row.RowIndex % 2 == 0)
{
cell.BackColor =
GrdView.AlternatingRowStyle.BackColor;
}
else
{
cell.BackColor = GrdView.RowStyle.BackColor;
}
cell.CssClass = "textmode";
}
}

GridView1.RenderControl(hw);

//style to format numbers to string


string style = @"<style> .textmode { } </style>";
Response.Write(style);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();

}
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}
protected void Button2_Click(object sender, EventArgs e)
{
ExportToExcel(GridView1);
}
}

PoliceStation/ChangePassword.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/PoliceStation/PoliceMasterPage.master"

204
AutoEventWireup="true" CodeFile="ChangePassword.aspx.cs"
Inherits="PoliceStation_ChangePassword" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<script type="text/javascript">
function fun1(msg) {
alert(msg);
}

</script>
<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">

.auto-style7
{
width: 100%;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style8
{
width: 142px;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style9
{
width: 192px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3"style="font-family: Arial, Helvetica, sans-
serif;
font-size: large;
background-color:#3366FF;
color:white;

205
" align="center">Change Password</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter New Password</td>
<td>
<asp:TextBox ID="TextBox1" runat="server" Width="150px"
CssClass="form-control" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Retype New Passwod</td>
<td>
<asp:TextBox ID="TextBox2" runat="server" Width="150px"
CssClass="form-control" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server" CssClass="btn-
warning" Height="33px" OnClick="Button1_Click" Text="Change Password"
Width="150px" />
</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>

206
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

207
using System.Data.SqlClient;
public partial class PoliceStation_ChangePassword : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["_PoliceStationId"] != null)
{

}
else
{

Response.Redirect("Default.aspx");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text != TextBox2.Text)
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Please Set Both Values Equal');", true);
return;
}

SqlConnection cn;
SqlCommand cmd;
cn = new SqlConnection();
cn.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;

String s;
s = "UPDATE PoliceStation set Password='" + TextBox1.Text + "'
where PoliceStationId='" + Session["_PoliceStationId"].ToString() + "'";
cn.Open();
cmd = new SqlCommand(s, cn);
cmd.ExecuteNonQuery();
cn.Close();
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Password Successfully Changed');", true);

}
}

208
Admin/AdminMasterPage.Master Page

<%@ Master Language="C#" AutoEventWireup="true"


CodeFile="AdminMasterPage.master.cs" Inherits="User_UserMasterPage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script type="text/javascript">
function display_c() {
var refresh = 1000; // Refresh rate in milli seconds
mytime = setTimeout('display_ct()', refresh)
}

function display_ct() {
var strcount
var x = new Date()
document.getElementById('Panel1').innerHTML = x;
tt = display_c();
}
</script>
<title>E - Police : Online Crime Reporting System </title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">

.button-main {
background-color: #183883;
float: left;
height: 50px;
width: 100%;
margin:0px auto;
margin-top: 10px;
border-top-width: 1px;
border-bottom-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-top-color: #0f2459;
border-bottom-color: #0f2459;
}
.btn {

209
height: 50px;
width: 1033px;
margin:0px auto;
}

.btn ul
{
padding:0px;
margin:0px auto;
margin-top:8px;
}

.btn li{
display: inline;
margin: 0px auto;
text-align: center;
border-right: 1px solid #214aa9;
float:left;
}

.btn a {
font-family: Roboto;
font-size: 18px;
color: #FFF;
text-decoration: none;
border: 1px solid #183883;
border-radius:3px;
font-weight:500;
display:block;
border-right: 1px solid #112960;
padding:0px 25px;
line-height:35px;
}

.btn a:hover {
border: 1px solid #FFF;
}
.btn .active {
border: 1px solid #FFF;
}

.auto-style1
{

210
width: 100%;
height: 150px;
}
.auto-style2
{
width: 132px;
height: 150px;
}
.auto-style3
{
width: 88px;
}

.auto-style5
{
width: 773px;
}

.auto-style6
{
width: 275px;
height: 76px;
}
.footer-main {
background-color: #143584;
float: left;
width: 100%;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #FFF;
}

</style>
</head>
<body onload=display_ct();>

<form id="form1" runat="server">


<div style="height: 153px">

<table class="auto-style1">
<tr>

211
<td class="auto-style3">
<img class="auto-style2" src="../imgs/4.bmp"
/></td>
<td class="auto-style5"
background="../imgs/header_bckg.jpg">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="#" style="color:#FFFFFF; text-
decoration:none; text-align:center ;font-weight:bold; height:36px; font-
size:26px; text-transform:uppercase;">Our Mission - City Without
Crime</a>

</td>

<td>
<img class="auto-style6" src="../imgs/control-
room-im.jpg" /><br />
<br />
<asp:Panel ID="Panel1" runat="server" Font-
Names="Microsoft Sans Serif" Font-Size="Large" style="margin-left: 9px">
</asp:Panel>
</td>

</tr>
</table>

</div>

<div class="button-main">
<div class="btn">
<ul>
<li><a class="" href="Home.aspx" data-flexmenu="flexmenu1"
stylez="position:relative;left:900px;top:200px">CONTACT DETAILS</a></li>
<li><a class="" href="listcybercrime.aspx" data-
flexmenu="flexmenu3"
stylez="position:relative;left:900px;top:200px">CYBER CRIME</a></li>
<li><a class="" href="PoliceStation.aspx" data-
flexmenu="flexmenu4"
stylez="position:relative;left:900px;top:200px">POLICE STATION </a></li>

<li><a class="" href="newsflash.aspx" data-flexmenu="flexmenu4"


stylez="position:relative;left:900px;top:200px">NEWS </a></li>

212
<li><a href="changepassword.aspx" data-flexmenu="flexmenu6"
stylez="position:relative;left:900px;top:200px">CHANGEPASSWORD</a></li>

</div>

</div>

<br />
<br />
<br />
<div>

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">


</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>

</div>

</form>
<div class="footer-main">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>

</td>
<td align="right" style="color:white;"> &copy;
&nbsp;</td>
</tr>
</tbody></table>
<table style="color:white" >
<tr><td>
Best viewed in 1024*768 pixel resolution.<br />
256 bit Secured Socket Server (SSL)<br />
Digital Certification<br />
Secured Login Page

</td></tr>

</table>
</div>
</body>
</html>

Admin/addpolicestation.aspx page

213
<%@ Page Title="" Language="C#"
MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true"
CodeFile="Addnewpolicestation.aspx.cs"
Inherits="Admin_Addnewpolicestation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<script type="text/javascript">
function fun1(msg) {
alert(msg);
}

</script>
<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.newStyle1
{
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style7
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
.auto-style8
{
width: 62px;
}
.auto-style9
{
width: 253px;
}
.auto-style10
{
width: 240px;
}
.auto-style11
{
width: 62px;
height: 38px;
}
.auto-style12
{
width: 253px;

214
height: 38px;
}
.auto-style13
{
width: 240px;
height: 38px;
}
.auto-style14
{
height: 38px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">Add New Police Station</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter Police Station ID</td>
<td class="auto-style10">
<asp:TextBox ID="TextBox1" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter Police Station Password</td>

215
<td class="auto-style10">
<asp:TextBox ID="TextBox2" runat="server" Width="200px"
CssClass="form-control" TextMode="Password"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter Police Station Name</td>
<td class="auto-style10">
<asp:TextBox ID="TextBox3" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style11"></td>
<td class="auto-style12">Enter Police Station Area</td>
<td class="auto-style13">
<asp:TextBox ID="TextBox4" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td class="auto-style14"></td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter District</td>
<td class="auto-style10">
<asp:TextBox ID="TextBox5" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter Chowki Inhcharge Name</td>
<td class="auto-style10">
<asp:TextBox ID="TextBox6" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter Address</td>
<td class="auto-style10">

216
<asp:TextBox ID="TextBox7" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter Contact Number</td>
<td class="auto-style10">
<asp:TextBox ID="TextBox8" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">Enter Email Id</td>
<td class="auto-style10">
<asp:TextBox ID="TextBox9" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">
<asp:Button ID="Button1" runat="server" CssClass="btn-
success" Height="32px" Text="Submit" Width="80px" OnClick="Button1_Click"
/>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

217
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style8">&nbsp;</td>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style10">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class Admin_Addnewpolicestation : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["AdminId"] == null)
Response.Redirect("Default.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con=new SqlConnection();
con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "insert into PoliceStation
values(@a,@b,@c,@d,@e,@f,@g,@h,@i)";
cmd.Parameters.AddWithValue("@a", TextBox1.Text);
cmd.Parameters.AddWithValue("@b", TextBox2.Text);
cmd.Parameters.AddWithValue("@c", TextBox3.Text);
cmd.Parameters.AddWithValue("@d", TextBox4.Text);

218
cmd.Parameters.AddWithValue("@e", TextBox5.Text);
cmd.Parameters.AddWithValue("@f", TextBox6.Text);
cmd.Parameters.AddWithValue("@g", TextBox7.Text);
cmd.Parameters.AddWithValue("@h", TextBox8.Text);
cmd.Parameters.AddWithValue("@i", TextBox9.Text);
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Record Added');", true);

}
}

Admin/Default.aspx

<%@ Page Title="" Language="C#"


MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="PoliceStation_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">

.auto-style7
{
width: 100%;
}
.auto-style8
{
height: 23px;
}
.auto-style9
{
width: 149px;
}
.auto-style10
{
height: 23px;
width: 149px;
}
.auto-style11
{

219
width: 229px;
}
.auto-style12
{
height: 23px;
width: 229px;
}
.auto-style13
{
width: 149px;
height: 22px;
}
.auto-style14
{
width: 229px;
height: 22px;
}
.auto-style15
{
height: 22px;
}
</style>
<script type="text/javascript">
function fun1(msg) {
alert(msg);
}

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7" style="font-family:'Roboto', Arial,
Helvetica, sans-serif;
font-size: 16px;">
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style10"></td>
<td class="auto-style12">Enter Your ID</td>
<td class="auto-style8">

220
<asp:TextBox ID="TextBox1" runat="server" Width="200px"
CssClass="form-control"></asp:TextBox>
</td>
<td class="auto-style8"></td>
</tr>
<tr>
<td class="auto-style10"></td>
<td class="auto-style12">Enter Your Password</td>
<td class="auto-style8">
<asp:TextBox ID="TextBox2" runat="server" Width="200px"
CssClass="form-control" TextMode="Password"></asp:TextBox>
</td>
<td class="auto-style8"></td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style13"></td>
<td class="auto-style14"></td>
<td class="auto-style15">
<asp:Button ID="Button1" runat="server" Height="32px"
Text="Submit" Width="80px" CssClass="btn-success" OnClick="Button1_Click"
/>
</td>
<td class="auto-style15"></td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>

221
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="auto-style9">&nbsp;</td>
<td class="auto-style11">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>

222
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class PoliceStation_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from AdminLogin where AdminId='" +
TextBox1.Text + "'";

cmd.Connection = con;
con.Open();

SqlDataReader r = cmd.ExecuteReader();

if (r.Read())
{
if (TextBox2.Text == r["AdminPassword"].ToString())
{
Session["AdminId"] = r["AdminId"].ToString();
con.Close();
Response.Redirect("Home.aspx");
}
else
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('Invalid Password');", true);

223
}

}
else
{
ScriptManager.RegisterStartupScript(Page, GetType(), "",
"fun1('No Such email id / password');", true);

}
}
}

Admin/Home.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true"
CodeFile="Home.aspx.cs" Inherits="Admin_Home" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<style type="text/css">
.auto-style7
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">
<tr>
<td>Welcome Admin,</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridView1" runat="server"
AllowPaging="True" AutoGenerateColumns="False" BackColor="White"
BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"

224
CellPadding="3" DataKeyNames="Id" DataSourceID="SqlDataSource1"
Width="100%" ForeColor="Black" GridLines="Vertical">
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Name"
HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="ContactNo"
HeaderText="ContactNo" SortExpression="ContactNo" />
<asp:BoundField DataField="Comment"
HeaderText="Comment" SortExpression="Comment" />
<asp:BoundField DataField="FeedbackDate"
HeaderText="FeedbackDate" SortExpression="FeedbackDate" />
<asp:TemplateField HeaderText="EmailAddress"
SortExpression="EmailAddress">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Bind("EmailAddress") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<a href="MailTo:<%# Eval("EmailAddress")
%>"> <asp:Label ID="Label1" runat="server" Text='<%# Bind("EmailAddress")
%>'></asp:Label></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<HeaderStyle BackColor="Black" Font-Bold="True"
ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-
Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#808080" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#383838" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Id], [Name], [ContactNo], [Comment],
[FeedbackDate], [EmailAddress] FROM [Feedback] ORDER BY [FeedbackDate]
DESC"></asp:SqlDataSource>
</td>
</tr>

225
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

Admin/NewsFlash.aspx Page

<%@ Page Title="" Language="C#"


MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true"
CodeFile="newsflash.aspx.cs" Inherits="Admin_newsflash" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


<link href="../StyleSheet1.css" rel="stylesheet" />
<style type="text/css">

.auto-style7
{
width: 100%;
font-family:'Roboto', Arial, Helvetica, sans-serif;
font-size: 16px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC"

226
BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataKeyNames="NewsId" DataSourceID="SqlDataSource1" Width="100%"
AllowPaging="True" AllowSorting="True" ShowFooter="True">
<Columns>
<asp:CommandField ShowDeleteButton="True" />
<asp:TemplateField HeaderText="NewsId"
SortExpression="NewsId">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("NewsId") %>'></asp:Label>
</EditItemTemplate>
<FooterTemplate>
<asp:Button ID="Button1" runat="server"
Height="32px" Text="Add" Width="50px" OnClick="Add" CssClass="btn-
success" />
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Bind("NewsId") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="News"
SortExpression="News">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Bind("News") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="TextBox3" runat="server"
CssClass="form-control" TextMode="MultiLine" Width="200px"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server"
Text='<%# Bind("News") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date"
SortExpression="Date">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server"
Text='<%# Bind("Date") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server"
Text='<%# Bind("Date") %>'></asp:Label>
</ItemTemplate>

227
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#006699" Font-Bold="True"
ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066"
HorizontalAlign="Left" />
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-
Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM NEWS WHERE NewsId=@NewsId"
SelectCommand="SELECT [NewsId], [News], [Date] FROM [News]">
<DeleteParameters>
<asp:Parameter Name="NewsId" />
</DeleteParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

228
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class Admin_newsflash : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["AdminId"] == null)
Response.Redirect("Default.aspx");

}
protected void Add(object sender, EventArgs e)
{
SqlConnection cn;
SqlCommand cmd;
cn = new SqlConnection();
cn.ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionSt
ring"].ConnectionString;
Control control = null;
if (GridView1.FooterRow != null)
{
control = GridView1.FooterRow;
}
else
{
control = GridView1.Controls[0].Controls[0];
}
string NewsData = (control.FindControl("TextBox3") as
TextBox).Text;
cmd = new SqlCommand();
cmd.Connection = cn;

cmd.CommandText = "INSERT INTO [NEWS] VALUES(NEXT VALUE FOR


DBO.NEWSID, '" + NewsData + "','" +DateTime.Now + "')";

cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
SqlDataSource1.DataBind();
GridView1.DataBind();
}
}

229
web.config File

<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application,
please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode"
value="None"/>
</appSettings>
<connectionStrings>
<add name="ConnectionString" connectionString="Data
Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Crime.mdf;Integra
ted Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5"/>
</system.web>
</configuration>

StyleSheet.css File

.btn-info{color:#fff;background-color:#5bc0de;border-
color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-
color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-
color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-
info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-
color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-
info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-
info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-
info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-
toggle.btn-info:hover{color:#fff;background-color:#269abc;border-

230
color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-
toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-
info.disabled:focus,.btn-info.disabled:hover,.btn-
info[disabled].focus,.btn-info[disabled]:focus,.btn-
info[disabled]:hover,fieldset[disabled] .btn-
info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-
info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info
.badge{color:#5bc0de;background-color:#fff}.btn-
warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-
warning.focus,.btn-warning:focus{color:#fff;background-
color:#ec971f;border-color:#985f0d}.btn-
warning:hover{color:#fff;background-color:#ec971f;border-
color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-
toggle.btn-warning{color:#fff;background-color:#ec971f;border-
color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-
warning.active:hover,.btn-warning:active.focus,.btn-
warning:active:focus,.btn-warning:active:hover,.open>.dropdown-
toggle.btn-warning.focus,.open>.dropdown-toggle.btn-
warning:focus,.open>.dropdown-toggle.btn-
warning:hover{color:#fff;background-color:#d58512;border-
color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-
toggle.btn-warning{background-image:none}.btn-
warning.disabled.focus,.btn-warning.disabled:focus,.btn-
warning.disabled:hover,.btn-warning[disabled].focus,.btn-
warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled]
.btn-warning.focus,fieldset[disabled] .btn-
warning:focus,fieldset[disabled] .btn-warning:hover{background-
color:#f0ad4e;border-color:#eea236}.btn-warning
.badge{color:#f0ad4e;background-color:#fff}
.btn-primary{color:#fff;background-color:#337ab7;border-
color:#2e6da4}.btn-primary.focus,.btn-
primary:focus{color:#fff;background-color:#286090;border-
color:#122b40}.btn-primary:hover{color:#fff;background-
color:#286090;border-color:#204d74}.btn-primary.active,.btn-
primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-
color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-
primary.active:focus,.btn-primary.active:hover,.btn-
primary:active.focus,.btn-primary:active:focus,.btn-
primary:active:hover,.open>.dropdown-toggle.btn-
primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-
toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-
color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-
toggle.btn-primary{background-image:none}.btn-
primary.disabled.focus,.btn-primary.disabled:focus,.btn-
primary.disabled:hover,.btn-primary[disabled].focus,.btn-
primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled]

231
.btn-primary.focus,fieldset[disabled] .btn-
primary:focus,fieldset[disabled] .btn-primary:hover{background-
color:#337ab7;border-color:#2e6da4}.btn-primary
.badge{color:#337ab7;background-color:#fff}
.btn-danger{color:#fff;background-color:#d9534f;border-
color:#d43f3a;
height: 32px;
width: 73px;
}.btn-danger.focus,.btn-danger:focus{color:#fff;background-
color:#c9302c;border-color:#761c19}.btn-
danger:hover{color:#fff;background-color:#c9302c;border-
color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-
toggle.btn-danger{color:#fff;background-color:#c9302c;border-
color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-
danger.active:hover,.btn-danger:active.focus,.btn-
danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-
danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-
toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-
color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-
toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-
danger.disabled:focus,.btn-danger.disabled:hover,.btn-
danger[disabled].focus,.btn-danger[disabled]:focus,.btn-
danger[disabled]:hover,fieldset[disabled] .btn-
danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled]
.btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-
danger .badge{color:#d9534f;background-color:#fff}
.btn-success{color:#fff;background-color:#5cb85c;border-
color:#4cae4c}.btn-success.focus,.btn-
success:focus{color:#fff;background-color:#449d44;border-
color:#255625}.btn-success:hover{color:#fff;background-
color:#449d44;border-color:#398439}.btn-success.active,.btn-
success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-
color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-
success.active:focus,.btn-success.active:hover,.btn-
success:active.focus,.btn-success:active:focus,.btn-
success:active:hover,.open>.dropdown-toggle.btn-
success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-
toggle.btn-success:hover{color:#fff;background-color:#398439;border-
color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-
toggle.btn-success{background-image:none}.btn-
success.disabled.focus,.btn-success.disabled:focus,.btn-
success.disabled:hover,.btn-success[disabled].focus,.btn-
success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled]
.btn-success.focus,fieldset[disabled] .btn-
success:focus,fieldset[disabled] .btn-success:hover{background-

232
color:#5cb85c;border-color:#4cae4c}.btn-success
.badge{color:#5cb85c;background-color:#fff}

.form-control{display:block;width:100%;height:20px;
padding:6px 12px;font-size:14px;line-
height:1.42857143;color:#555;background-color:#fff;background-
image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-
shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px
rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-
webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out
.15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out
.15s,box-shadow ease-in-out .15s
}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-
shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-
shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px
rgba(102,175,233,.6)}.form-control::-moz-
placeholder{color:#999;opacity:1}.form-control:-ms-input-
placeholder{color:#999}.form-control::-webkit-input-
placeholder{color:#999}.form-control::-ms-expand{background-
color:transparent;border:0}.form-control[disabled],.form-
control[readonly],fieldset[disabled] .form-control{background-
color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-
control{cursor:not-allowed}

233
TESTING

Testing is the process of finding errors in the software. Testing presents an interesting
anomaly for the software engineer. During earlier software engineering activities, the
engineer attempts to build software from an abstract concept to a successful product.
Now comes testing. The engineer creats a series of test cases that are intended to
“demolish” the software has been built. In fact, testing is the one step in software
process that could be viewed as destructive rather than constructive.

TESTING OBJECTIVES:
 To ensure that during operation the system will perform as per specification.
 To make sure that system meets the user requirements during operation
 To make sure that during the operation, incorrect input, processing and output will
be detected
 To see that when correct inputs are fed to the system the outputs are correct
 To verify that the controls incorporated in the same system as intended
 Testing is a process of executing a program with the intent of finding an error
 A good test case is one that has a high probability of finding an as yet undiscovered
error
The software developed has been tested successfully using the following
testing strategies and any errors that are encountered are corrected and again the part
of the program or the procedure or function is put to testing until all the errors are
removed. A successful test is one that uncovers an as yet undiscovered error. Note that
the result of the system testing will prove that the system is working correctly. It will
give confidence to system designer, users of the system, prevent frustration during
implementation process etc.

234
TYPES OF TESTING:

White box testing


White box testing is a testing case design method that uses the control structure
of the procedure design to derive test cases. All independents path in a module are
exercised at least once, all logical decisions are exercised at once, execute all loops at
boundaries and within their operational bounds exercise internal data structure to
ensure their validity. Here the customer is given three chances to enter a valid choice
out of the given menu. After which the control exits the current menu.

Black Box Testing


Black Box Testing attempts to find errors in following areas or categories,
incorrect or missing functions, interface error, errors in data structures, performance
error and initialization and termination error. Here all the input data must match the
data type to become a valid entry.

LEVELS OF TESTING

The following are the different tests at various levels:

Unit Testing:

Unit testing is essentially for the verification of the code produced during the
coding phase and the goal is test the internal logic of the module/program. In the
Generic code project, the unit testing is done during coding phase of data entry forms
whether the functions are working properly or not. In this phase all the drivers are tested
they are rightly connected or not.

235
Integration Testing:

All the tested modules are combined into sub systems, which are then tested. The
goal is to see if the modules are properly integrated, and the emphasis being on the
testing interfaces between the modules. In the generic code integration testing is done
mainly on table creation module and insertion module.

Validation Testing

This testing concentrates on confirming that the software is error-free in all


respects. All the specified validations are verified and the software is subjected to hard-
core testing. It also aims at determining the degree of deviation that exists in the
software designed from the specification; they are listed out and are corrected.

System Testing
This testing is a series of different tests whose primary is to fully exercise the
computer-based system. This involves:

 Implementing the system in a simulated production environment and testing it.


 Introducing errors and testing for error handling.
Implementation of Testing Schedule

Testing is done at different levels such as,

 Low Level:

This is done by same developer.

 Medium Level:

This is done by same developer.

 High Level:

This is done by independentbody(Guide).

236
SECURITY MECHANISMS

The protection of computer based resources that includes hardware, software,


data, procedures and people against unauthorized use or natural

System Security can be divided into four related issues:

1 Security
2 Integrity
3 Privacy
4 Confidentiality

SYSTEM SECURITY refers to the technical innovations and procedures applied to


the hardware and operation systems to protect against deliberate or accidental damage
from a defined threat.

DATA SECURITY is the protection of data from loss, disclosure, modification and
destruction.

SYSTEM INTEGRITY refers to the power functioning of hardware and programs,


appropriate physical security and safety against external threats such as eavesdropping
and wiretapping.

PRIVACY defines the rights of the user or organizations to determine what


information they are willing to share with or accept from others and how the

237
organization can be protected against unwelcome, unfair or excessive dissemination of
information about it.

CONFIDENTIALITY is a special status given to sensitive information in a database


to minimize the possible invasion of privacy. It is an attribute of information that
characterizes its need for protection.

SECURITY IN SOFTWARE

System security refers to various validations on data in form of checks and controls to
avoid the system from failing. It is always important to ensure that only valid data is
entered and only valid operations are performed on the system. The system employees
two types of checks and controls:

CLIENT SIDE VALIDATION

Various client side validations are used to ensure on the client side that only valid data
is entered. Client side validation saves server time and load to handle invalid data. Some
checks imposed are:

1 JavaScript is used to ensure those required fields are filled with suitable data only.
Maximum lengths of the fields of the forms are appropriately defined.
2 Forms cannot be submitted without filling up the mandatory data so that manual
mistakes of submitting empty fields that are mandatory can be sorted out at the client
side to save the server time and load.
3 Tab-indexes are set according to the need and taking into account the ease of user
while working with the system.

238
SERVER SIDE VALIDATION
Some checks cannot be applied at client side. Server side checks are necessary to save
the system from failing and intimating the user that some invalid operation has been
performed or the performed operation is restricted. Some of the server side checks
imposed is:

1 Server side constraint has been imposed to check for the validity of primary key and
foreign key. A primary key value cannot be duplicated. Any attempt to duplicate the
primary value results into a message intimating the user about those values through
the forms using foreign key can be updated only of the existing foreign key values.
2 User is intimating through appropriate messages about the successful operations or
exceptions occurring at server side.
3 Various Access Control Mechanisms have been built so that one user may not
agitate upon another. Access permissions to various types of users are controlled
according to the organizational structure. Only permitted users can log on to the
system and can have access according to their category. User- name, passwords and
permissions are controlled o the server side.
4 Using server side validation, constraints on several restricted operations are
imposed.

239
IMPLEMENTATION

An important phase in the system life cycle is the successful implementation of


the new system design. Implementation simply means converting a new system
design into operation. This involves creating computer compactible files, training the
operating task, & installing hardware, terminals before the system is up & running.

An important phase in the system life cycle is the successful


implementation of the new system design. Implementation simply means converting a
new system design into operation.This involves creating computer compatible files,
training the operation staff, and installing hardware , terminals before the system is up
and running.

In our project implementation is done in following manner.

 Installation of Software:
First of all , I prepared (Publish) PreCompiledWeb files with the
help of Build Menu .Then these files is copied into httpdocs/wwwroot
folder in IIS Web Server Console with the help of FileZilla Software. On
this Server I also copy Database of all the procesures that are required to
retrives the data from database.Then we start the IIS Server and access
the site.

 Traning The Operating Staff:


All the users are given demonstration after copying all the files.In
this demonstration all the input variables are taken and project is
executed.After this I give them chance to run project by themselves.
 Installation of Hardware:
In my project all the hardware requirements are not fulfilled but esists their
networking between the clients machines already.So the only need is to install proper
hardware for the software.

240
CONCLUSION

It has been a great pleasure for me to work on this exciting and challenging
project. This project proved good for me as it provided practical knowledge of not only
programming in ASP.NET 4.5 and C#.NET4.5 web based application and no some
extent Windows Application and SQL Server 2012, but also about all handling
procedure related with “E – Police : Online Crime Reporting System”. It also
provides knowledge about the latest technology used in developing web enabled
application and client server technology that will be great demand in future. This will
provide better opportunities and guidance in future in developing projects
independently.

BENEFITS:

The project is identified by the merits of the system offered to the user. The merits of
this project are as follows: -

1 It’s a web-enabled project.


2 This project offers user to enter the data through simple and interactive forms. This
is very helpful for the client to enter the desired information through so much
simplicity.
3 The user is mainly more concerned about the validity of the data, whatever he is
entering. There are checks on every stages of any new creation, data entry or
updation so that the user cannot enter the invalid data, which can create problems at
later date.
4 Sometimes the user finds in the later stages of using project that he needs to update
some of the information that he entered earlier. There are options for him by which
he can update the records. Moreover there is restriction for his that he cannot change

241
the primary data field. This keeps the validity of the data to longer extent.
5 User is provided the option of monitoring the records he entered earlier. He can see
the desired records with the variety of options provided by him.
6 From every part of the project the user is provided with the links through framing
so that he can go from one option of the project to other as per the requirement. This
is bound to be simple and very friendly as per the user is concerned. That is, we can
sat that the project is user friendly which is one of the primary concerns of any good
project.
7 Data storage and retrieval will become faster and easier to maintain because data is
stored in a systematic manner and in a single database.
8 Decision making process would be greatly enhanced because of faster processing
of information since data collection from information available on computer takes
much less time then manual system.
9 Allocating of sample results becomes much faster because at a time the user can see
the records of last years.
10Easier and faster data transfer through latest technology associated with the
computer and communication.
11Through these features it will increase the efficiency, accuracy and transparency.

LIMITATIONS:

1 The size of the database increases day-by-day, increasing the load on the database
back up and data maintenance activity.
2 Training for simple computer operations is necessary for the users working on the
system.

242
FUTURE SCOPE OF THE PROJECT

1 This System being web-based and an undertaking of Cyber Security Division,


needs to be thoroughly tested to find out any security gaps.

2 A console for the data centre may be made available to allow the personnel to
monitor on the sites which were cleared for hosting during a particular period.

Moreover, it is just a beginning; further the system may be utilized in various


other types of auditing operation viz. Network auditing or similar process/workflow
based applications.

243
BIBLIOGRAPHY

[1] Online:October,2011]WorldBank’sWebsite,Definition of Egovernment;


http://www.web.worldbank.org › ... › Information &Commun... › e-Government
[2] Ian Sommerville, “Software Engineering”, Seventh Edition, Pearson Education,
Inc., USA, 2008, pp.43-63.

[3] ToshinobuYasuhira, “Fundamental Upgrade of the Internal Network System


within the National Police Agency of Japan”, 43rd Annual 2009 International
Carnahan Conference on Security Technology, 2009.pp.100-106

[4] ASP.NET 4.5 Black Book

[5] Software Engineering by Pressman

[6] Database System Concepts by Korth

244
APPENDIX

The languages used at front-end are C#,HTML5. The causes of selecting this
language are:

 Highly technical language.


 User friendly environment of working.
 Provide low cost solution to the project
 GUI feature
C#:

C# is a multi-paradigm programming language encompassing imperative,


declarative, functional, generic, object-oriented (class-based), and component-
oriented programming disciplines.C# is intended to be a simple, modern, general-
purpose, object-oriented programming language.

Features of C#:

 There are no global variables or functions. All methods and members must be
declared within classes. Static members of public classes can substitute for
global variables and functions.
 Managed memory cannot be explicitly freed; instead, it is automatically garbage
collected. Garbage collection addresses the problem of memory leaks by freeing
the programmer of responsibility for releasing memory which is no longer
needed.
 In addition to the try...catch construct to handle exceptions, C# has
a try...finallyconstruct to guarantee execution of the code in the finally block.

245
HTML 5:

HTML, which stands for HyperText Markup Language, is the predominant markup
language for web pages. HTML is the basic building-blocks of webpages.HTML is
written in the form of HTML elements consisting of tags, enclosed in angle
brackets (like <html>), within the web page content.HTML allows images and
objects to be embedded and can be used to create interactive forms. It provides a means
to create structured documents by denoting structural semantics for text such as
headings, paragraphs, lists, links, quotes and other items. It can embed scripts in
languages such as JavaScript which affect the behavior of HTML webpages.

HTML5 introduces a number of new elements and attributes that helps in building a
modern website. Following are great features introduced in HTML5.

 New Semantic Elements − These are like <header>, <footer>, and <section>.
 Forms 2.0 − Improvements to HTML web forms where new attributes have
been introduced for <input> tag.
 Persistent Local Storage − To achieve without resorting to thirdparty plugins.
 WebSocket − Aa next-generation bidirectional communication technology for
web applications.
 Server-Sent Events − HTML5 introduces events which flow from web server
to the web browsers and they are called Server-Sent Events (SSE).
 Canvas − This supports a two-dimensional drawing surface that you can
program with JavaScript.
 Audio & Video − You can embed audio or video on your web pages without
resorting to third-party plugins.
 Geolocation − Now visitors can choose to share their physical location with
your web application.

246
 Microdata − This lets you create your own vocabularies beyond HTML5 and
extend your web pages with custom semantics.
 Drag and drop − Drag and drop the items from one location to another
location on a the same webpage.

Bootstarp:

Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing
responsive, mobile-first web sites.

The biggest advantage of using Bootstrap is that it comes with free set of tools for
creating flexible and responsive web layouts as well as common interface
components.

Additionally, using the Bootstrap data APIs you can create advanced interface
components like Scrollspy and Typeaheads without writing a single line of
JavaScript.

Here are some more advantages, why one should opt for Bootstrap:

 Save lots of time — You can save lots of time and efforts using the Bootstrap
predefined design templates and classes and concentrate on other
development work.
 Responsive features — Using Bootstrap you can easily create responsive
designs. Bootstrap responsive features make your web pages to appear more
appropriately on different devices and screen resolutions without any change in
markup.
 Consistent design — All Bootstrap components share the same design
templates and styles through a central library, so that the designs and layouts of
your web pages are consistent throughout your development.
 Easy to use — Bootstrap is very easy to use. Anybody with the basic working
knowledge of HTML and CSS can start development with Bootstrap.
 Compatible with browsers — Bootstrap is created with modern browsers in
mind and it is compatible with all modern browsers such as Mozilla Firefox,
Google Chrome, Safari, Internet Explorer, and Opera.
 Open Source — And the best part is, it is completely free to download and use.

247
ADO.NET:

The ADO.NET libraries contain classes (listed in the System.Datanamespace) that


you can use to transfer data between a data store and the client application. There are
many kinds of data stores, so you need specialized code to provide the necessary
bridge between the disconnected data access classes (discussed in Chapter 1) and a
particular data store.
The classes responsible for the movement of data between the disconnected data
classes in the client application and the data store are referred to as connected classes
or provider classes. The Microsoft .NET Framework contains the following
providers:

■ OleDbContains classes that provide general-purpose data access to many data


sources. You can use this provider to access SQL Server 6.5 and earlier,
SyBase,DB2/400, and Microsoft Access.

■ OdbcContains classes that provide general-purpose data access to many data


sources. This provider is typically used when no newer provider is available.

■ SQL Server Contains classes that provide functionality similar to the generic
OleDbprovider. The difference is that these classes are tuned for SQL Server 7 and
later data access. SQL Server 6.5 and earlier must use the OleDbprovider.

248
SQL SERVER 2012:

Microsoft has introduced SQL Server 2012 to the world and it's time for IT
professionals to start to come to speed on what's new in this highly anticipated
version of SQL Server.

1. AlwaysOn Availability Groups -- This feature takes database mirroring to a


whole new level. With AlwaysOn, users will be able to fail over multiple databases in
groups instead of individually. Also, secondary copies will be readable, and can be
used for database backups. The big win is that your DR environment no longer needs
to sit idle.

2. Windows Server Core Support -- If you don't know what Windows Server Core
is, you may want to come up to speed before Windows 8 (MS is making a push back
to the command line for server products). Core is the GUI-less version of Windows
that uses DOS and PowerShell for user interaction. It has a much lower footprint
(50% less memory and disk space utilization), requires fewer patches, and is more
secure than the full install. Starting with SQL 2012, it is supported for SQL Server.

3. Columnstore Indexes -- This a cool new feature that is completely unique to SQL
Server. They are special type of read-only index designed to be use with Data
Warehouse queries. Basically, data is grouped and stored in a flat, compressed
column index, greatly reducing I/O and memory utilization on large queries.

4. User-Defined Server Roles -- DBAs have always had the ability to create custom
database role, but never server wide. For example, if the DBA wanted to give a
development team read/write access to every database on a shared server,
traditionally the only ways to do it were either manually, or using undocumented
procedures. Neither of which were good solutions. Now, the DBA can create a role,
which has read/write access on every DB on the server, or any other custom server
wide role.

5. Enhanced Auditing Features -- Audit is now available in all editions of SQL


Server. Additionally, users can define custom audit specifications to write custom
events into the audit log. New filtering features give greater flexibility in choosing
which events to write to the log.

6. BI Semantic Model -- This is replacing the Analysis Services Unified


Dimensional Model (or cubes most people referred to them). It's a hybrid model that

249
allows one data model will support all BI experiences in SQL Server. Additionally,
this will allow for some really neat text infographics

7. Sequence Objects -- For those folks who have worked with Oracle, this has been a
long requested feature. A sequence is just an object that is a counter -- a good
example of it's use would be to increment values in a table, based a trigger. SQL has
always had similar functionality with identity columns, but now this is a discrete
object.

8. Enhanced PowerShell Support -- Windows and SQL Server admins should


definitely start brushing up on their PowerShell scripting skills. Microsoft is driving a
lot of development effort into instrumenting all of their server-based products with
PowerShell. SQL 2008 gave DBAs some exposure to it, but there are many more in
cmdlets in SQL 2012.

9. Distributed Replay -- Once again this is answer to a feature that Oracle released
(Real Application Testing). However, and in my opinion where the real value
proposition of SQL Server is, in Oracle it is a (very expensive) cost option to
Enterprise Edition. With SQL, when you buy your licenses for Enterprise Edition,
you get everything. Distributed replay allows you to capture a workload on a
production server, and replay it on another machine. This way changes in underlying
schemas, support packs, or hardware changes can be tested under production
conditions.

10. PowerView -- You may have heard of this under the name "Project Crescent" it is
a fairly powerful self-service BI toolkit that allows users to create mash ups of BI
reports from all over the Enterprise.

11. SQL Azure Enhancements -- These don't really go directly with the release of
SQL 2012, but Microsoft is making some key enhancements to SQL Azure.
Reporting Services for Azure will be available, along with backup to the Windows
Azure data store, which is a huge enhancement. The maximum size of an Azure
database is now up to 150G. Also Azure data sync allows a better hybrid model of
cloud and on-premise solutions

12. Big Data Support -- I saved the biggest for last, introduced at the PASS
(Professional Association for SQL Server) conference last year, Microsoft announced
a partnership with Hadoop provider Cloudera. One part of this involves MS releasing
a ODBC driver for SQL Server that will run on a Linux platform. Additionally,
Microsoft is building connectors for Hadoop, which is an extremely popular NoSQL

250
platform. With this announcement, Microsoft has made a clear move into this very
rapidly growing space.

Sequences:

A sequence is a database object that generates numbers in sequential order.


Applications most often use these numbers when they require a unique value in a
table such as primary key values. Some database management systems use an "auto
number" concept or "auto increment" setting on numeric column types. Both the auto
numbering columns and sequences provide a unique number in sequence used for a
unique identifier. The following list describes the characteristics of sequences:

 Sequences are available to all users of the database


 Sequences are created using SQL statements (see below)
 Sequences have a minimum and maximum value (the defaults are minimum=0
and maximum=263-1); they can be dropped, but not reset
 Once a sequence returns a value, the sequence can never return that same
value
 While sequence values are not tied to any particular table, a sequence is
usually used to generate values for only one table
 Sequences increment by an amount specified when created (the default is 1)

Example:

CREATE SEQUENCE [DBO].[CriminalSeq] AS INT

START WITH 1

INCREMENT BY 1

GO

To access

"SELECT NEXT VALUE FOR [DBO].[CriminalSeq]

251
LIST OF SYMBOLS, ABBREVIATIONS & NOMENCLATURES

SYMBOLS:

DFD (Data Flow Diagram)

Symbol Description

A process transforms data values. The lowest level


processes are pure functions without side effects. An
Process
entire data flow graphics high level process.

A data store is a passive object with in a data flow


diagram that stores data for later access.

Data Store

A data flow connects the output of an object or process


to input of another object or process.
Arrow

An actor is active object that drives the data flow graph


by producing or consuming values.
Entity/Actor

252
E-R Diagram

Symbol Description

Represents Entity Sets

Represents Attributes

Represents relationship sets,Weak


relationship set

Represents multivalued attributes

Links attributes to entity and entity sets to


relationship sets.

253

You might also like