Professional Documents
Culture Documents
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.
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 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.
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
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
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.
Traffic and Control has important part where the Traffic inspector would be
filing a charge sheet from a mobile or PDA.
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
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.
Flexible service based architecture will be highly desirable for future extension
Optional Features
7
FEASIBILITY STUDY
decide:
3. What are the alternatives among which a solution will be chosen (during
subsequent phases)
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:
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:
► At the same time the system will require less manual power as compared
to the current system.
► The storage and the handling problem with respect to records and registers
will be solved.
10
HARDWARE AND SOFTWARE SPECIFICATIONS
HARDWARE REQUIREMENTS
RAM : 4 GB
HDD : 40 GB or HIGHER
OTHERS : MONITOR,KEYBORD,MOUSE
SOFTWARE REQUIREMENTS
PROTOCOL : HTTPS,SMTP,MIME
11
PROJECT PLANNING AND SCHEDULING
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
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
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
15
(For User)
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
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
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
SUBMIT
26
2. USER
USER
LOGIN
SEND COMPLAINTS
GETS COMPLAINT ID
3. POLICE
POLICE
LOGIN
VIEW COMPLAINT
27
4. ADMINSTARTOR
ADMIN
LOGIN
ALERT CAUTION
SELECT COMPLALINT
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.
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
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
36
11. News Table
37
(i) Home Page
38
(ii) Search Page
39
(iv) AboutUs Page
40
(v) User registration Page
41
Coding
Database.sql
);
);
42
[UserPassword] VARCHAR (100) NOT NULL,
);
43
);
);
44
[Area] VARCHAR (50) NOT NULL,
);
);
);
45
CREATE TABLE [dbo].[MissingPerson]
);
46
[AdminPassword] VARCHAR(50) NOT NULL );
);
);
START WITH 1
INCREMENT BY 1
GO
47
START WITH 10001
INCREMENT BY 1
GO
INCREMENT BY 1
GO
START WITH 1
INCREMENT BY 1
GO
INCREMENT BY 1
GO
INCREMENT BY 1
GO
48
INCREMENT BY 1 GO
HomePage.aspx
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"> </td>
<td class="auto-style11">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</td>
<td> </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">
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">
<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>
<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>
<asp:Image ID="Image1"
runat="server" Height="134px" ImageUrl='<%# Eval("photo") %>'
Width="150px" />
<br />
Name :
<asp:Label ID="Label2" runat="server"
Text='<%# Eval("Name") %>'></asp:Label>
<br />
Address :
<asp:Label ID="Label3" runat="server"
Text='<%# Eval("Address") %>'></asp:Label>
<br />
Contact:
<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">
53
</asp:Panel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>
About Page
54
GENERAL INFORMATION
</div>
<p style="font-family:Roboto, sans-serif">
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">
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 />
</p><div class="newStyle1">
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;
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();
}
//This is to add the string to session cookie, to be compared
later
Session.Add("randomStr", randomStr);
ContactUs.aspx Page
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="ContactUs.aspx.cs" Inherits="ContactUs"
%>
<script type="text/javascript">
function fun1(msg) {
alert(msg);
}
58
</script>
.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" > </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"> </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"> </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"> </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"> </td>
<td class="auto-style27"> </td>
<td class="auto-style10"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style15"></td>
<td class="auto-style28"></td>
<td class="auto-style17">
<asp:Button ID="BtnSubmit" runat="server"
Text="Sumbit" CssClass="btn-success" Height="31px" Width="86px"
OnClick="BtnSubmit_Click" />
<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"> </td>
<td class="auto-style27"> </td>
<td class="auto-style10"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style27"> </td>
<td class="auto-style10"> </td>
<td> </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
</script>
<link href="StyleSheet1.css" rel="stylesheet" />
<style type="text/css">
.auto-style7
{
width: 100%;
</asp:Content>
<asp:Content ID="Content2" runat="server"
contentplaceholderid="ContentPlaceHolder1">
<div style="height: 550px">
<table class="auto-style7">
<tr>
<td class="auto-style8"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> 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"> 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"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </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"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
66
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
67
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td>
</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
<!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();>
<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; &n
bsp;
<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>
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;">©
</td>
<td align="right"> </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
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">
Search Police Station</td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td class="auto-style7">
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>
</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
</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;
">  
; User Registration </td>
</tr>
<tr>
81
<td class="auto-style8"> </td>
<td class="auto-style11"> </td>
<td class="auto-style13"> </td>
<td>
</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"> </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"> </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"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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"> </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"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style11"> </td>
<td class="auto-style13"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style11"> </td>
<td class="auto-style13" align="center">
86
<asp:Image ID="Image1" runat="server"
ImageUrl="~/captcha.aspx" />
</td>
<td> </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"> </td>
<td class="auto-style11"> </td>
<td class="auto-style13"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style11"> </td>
<td class="auto-
style13">
<asp:Button ID="BtnSubmit" runat="server"
Text="Submit" CssClass="btn-primary" Height="32px" Width="73px"
ValidationGroup="v" OnClick="BtnSubmit_Click" />
<input id="Reset1" class="btn-danger" type="reset"
value="Reset" />
</td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style11"> </td>
<td class="auto-style13"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </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"> </td>
<td class="auto-style11"> </td>
<td class="auto-
style13">
<asp:Button ID="BtnRegister" runat="server"
CssClass="btn-success" Height="32px" Text="Register" Width="73px"
Visible="False" OnClick="BtnRegister_Click" />
</td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style11"> </td>
<td class="auto-style13"> </td>
<td> </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";
client.EnableSsl = true;
try
{
client.Send(msg);
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);
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;
cmd.Connection = con;
91
con.Open();
try
{
cmd.ExecuteNonQuery();
con.Close();
}
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
<!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();>
<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; &n
bsp;
<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>
96
</div>
</div>
<br />
<br />
<br />
<div>
</div>
</form>
<div class="footer-main">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td align="left" style="color:white;">© Indian Police 2016
All Right Reserved
</td>
<td align="right"> </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
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"> </td>
<td class="auto-style12"> </td>
<td class="auto-style13"> </td>
<td class="auto-style12"> </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">
<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"> </td>
<td class="auto-style12"> </td>
<td class="auto-style13"> </td>
<td class="auto-style12"> </td>
<td class="auto-style18"> </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> </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> </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> </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> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
105
<tr>
<td>
</td>
</tr>
<tr>
<td> </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
</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"> </td>
<td class="auto-style9"> </td>
<td> </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"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </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"> </td>
<td class="auto-style9"> </td>
<td> </td>
108
</tr>
<tr>
<td class="auto-style8"> </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"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </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"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
109
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </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
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">
Cyber crime report </td>
</tr>
<tr>
<td class="style3">
</td>
<td colspan="2">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</td>
</tr>
<tr>
<td class="style3">
Crime reference number </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">
Observe date </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">
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">
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- ./?%&=]*)?"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="style3">
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">
</td>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style3">
</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">
</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">
</td>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style3">
</td>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style3">
</td>
<td colspan="2">
</td>
114
</tr>
<tr>
<td class="style3">
</td>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style3">
</td>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style3">
</td>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style3">
</td>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style3">
</td>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style3">
</td>
<td colspan="2">
</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;
}
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
</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"> </td>
<td class="auto-style10"> </td>
<td class="auto-style11"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8" colspan="4" style="font-family: Arial,
Helvetica, sans-serif;
font-size: large;
background-color:#5cb85c;
color:white;
">  
; General Complain </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style10"> </td>
<td class="auto-style11"> </td>
<td> </td>
</tr> <tr>
<td class="auto-style9"> </td>
120
<td class="auto-style10"> </td>
<td class="auto-style11"> </td>
<td> </td>
</tr> <tr>
<td class="auto-style9"> </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> </td>
</tr> <tr>
<td class="auto-style9"> </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> </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"> </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;"> (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"> </td>
<td class="auto-style10">Attachment (Any)</td>
<td class="auto-style11">
<asp:FileUpload ID="FileUpload1" runat="server"
Height="25px" Width="300px" />
</td>
<td> </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"> </td>
<td class="auto-style10"> </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> </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)
{
}
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)
{
if (DropDownList1.SelectedIndex == 0)
policestationid = Session["PoliceStationId"].ToString();
else
123
policestationid = DropDownList1.SelectedItem.Value;
con.Close();
if (FileUpload1.HasFile)
{
filepath= GetFilePath(cid);
}
124
ScriptManager.RegisterStartupScript(Page, GetType(), "", s, true);
}
}
listmissingvaluables.aspx Page
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> </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">
</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> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>
127
listmissingvaluablesdetails.aspx Page
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">
</td>
<td class="style5">
</td>
<td class="auto-style7">
</td>
129
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</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">
</td>
<td class="style5">
Person</td>
<td class="auto-style7">
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
<td>
</td>
130
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
Date</td>
<td class="auto-style7">
<asp:Label ID="Label2" runat="server"></asp:Label>
<asp:Label ID="Label5" runat="server"></asp:Label>
<asp:Label ID="Label6" runat="server"></asp:Label>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
Time</td>
<td class="auto-style7">
<asp:Label ID="Label3" runat="server"></asp:Label>
<asp:Label ID="Label7" runat="server"></asp:Label>
<asp:Label ID="Label8" runat="server"></asp:Label>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
131
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
Address</td>
<td class="auto-style7">
<asp:Label ID="Label4" runat="server"></asp:Label>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</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">
</td>
<td class="style3" colspan="2" rowspan="5">
<asp:GridView ID="GridView1" runat="server" Width="488px"
>
</asp:GridView>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
133
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
134
<td class="style5">
</td>
<td class="auto-style7">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
</td>
<td class="auto-style7">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
</td>
<td class="auto-style7">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
135
<td class="style2">
</td>
<td class="style5">
</td>
<td class="auto-style7">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
</td>
<td class="auto-style7">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</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
}
.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">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</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>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtMPid"
ErrorMessage="*(Please Enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style3">
Name</td>
<td>
<asp:TextBox ID="Txtname"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server" ControlToValidate="Txtname"
139
ErrorMessage="*(Please enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style3">
Missing date</td>
<td>
<asp:DropDownList ID="DDLmdate" runat="server"
Height="16px">
</asp:DropDownList>
<asp:DropDownList ID="DDLmmonth" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DDLmyear" runat="server">
</asp:DropDownList>
</td>
<td>
</td>
</tr>
<tr>
<td class="style3">
Missing Time</td>
<td>
<asp:DropDownList ID="DDLhour"
runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DDLminute"
runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DDLtype"
runat="server">
<asp:ListItem>am</asp:ListItem>
<asp:ListItem>pm</asp:ListItem>
</asp:DropDownList>
</td>
<td>
</td>
</tr>
<tr>
<td class="style3">
Date Of Birth</td>
<td>
<asp:DropDownList ID="DDLdate" runat="server">
</asp:DropDownList>
140
<asp:DropDownList ID="DDLmonth" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DDLyear" runat="server">
</asp:DropDownList>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
Address</td>
<td>
<asp:TextBox ID="Txtadd"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server" ControlToValidate="Txtadd"
ErrorMessage="*(Please enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
if reward</td>
<td>
<asp:TextBox ID="Txtrew" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
Missing Area</td>
<td>
<asp:TextBox ID="Txtmarea"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator4" runat="server" ControlToValidate="Txtmarea"
141
ErrorMessage="*(Please enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
Contact No</td>
<td>
<asp:TextBox ID="Txtconno"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator5" runat="server" ControlToValidate="Txtconno"
ErrorMessage="*(Please enter the
value)"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
Contact Person</td>
<td>
<asp:TextBox ID="Txtconper"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator6" runat="server" ControlToValidate="Txtconper"
ErrorMessage="*(Please enter the value
)"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
Missing Person photo</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td>
142
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click" Text="save"
Width="79px" />
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
143
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</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)
{
}
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());
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
</style>
<script type="text/javascript">
function fun1(msg) {
146
alert(msg);
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<br />
147
<td>
<asp:TextBox ID="Txtpname" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
runat="server"
ControlToValidate="Txtpname" ErrorMessage="*(Please
Enter the value)" ValidationGroup="v"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="style3">
Missing valuable Time</td>
<td>
<asp:DropDownList ID="DDLmvhour" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DDLmvminute" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DDLmvtype" runat="server">
<asp:ListItem>am</asp:ListItem>
<asp:ListItem>pm</asp:ListItem>
</asp:DropDownList>
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
Address</td>
<td>
<asp:TextBox ID="Txtadd" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3"
runat="server"
ControlToValidate="Txtadd" ErrorMessage="*(Please
Enter the value)" ValidationGroup="v"></asp:RequiredFieldValidator>
</td>
<td>
</td>
148
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
Area</td>
<td>
<asp:TextBox ID="Txtarea" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
Phone no</td>
<td>
<asp:TextBox ID="txtpho" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style7">
</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>
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
Missing things</td>
<td>
<asp:TextBox ID="Txtmthings" runat="server"
CssClass="form-control" Width="200px"></asp:TextBox>
149
<asp:RequiredFieldValidator ID="RequiredFieldValidator4"
runat="server"
ControlToValidate="Txtmthings" ErrorMessage="*(Please
Enter the value)" ValidationGroup="v1"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
Cost</td>
<td>
<asp:TextBox ID="Txtcost" runat="server" CssClass="form-
control" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5"
runat="server"
ControlToValidate="Txtcost" ErrorMessage="*(Please
Enter the value)" ValidationGroup="v1"></asp:RequiredFieldValidator>
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
</td>
<td>
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click" Text="Add" ValidationGroup="v1" CssClass="btn-
primary" Height="32px" Width="70px" />
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
</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>
</td>
</tr>
<tr>
<td class="auto-style9"> </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;"> (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">
</td>
<td class="style3">
</td>
<td>
</td>
151
<td>
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
</td>
<td>
<asp:Button ID="Button2" runat="server" onclick="Button2_Click"
Text="Submit" ValidationGroup="v" CssClass="btn-success" Height="32px"
Width="80px" />
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="style3">
</td>
<td>
</td>
<td>
</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());
153
DDLmvmonth.Items.Add(i.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
<!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 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>
</td>
</tr>
<tr>
<td>To,</td>
</tr>
<tr>
<td>Mr./Mrs.
<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> </td>
</tr>
<tr>
<td>
<asp:Label ID="LblComplaintNo" runat="server" Font-
Size="Large" Font-Underline="True"></asp:Label>
</td>
</tr>
<tr>
<td>Sir/Ma'am,</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<asp:Label ID="LblMessage" runat="server"
Height="100px"></asp:Label>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>From,</td>
</tr>
<tr>
<td> </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();
PoliceStation/Default.aspx Page
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"> </td>
160
<td class="auto-style11"> </td>
<td> </td>
<td> </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"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </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"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
161
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
162
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </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
.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 </td>
</tr>
<tr>
<td> </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> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</asp:Content>
C# Code
}
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
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>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
171
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>
172
AutoEventWireup="true" CodeFile="listmissingvaluables.aspx.cs"
Inherits="PoliceStation_listmissingvaluables" %>
function fun2()
{
window.open('listmissingvaluablesdetails.aspx', '_new');
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<table class="auto-style7">
<tr>
<td> </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">
</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> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>
PoliceStation/listmissingvaluablesdetails.aspx Page
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">
</td>
<td class="style5">
</td>
<td class="auto-style7">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</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">
</td>
<td class="style5">
Person</td>
<td class="auto-style7">
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
Date</td>
<td class="auto-style7">
<asp:Label ID="Label2" runat="server"></asp:Label>
<asp:Label ID="Label5" runat="server"></asp:Label>
<asp:Label ID="Label6" runat="server"></asp:Label>
</td>
<td>
178
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
Time</td>
<td class="auto-style7">
<asp:Label ID="Label3" runat="server"></asp:Label>
<asp:Label ID="Label7" runat="server"></asp:Label>
<asp:Label ID="Label8" runat="server"></asp:Label>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
Address</td>
<td class="auto-style7">
<asp:Label ID="Label4" runat="server"></asp:Label>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</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">
</td>
<td class="style3" colspan="2" rowspan="5">
<asp:GridView ID="GridView1" runat="server" Width="488px"
>
</asp:GridView>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
181
<tr>
<td class="style2">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
</td>
<td class="auto-style7">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
</td>
<td class="auto-style7">
182
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
</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>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style5">
</td>
<td class="auto-style7">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
183
<td class="style2">
</td>
<td class="style5">
</td>
<td class="auto-style7">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</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
<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> </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> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </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();
}
}
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);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
SqlDataSource1.DataBind();
GridView1.DataBind();
}
PoliceStation/Report.aspx Page
192
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"
tagprefix="cc1" %>
.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> </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"> </td>
<td
class="auto-style9"> </td>
<td
class="auto-style11"> </td>
<td
class="auto-style16">
</td>
<td class="auto-style13"> </td>
<td colspan="3"> </td>
</tr>
<tr>
<td class="auto-style18"> 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"> </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">
</td>
<td class="auto-style17">
</td>
<td class="auto-style18">
</td>
<td class="auto-style23">
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
195
<tr>
<td> </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>
|
<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> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </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;
}
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);
GridView1.RenderControl(hw);
}
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}
199
}
PoliceStation/userdetails.aspx Page
.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"> User Details</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td style=" font-family:'Roboto', Arial, Helvetica, sans-
serif;
font-size: 16px;" class="auto-
style9"> Enter EmailID of the
User
</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"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
202
<tr>
<td colspan="3"> </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);
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);
}
}
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
204
AutoEventWireup="true" CodeFile="ChangePassword.aspx.cs"
Inherits="PoliceStation_ChangePassword" %>
</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"> </td>
<td class="auto-style9"> </td>
<td> </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"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </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"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </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"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </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"> </td>
<td class="auto-style9"> </td>
<td> </td>
206
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td> </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
<!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();>
<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; &n
bsp;
<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>
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>
</div>
</form>
<div class="footer-main">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
</td>
<td align="right" style="color:white;"> ©
</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" %>
</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"> </td>
<td class="auto-style9"> </td>
<td class="auto-style10"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td class="auto-style10">Add New Police Station</td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td class="auto-style10"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </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"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td class="auto-style10"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </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> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td class="auto-style10"> </td>
<td> </td>
</tr>
<tr>
217
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td class="auto-style10"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style8"> </td>
<td class="auto-style9"> </td>
<td class="auto-style10"> </td>
<td> </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
.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"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </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"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </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"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
221
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style11"> </td>
<td> </td>
<td> </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
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> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2"
Runat="Server">
</asp:Content>
Admin/NewsFlash.aspx Page
.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> </td>
</tr>
<tr>
<td> </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> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </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;
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:
LEVELS OF TESTING
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
System Testing
This testing is a series of different tests whose primary is to fully exercise the
computer-based system. This involves:
Low Level:
Medium Level:
High Level:
236
SECURITY MECHANISMS
1 Security
2 Integrity
3 Privacy
4 Confidentiality
DATA SECURITY is the protection of data from loss, disclosure, modification and
destruction.
237
organization can be protected against unwelcome, unfair or excessive dissemination of
information about it.
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:
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
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.
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: -
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
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.
243
BIBLIOGRAPHY
244
APPENDIX
The languages used at front-end are C#,HTML5. The causes of selecting this
language are:
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:
■ 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.
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.
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.
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:
Example:
START WITH 1
INCREMENT BY 1
GO
To access
251
LIST OF SYMBOLS, ABBREVIATIONS & NOMENCLATURES
SYMBOLS:
Symbol Description
Data Store
252
E-R Diagram
Symbol Description
Represents Attributes
253