Professional Documents
Culture Documents
B.Tech.
In
Information Technology
By
Rajesh, 00714807713
April 2016
DECLARATION
This is to certify that the report entitled NEWSMATE which is submitted by me in
partial fulfillment of the requirement for the award of degree B.Tech in Information
Technology to Maharaja Agrasen Institute of Technology, Sec-22 Rohini, comprises
only my original work and due acknowledgement has been made in the text to all
other material used.
Date: Rajesh
00714807713
CERTIFICATE
Date:
Supervisor
Dr. M. L. Sharma
(Head of Department)
ACKNOWLEDGEMENT
I take this occasion to thank God, almighty for blessing us with his grace
and taking out endeavor to successful culmination. I extend my sincere and
heartfelt thanks to our esteemed guide, Mr. Nitesh Wadhera, for providing me the
right guidance and advice at the crucial junctures and for showing me the right
way. I extend my sincere thanks to my respected Head of Department Dr. ML
Sharma, for allowing me to use facilities available. I would like to thank the other
faculty members also, at this occasion. Last but not the least, I would like to thank
my friends and family for the support and encouragement they have given me
during the course of my work.
CONTENTS
INTRODUCTION
This gives an overview about the aim, objectives, background and operation
environment of the system.
SYSTEM ANALYSIS
In this chapter, we will discuss and analyze about the developing process of
NewsMate including software requirement specification(SRS).
The functional and non-functional requirements before the developing process
is carried out. This provides a view of how this portal works and what features is it
having.
NewsMate is an online news portal which gives time prompted news to the
users. It reduces the use of paper work and gives an interesting interface to use.
RELIABILITY REQUIREMENTS
The system should provide accurate news with a good
interface. It should work properly, all modules and functionalities.
USABILITY REQUIREMENTS
The system is designed for a user friendly environment so that
user and reporter can perform the various tasks easily and in an effective way.
IMPLEMENTATION REQUIREMENTS
In implementing whole portal, it uses html as front end with C#
which is used for database connectivity and the backend i.e. the database part is
developed using MySQL.
DELIVERY REQUIREMENTS
The whole system is expected to be delivered in six months of
time with a weekly evaluation by the project guide.
2. REPORT
2.1 Add Report
Description of the Feature: This feature is provided to add new reports
by the reporters. A report could consist of multimedia elements like pictures, videos
and audios.
Functional Requirements: System must be able to add multimedia
along with text report. System must be able to block report in case of no need or other
reasons.
2.2 SOFTWARE AND HARDWARE REQUIREMENTS
This section describes the software and hardware requirements of the system.
2.2.1 SOFTWARE REQUIREMENTS
Operation System
-Windows 8 is used as the operating system as it is stable and supports more
features and is more user friendly.
Database
-MySQL is used as database as it is easy to maintain and retrieve records by
simple queries
Development Tools and Programming Language\
-HTML is used to write the whole front end and web pages designing is done
by using CSS and JavaScript.
CSS
-Cascading Style Sheet(CSS) is a style sheet language used for describing the
look and formatting of a document written in a markup language. While most often
used to style web pages and interfaces written in HTML and XHTML, the language
can be applied to any kind of XML document, including plain XML, SVG and XUL.
CSS is a cornerstone specification of the web and almost all web pages use CSS style
sheets to describe their presentation.CSS is designed primarily to enable the
separation of document content from document presentation, including elements such
as the layout, colors, and fonts. This separation can improve content accessibility,
provide more flexibility and control in the specification of presentation
characteristics, enable multiple pages to share formatting, and reduce complexity and
repetition in the structural content (such as by allowing for table less web design).CSS
can also allow the same markup page to be presented in different styles for different
rendering methods, such as on-screen, in print, by voice (when read out by a speech-
based browser or screen reader) and on Braille-based, tactile devices. It can also be
used to allow the web page to display differently depending on the screen size or
device on which it is being viewed. While the author of a document typically links
that document to a CSS file, readers can use a different style sheet, perhaps one on
their own computer, to override the one the author has specified. However if the
author or the reader did not link the document to a specific style sheet the default style
of the browser will be applied.CSS specifies a priority scheme to determine which
style rules apply if more than one rule matches against a particular element. In this so-
called cascade, priorities or weights are calculated and assigned to rules, so that the
results are predictable.
JAVA SCRIPT
- JavaScript(JS) is a dynamic computer programming language. It is most
commonly used as part of web browsers, whose implementations allow client-side
scripts to interact with the user, control the browser, communicate asynchronously,
and alter the document content that is displayed. It is also being used in server-side
programming, game development and the creation of desktop and mobile
applications. JavaScript is a prototype-based scripting language with dynamic typing
and has first-class functions. Its syntax was influenced by C. JavaScript copies many
names and naming conventions from Java, but the two languages are otherwise
unrelated and have very different semantics. The key design principles within
JavaScript are taken from the Self and Scheme programming languages. It is a multi-
paradigm language, supporting object-oriented, imperative, and functional
programming styles. The application of JavaScript to use outside of web pages—for
example, in PDF documents, site-specific browsers, and desktop widgets—is also
significant. Newer and faster JavaScript VMs and platforms built upon them
(notablyNode.js) have also increased the popularity of JavaScript for server-side web
applications. On the client side, JavaScript was traditionally implemented as an
interpreted language but just-in-time compilation is now performed by recent (post-
2012) browsers.
PHP
- PHP development began in 1994 when Rasmus Lerdorf wrote a series of
Common Gateway Interface (CGI) binaries in C, which he used to maintain his
personal homepage. He extended them to add the ability to work with web formsand
to communicate with databases, and called this implementation "Personal Home
Page/Forms Interpreter" or PHP/FI.
PHP/FI could be used to build simple, dynamic web applications. Lerdorf initially
announced the release of PHP/FI as "Personal Home Page Tools (PHP Tools) version
1.0" publicly to accelerate bug location and improve the code, on theUsenet
discussion group comp.infosystems.www.authoring.cgi on June 8, 1995. This release
already had the basic functionality that PHP has as of 2013. This included Perl-like
variables, form handling, and the ability to embed HTML. The syntax resembled that
of Perl but was simpler, more limited and less consistent.[5]
Early PHP was not intended to be a new programming language, and grew
organically, with Lerdorf noting in retrospect: "I don’t know how to stop it, there was
never any intent to write a programming language […] I have absolutely no idea how
to write a programming language, I just kept adding the next logical step on the way."
A development team began to form and, after months of work and beta testing,
officially released PHP/FI 2 in November 1997.
One criticism of PHP is that it was not originally designed, but instead it was
developed organically; among other things, this has led to inconsistent naming of
functions and inconsistent ordering of their parameters. In some cases, the function
names were chosen to match the lower-level libraries which PHP was "wrapping",
while in some very early versions of PHP the length of the function names was used
internally as a hash function, so names were chosen to improve the distribution of
hash values.
2.3.2 BACK END
-The back end is designed using mysql which is used to design the databases
MySQL
-MySQL("My S-Q-L", officially, but also called "My Sequel") is (as of July
2013) the world's second most widely used open-source relational database
management system(RDBMS). It is named after co-founder Michael Widenius
daughter, My. The SQL phrase stands for Structured Query Language. The MySQL
development project has made its source code available under the terms of the GNU
General Public License, as well as under a variety of proprietary agreements. MySQL
was owned and sponsored by a single for-profit firm, the Swedish company MySQL
AB, now owned by Oracle Corporation. MySQL is a popular choice of database for
use in web applications, and is a central component of the widely used LAMP open
source web application software stack (and other 'AMP' stacks). LAMP is an acronym
for "Linux, Apache, MySQL, Perl/PHP/Python." Free-software-open source projects
that require a full-featured database management system often use MySQL. For
commercial use, several paid editions are available, and offer additional functionality.
Applications which use MySQL databases include:TYPO3, MODx, Joomla,
WordPress, phpBB, MyBB, Drupal and other software. MySQL is also used in many
high-profile, large-scale websites, including Wikipedia, Google(though not for
searches), Facebook, Twitter, Flickr, and YouTube.
CHAPTER 3
SYSTEM DESIGN
Reporter_firstname Varchar(20)
Reporter_middlename Varchar(20)
Reporter_lastname Varchar(20)
Reporter_gender Varchar(1)
Reporter_contact Bigint
Reporter_address Varchar(100)
Reporter_emailid Varchar(50) Not Null Primary
Reporter_password Varchar(50)
Reporter_country Varchar(50)
Reporter_language Varchar(50)
Reporter_securityquestion Varchar(max)
Reporter_securityanswer Varchar(max)
Reporter_registrationdate Datetime
Reporter_isblocked Bit
COUNTRY TABLE
REGION TABLE
CATEGORY TABLE
REPORT TABLE
ARTICLE TABLE
FEEDBACK TABLE
SYSTEM IMPLEMENTATION
4.1.1 Codes
4.1.1.1 User.master
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="User.master.cs"
Inherits="User" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>News Mate</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<div id="wrapper">
<form id="form1" runat="server">
<div>
<div class="break"></div>
</asp:Menu>
</div>
<!-- Content-->
<div id="content">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
<!-- end ads -->
<div class="wrapper">
<!-- begin popular posts -->
<h2>Popular Posts</h2>
<ul>
<li><a href="home.aspx">Make Money Online Creating
Websites</a></li>
<li><a href="home.aspx">Top 100 Internet Marketing
Tips</a></li>
<li><a href="home.aspx">Tutorial: How to add Videos in your
Post</a></li>
<li><a href="home.aspx">Sample Post Unordered List</a></li>
<li><a href="home.aspx">Sample Post Blockquote</a></li>
</ul>
<!-- end popular posts -->
<!-- begin flickr photos -->
<h2>Flickr Photos</h2>
<div class="flickr">
<a href="home.aspx">
<img src="images/_thumb3.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb4.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb5.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb6.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb7.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb8.jpg" alt="" /></a> <a
href="home.aspx">
</div>
<!-- end flickr photos -->
<!-- begin featured video -->
<h2>Featured Video</h2>
<div class="video">
<img src="images/_video.jpg" alt="" />
</div>
<!-- end featured video -->
<!-- begin tags -->
<h2>Tags</h2>
<div class="tags"></div>
<!-- end tags -->
<!-- BEGIN left -->
<div class="l sbar">
<!-- begin categories -->
<h2>Categories</h2>
<ul>
<li><a href="home.aspx">Entertainment</a></li>
<li><a href="home.aspx">Fashion</a></li>
<li><a href="home.aspx">Internet</a></li>
<li><a href="home.aspx">Marketing</a></li>
<li><a href="home.aspx">Lifestyle</a></li>
<li><a href="home.aspx">Make Money</a></li>
<li><a href="home.aspx">Online</a></li>
<li><a href="home.aspx">Parenting</a></li>
</ul>
<!-- end categories -->
<!-- begin pages -->
<h2>Pages</h2>
<ul>
<li><a href="home.aspx">Home</a></li>
<li><a href="home.aspx">About</a></li>
<li><a href="home.aspx">Archives</a></li>
<li><a href="home.aspx">Links</a></li>
<li><a href="home.aspx">Contact</a></li>
<li><a href="home.aspx">Sitemap</a></li>
</ul>
<!-- end pages -->
</div>
<!-- END left -->
<!-- BEGIN right -->
<div class="r sbar">
<!-- begin archives -->
<h2>Archives</h2>
<ul>
<li><a href="home.aspx">August 2008</a></li>
<li><a href="home.aspx">July 2008</a></li>
<li><a href="home.aspx">June 2008</a></li>
<li><a href="home.aspx">May 2008</a></li>
<li><a href="home.aspx">April 2008</a></li>
<li><a href="home.aspx">March 2008</a></li>
</ul>
<!-- end archives -->
<!-- begin blogroll -->
<h2>Blogroll</h2>
<ul>
<li><a href="home.aspx">Carlos</a></li>
<li><a href="home.aspx">Digital Point Forum</a></li>
<li><a href="home.aspx">Eric's Photo Gallery</a></li>
<li><a href="home.aspx">Fashion Trends</a></li>
<li><a href="home.aspx">Google Scoreboard</a></li>
<li><a href="home.aspx">Marketing Forum</a></li>
</ul>
<!-- end blogroll -->
<!-- begin meta -->
</div>
<!-- BEGIN footer -->
<div id="footer">
</html>
4.1.1.2 User.master.cs
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.Data.SqlClient;
using System.Configuration;
4.1.1.3 Home.aspx
</ItemTemplate>
</asp:DataList>
4.1.1.4 Home.aspx.cs
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.Configuration;
using System.Data;
DataList_content.Visible = false;
datalist_reportdetail.Visible = true;
}
}
4.1.1.5 Article.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/User.master"
AutoEventWireup="true"
CodeFile="Article.aspx.cs" Inherits="Article" %>
4.1.1.6 Article.aspx.cs
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.Data.SqlClient;
using System.Configuration;
ViewState["name"] = dtadmin.Rows[0]["admin_Loginid"].ToString();
}
}
else if (Session["reporter_loginid"] != null)
{
SqlDataAdapter dareporter = new SqlDataAdapter("select * from
Reporter_Table where reporter_loginid='" + Session["reporter_loginid"] + "'", con);
DataTable dtreporter = new DataTable();
dareporter.Fill(dtreporter);
if (dtreporter.Rows.Count > 0)
{
ViewState["name"] = dtreporter.Rows[0]["reporter_loginid"].ToString();
}
}
SqlCommand cmd = new SqlCommand("insert into article_table values('"
+ TextBox_title.Text + "','"
+ TextBox_description.Text + "','"
+ ViewState["name"] + "','"
+ DropDownList_Category.SelectedValue + "','"
+ DateTime.Now.ToShortDateString() + "','"
+ published + "')", con);
con.Open();
int check = cmd.ExecuteNonQuery();
con.Close();
if (check > 0)
{
Response.Write("<script>alert('Thanks! Your Article is submitted
successfully')</script>");
//Response.Redirect("~/Home.aspx");
if (Session["adminloginid"] != null && Session["reporter_loginid"] == null)
{
Response.Redirect("~/Admin_Pages/Admin_Home.aspx");
}
else
{
//Response.Redirect("~/reporter_pages/reporter_home.aspx");
ScriptManager.RegisterStartupScript(this, this.GetType(),
"MessageThenRedirect", "window.location='reporter_pages/reporter_home.aspx';",
true);
}
}
}
4.1.1.7 Admin.master
<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="Admin.master.cs" Inherits="Admin" %>
</ol>
</asp:Panel>
<div class="break"></div>
</div>
</div>
<div>
</div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<div>
All Rights Are Reserved to Rajesh Bharat.
</div>
</form>
</body>
</html>
4.1.1.8 Admin.master.cs
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.Configuration;
if (Session["adminloginid"] != null)
{
//Menu1.Visible = true;
Linkbutton_logout.Visible = true;
panel_admin_menu.Visible = true;
}
else
{
//Menu1.Visible = false;
Linkbutton_Login.Visible = true;
panel_admin_menu.Visible = false;
}
}
protected void Linkbutton_logout_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("~/admin_pages/admin_home.aspx");
}
protected void Linkbutton_Login_Click(object sender, EventArgs e)
{
Response.Redirect("~/admin_login.aspx");
}
}
4.1.1.9 Admin_add_country.aspx
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("country_id") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Country Name"
SortExpression="Country_name">
<EditItemTemplate>
<asp:TextBox ID="TextBox_country" runat="server" Text='<
%# Bind("Country_name") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label_country" runat="server" Text='<%#
Bind("Country_name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton_update" runat="server"
CausesValidation="false"
CommandName="Update"
Text="Update"></asp:LinkButton>
<asp:LinkButton ID="LinkButton_cancel"
runat="server" CausesValidation="False"
CommandName="Cancel"
Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton_Edit" runat="server"
CausesValidation="False"
CommandName="Edit" Text="Edit"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton_delete" runat="server"
CausesValidation="False"
CommandName="Delete"
Text="Delete"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button ID="Button_Submit" runat="server" Text="Submit"
OnClick="Button_Submit_Click" />
<asp:Button ID="Button_Reset" runat="server" Text="Reset"
OnClick="Button_Reset_Click" />
</td>
</tr>
</table>
</center>
</asp:Content>
4.1.1.10 Admin_add_country.aspx.cs
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.Configuration;
using System.Data;
public partial class Add_Country : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["Mystring"].ConnectionStri
ng);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
GridView_country.EditIndex = -1;
bind();
}
protected void GridView_country_SelectedIndexChanged(object sender,
EventArgs e)
{
}
protected void GridView_country_RowDeleting(object sender,
GridViewDeleteEventArgs e)
{
GridViewRow gvr1 = GridView_country.Rows[e.RowIndex];
string name = ((Label)gvr1.FindControl("Label_country")).Text;
SqlCommand cmd1 = new SqlCommand("delete from country_table where
Country_name='"+name+"' ",con);
con.Open();
cmd1.ExecuteNonQuery();
con.Close();
GridView_country.EditIndex = -1;
bind();
}
protected void Button_Submit_Click(object sender, EventArgs e)
{
SqlDataAdapter da1 = new SqlDataAdapter("select * from country_table where
country_name='" + textbox_addcountry.Text + "'", con);
DataTable dt1 = new DataTable();
da1.Fill(dt1);
if (dt1.Rows.Count > 0)
{
}
else
{
}
protected void GridView_country_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView_country.EditIndex = -1;
bind();
}
}
4.1.1.11 Admin_add_news_category.aspx
4.1.1.12 Admin_add_news_category.aspx.cs
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.Configuration;
using System.Data;
public partial class Add_News_Category : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["MyString"].ConnectionStr
ing);
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
void bind()
{
SqlDataAdapter da = new SqlDataAdapter("select * from category_table", con);
DataTable dt = new DataTable();
da.Fill(dt);
gridview_category.DataSource = dt;
gridview_category.DataBind();
}
protected void Button_Submit_Click(object sender, EventArgs e)
{
SqlDataAdapter da1 = new SqlDataAdapter("select * from Category_table where
category_name='"+textbox_addcategory.Text+"' ",con);
DataTable dt1 = new DataTable();
da1.Fill(dt1);
if (dt1.Rows.Count > 0)
{
}
else
{
cmd = new SqlCommand("insert into category_table values('" +
textbox_addcategory.Text + "')", con);
con.Open();
int check = cmd.ExecuteNonQuery();
if (check > 0)
{
Response.Write("<script>alert('New Category Added
successfully')</script>");
}
con.Close();
textbox_addcategory.Text = "";
bind();
}
}
protected void Button_Reset_Click(object sender, EventArgs e)
{
textbox_addcategory.Text = "";
}
protected void gridview1_RowEditing(object sender, GridViewEditEventArgs e)
{
gridview_category.EditIndex = e.NewEditIndex;
bind();
}
protected void gridview_category_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
GridViewRow gvr = gridview_category.Rows[e.RowIndex];
con.Open();
int k = cmd.ExecuteNonQuery();
con.Close();
if (k > 0)
{
Response.Write("<sript>alert('Record Updated Successfully')</script>");
gridview_category.EditIndex = -1;
bind();
}
}
protected void gridview_category_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
gridview_category.EditIndex = -1;
bind();
}
protected void gridview_category_RowDeleting(object sender,
GridViewDeleteEventArgs e)
{
GridViewRow gvr1 = gridview_category.Rows[e.RowIndex];
string sname = ((Label)gvr1.FindControl("Label2")).Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
bind();
}
}
4.1.1.13 Admin_add_region.aspx
<%@ Page Title="" Language="C#"
MasterPageFile="~/Admin_Pages/Admin.master" AutoEventWireup="true"
CodeFile="Admin_Add_Region.aspx.cs" Inherits="Add_Region" %>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button3" runat="server" Text="Submit"
onclick="Button_Submit_Click" />
<asp:Button ID="Button4" runat="server" Text="Reset"
onclick="Button_Reset_Click" />
</td>
</tr>
</table>
</center>
</asp:Content>
4.1.1.14 Admin_add_region.aspx.cs
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.Configuration;
using System.Data;
public partial class Add_Region : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["MyString"].ConnectionStr
ing);
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
void bind()
{
SqlDataAdapter da = new SqlDataAdapter("select * from region_table", con);
DataTable dt = new DataTable();
da.Fill(dt);
GridView_Regions.DataSource = dt;
GridView_Regions.DataBind();
}
protected void Button_Submit_Click(object sender, EventArgs e)
{
SqlDataAdapter da1 = new SqlDataAdapter("select * from region_table where
region_name='" + textbox_addRegion.Text + "'", con);
DataTable dt1 = new DataTable();
da1.Fill(dt1);
if (dt1.Rows.Count > 0)
{
}
else
{
con.Open();
cmd.ExecuteNonQuery();
con.Close();
GridView_Regions.EditIndex = -1;
bind();
}
protected void GridView_Regions_SelectedIndexChanged(object sender,
EventArgs e)
{
}
protected void GridView_Regions_RowDeleting(object sender,
GridViewDeleteEventArgs e)
{
GridViewRow gvr1 = GridView_Regions.Rows[e.RowIndex];
string sname1 = ((Label)gvr1.FindControl("Label2")).Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
GridView_Regions.EditIndex = -1;
bind();
}
protected void GridView_Regions_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView_Regions.EditIndex = -1;
bind();
}
}
4.1.1.15 Add_report.aspx
<%@ Page Title="" Language="C#"
MasterPageFile="~/Admin_Pages/Admin.master" AutoEventWireup="true"
CodeFile="Admin_Add_Report.aspx.cs" Inherits="Add_Report" %>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Panel ID="panel_image" runat="server" Visible="true">
<table>
<tr>
<td>
<span>Image Description</span>
</td>
<td>
<asp:TextBox ID="textbox_imagedescription" runat="server"
/>
</td>
</tr>
<tr>
<td>
<span>Date of Gathering</span>
</td>
<td>
<asp:TextBox ID="textbox_image_dateofGathering"
runat="server" />
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
<tr>
<td>
<span>Upload Video</span>
</td>
<td>
<asp:FileUpload ID="FileUpload_Video" runat="server" />
</td>
<asp:ValidationSummary ID="ValidationSummary3" runat="server"
ShowMessageBox="true" ShowSummary="false" />
</tr>
<tr>
<td colspan="2" align="center">
<asp:Panel ID="Panel_video" runat="server" Visible="true">
<table>
<tr>
<td>
<span>Image Description</span>
</td>
<td>
<asp:TextBox ID="textbox_videodescription" runat="server"
/>
</td>
</tr>
<tr>
<td>
<span>Date of Gathering</span>
</td>
<td>
<asp:TextBox ID="textbox_video_dateofGatehring"
runat="server" />
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
</table>
<asp:Button Text="Submit" ID="Button5" runat="server"
OnClick="Button_Submit_Click" />
<asp:Button Text="Reset" ID="Button6" runat="server"
OnClick="Button_Reset_Click" />
</center>
</asp:Content>
4.1.1.16 Add_report.aspx.cs
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.Configuration;
using System.Data;
public partial class Add_Report : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["MyString"].ConnectionStr
ing);
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
string checks()
{
if (Session["adminloginid"] != null)
{
return "Admin";
}
if (Session["reporter_loginid"] != null)
{
return "Reporter";
}
else
{
return "0";
}
}
void bind()
{
SqlDataAdapter da_region = new SqlDataAdapter("select * from region_table ",
con);
DataTable dt_region = new DataTable();
da_region.Fill(dt_region);
if (dt_region.Rows.Count > 0)
{
DropDownList_Region.DataSource = dt_region;
DropDownList_Region.DataTextField = "region_name";
DropDownList_Region.DataValueField = "region_id";
DropDownList_Region.DataBind();
}
else
{
DropDownList_Region.DataSource = dt_region;
DropDownList_Region.DataTextField = "region_name";
DropDownList_Region.DataValueField = "region_id";
DropDownList_Region.DataBind();
}
SqlDataAdapter da_category = new SqlDataAdapter("select * from
category_table", con);
DataTable dt_category = new DataTable();
da_category.Fill(dt_category);
if (dt_category.Rows.Count > 0)
{
DropDownList_Category.DataSource = dt_category;
DropDownList_Category.DataTextField = "category_name";
DropDownList_Category.DataValueField = "category_id";
DropDownList_Category.DataBind();
}
else
{
DropDownList_Category.DataSource = dt_category;
DropDownList_Category.DataTextField = "category_name";
DropDownList_Category.DataValueField = "category_id";
DropDownList_Category.DataBind();
}
}
protected void Button_Submit_Click(object sender, EventArgs e)
{
string sFilePath;
if (FileUpload_thumbnail.HasFile)
{
FileUpload_thumbnail.SaveAs(Request.PhysicalApplicationPath + "\\
UploadedFiles\\" + FileUpload_thumbnail.FileName);
sFilePath = "~\\UploadedFiles\\" + FileUpload_thumbnail.FileName;
}
else
{
sFilePath = "";
}
con.Open();
int check = cmd.ExecuteNonQuery();
if (check > 0)
{
string sFilePath1;
string sFilepath2;
if (FileUpload_Image.HasFile)
{
FileUpload_Image.SaveAs(Request.PhysicalApplicationPath + "\\
UploadedFiles\\" + FileUpload_Image.FileName);
sFilePath1 = "~\\UploadedFiles\\" + FileUpload_Image.FileName;
string type = "image";
string image_file_size = "";
SqlCommand cmd1 = new SqlCommand("insert into Multimedia_table
values('"
+ type + "','"
+ image_file_size + "','"
+textbox_imagedescription.Text+"','"
+ textbox_image_dateofGathering.Text+ "','"
+ DateTime.Now.ToShortDateString() + "','"
+sFilePath1+"')", con);
}
else
{
sFilePath1 = "";
}
if (FileUpload_Video.HasFile)
{
string video_file_size = "";
FileUpload_Video.SaveAs(Request.PhysicalApplicationPath + "\\
UploadedFiles\\" + FileUpload_Video.FileName);
sFilepath2 = "~\\UploadedFiles\\" + FileUpload_Video.FileName;
string type = "video";
SqlCommand cmd2 = new SqlCommand("insert into Multimedia_table
values('"
+ type + "','"
+ video_file_size + "','"
+ textbox_imagedescription.Text + "','"
+ textbox_video_dateofGatehring.Text+ "','"
+ DateTime.Now.ToShortDateString() + "','"
+ sFilepath2 + "')", con);
}
else
{
sFilepath2 = "";
}
}
protected void Button_Reset_Click(object sender, EventArgs e)
{
reset();
}
void reset()
{
textbox_headline.Text = "";
TextBox_Descripton.Text = "";
textbox_DetailedReport.Text = "";
textbox_image_dateofGathering.Text = "";
textbox_imagedescription.Text = "";
textbox_video_dateofGatehring.Text = "";
textbox_videodescription.Text = "";
4.1.1.17 Admin_home.aspx
<%@ Page Title="" Language="C#"
MasterPageFile="~/Admin_Pages/Admin.master" AutoEventWireup="true"
CodeFile="Admin_Home.aspx.cs" Inherits="Admin_Home" %>
4.1.1.18 Admin_home.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
}
4.1.1.19 Admin_Listofreporters.aspx
<%@ Page Title="" Language="C#"
MasterPageFile="~/Admin_Pages/Admin.master" AutoEventWireup="true"
CodeFile="Admin_ListofReporters.aspx.cs"
Inherits="Admin_Pages_Admin_ListofReporters" %>
onselectedindexchanging="GridView_ReporterDetail_SelectedIndexChanging"
PageIndex="5" PageSize="5"
onselectedindexchanged="GridView_ReporterDetail_SelectedIndexChanged"
RowHeaderColumn="3">
<Columns>
<asp:BoundField DataField="Reporter_id" HeaderText="ID"
ReadOnly="True" SortExpression="Reporter_id" />
<asp:TemplateField HeaderText="First Name">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("reporter_firstname") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Gender">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Bind("reporter_gender") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Contact No.">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%#
Bind("reporter_contact") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date of Birth">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%#
Bind("reporter_dob") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Address">
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%#
Bind("reporter_address") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="E-Mail ID">
<ItemTemplate>
<asp:Label ID="Label8" runat="server" Text='<%#
Bind("reporter_emailid") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Login ID">
<ItemTemplate>
<asp:Label ID="Label9" runat="server" Text='<%#
Bind("reporter_loginid") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Password">
<ItemTemplate>
<asp:Label ID="Label10" runat="server" Text='<%#
Bind("reporter_password") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Country">
<ItemTemplate>
<asp:Label ID="Label11" runat="server" Text='<%#
Bind("reporter_country") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Language">
<ItemTemplate>
<asp:Label ID="Label12" runat="server"
Text='<%# Bind("[reporter_language ]") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Registration Date">
<ItemTemplate>
<asp:Label ID="Label15" runat="server"
Text='<%# Bind("reporter_registrationDate") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Blocked">
<ItemTemplate>
<asp:Label ID="Label16" runat="server"
Text='<%# Bind("[reporter_IsBlocked ]") %>'></asp:Label>
<asp:LinkButton ID="LinkButton_update" runat="server"
CausesValidation="false"
CommandName="Update"
Text="Change"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</center>
</asp:Content>
4.1.1.20 Admin_listofreporters.aspx.cs
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.Data.SqlClient;
using System.Configuration;
public partial class Admin_Pages_Admin_ListofReporters : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["MyString"].ConnectionStr
ing);
SqlDataAdapter da_grid;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Grid_bind();
}
}
void Grid_bind()
{
da_grid = new SqlDataAdapter("select * from reporter_table", con);
DataTable dt_grid = new DataTable();
da_grid.Fill(dt_grid);
GridView_ReporterDetail.DataSource = dt_grid;
GridView_ReporterDetail.DataBind();
}
protected void GridView_ReporterDetail_RowEditing(object sender,
GridViewEditEventArgs e)
{
GridView_ReporterDetail.EditIndex = e.NewEditIndex;
Grid_bind();
}
protected void GridView_ReporterDetail_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
GridViewRow gvr = GridView_ReporterDetail.Rows[e.RowIndex];
string scurrent = ((Label)gvr.FindControl("Label16")).Text;
string sfirstname = ((Label)gvr.FindControl("Label1")).Text;
}
protected void GridView_ReporterDetail_SelectedIndexChanging(object sender,
GridViewSelectEventArgs e)
{
}
protected void GridView_ReporterDetail_PageIndexChanging(object sender,
GridViewPageEventArgs e)
{
}
protected void GridView_ReporterDetail_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e)
{
GridView_ReporterDetail.EditIndex = -1;
Grid_bind();
}
protected void GridView_ReporterDetail_SelectedIndexChanged(object sender,
EventArgs e)
{
}
protected void button_block_Click(object sender, EventArgs e)
{
4.1.1.21 Admin_permission.aspx
<%@ Page Title="" Language="C#"
MasterPageFile="~/Admin_Pages/Admin.master" AutoEventWireup="true"
CodeFile="Admin_permissions.aspx.cs"
Inherits="Admin_Pages_Admin_permissions" %>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton_changepermission"
runat="server" CausesValidation="False"
CommandName="Edit" Text="Change"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</center>
</asp:Content>
4.1.1.22 Admin_permission.aspx.cs
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.Configuration;
using System.Data;
void bind()
{
da = new SqlDataAdapter("select * from Report_table", con);
da.Fill(dt);
gridview_reports.DataSource = dt;
gridview_reports.DataBind();
}
4.1.1.23 Reporter.master
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>News Mate</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../style.css" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<div id="wrapper">
<form id="form1" runat="server">
<!-- BEGIN header -->
<div id="header">
<p class="links">
<asp:LinkButton ID="Linkbutton_register" runat="server" Visible="false"
Text="Register" CausesValidation="false"
OnClick="Linkbutton_register_Click" />
<asp:LinkButton ID="Linkbutton_Login" CausesValidation="false"
Visible="false" runat="server" Text="LogIn"
OnClick="Linkbutton_Login_Click" />
</asp:Menu>
</asp:Panel>
<div class="break"></div>
</div>
<!-- end ads -->
<!-- begin search -->
<form class="search" action="home.aspx">
<input type="text" name="s" id="s" />
<button type="submit">Search</button>
</form>
<!-- end search -->
<div class="wrapper">
<!-- begin popular posts -->
<h2>Popular Posts</h2>
<ul>
<li><a href="home.aspx">Make Money Online Creating
Websites</a></li>
<li><a href="home.aspx">Top 100 Internet Marketing Tips</a></li>
<li><a href="home.aspx">Tutorial: How to add Videos in your
Post</a></li>
<li><a href="home.aspx">Sample Post Unordered List</a></li>
<li><a href="home.aspx">Sample Post Blockquote</a></li>
</ul>
<!-- end popular posts -->
<!-- begin flickr photos -->
<h2>Flickr Photos</h2>
<div class="flickr">
<a href="home.aspx">
<img src="images/_thumb3.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb4.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb5.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb6.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb7.jpg" alt="" /></a> <a
href="home.aspx">
<img src="images/_thumb8.jpg" alt="" /></a>
</div>
<!-- end flickr photos -->
<!-- begin featured video -->
<h2>Featured Video</h2>
<div class="video">
<img src="images/_video.jpg" alt="" />
</div>
<!-- end featured video -->
<!-- begin tags -->
<h2>Tags</h2>
<div class="tags"></div>
<!-- end tags -->
<!-- BEGIN left -->
<div class="l sbar">
<!-- begin categories -->
<h2>Categories</h2>
<ul>
<li><a href="home.aspx">Entertainment</a></li>
<li><a href="home.aspx">Fashion</a></li>
<li><a href="home.aspx">Internet</a></li>
<li><a href="home.aspx">Marketing</a></li>
<li><a href="home.aspx">Lifestyle</a></li>
<li><a href="home.aspx">Make Money</a></li>
<li><a href="home.aspx">Online</a></li>
<li><a href="home.aspx">Parenting</a></li>
</ul>
<!-- end categories -->
<!-- begin pages -->
<h2>Pages</h2>
<ul>
<li><a href="home.aspx">Home</a></li>
<li><a href="home.aspx">About</a></li>
<li><a href="home.aspx">Archives</a></li>
<li><a href="home.aspx">Links</a></li>
<li><a href="home.aspx">Contact</a></li>
<li><a href="home.aspx">Sitemap</a></li>
</ul>
<!-- end pages -->
</div>
<!-- END left -->
<!-- BEGIN right -->
<div class="r sbar">
<!-- begin archives -->
<h2>Archives</h2>
<ul>
<li><a href="home.aspx">August 2008</a></li>
<li><a href="home.aspx">July 2008</a></li>
<li><a href="home.aspx">June 2008</a></li>
<li><a href="home.aspx">May 2008</a></li>
<li><a href="home.aspx">April 2008</a></li>
<li><a href="home.aspx">March 2008</a></li>
</ul>
<!-- end archives -->
<!-- begin blogroll -->
<h2>Blogroll</h2>
<ul>
<li><a href="home.aspx">Carlos</a></li>
<li><a href="home.aspx">Digital Point Forum</a></li>
<li><a href="home.aspx">Eric's Photo Gallery</a></li>
<li><a href="home.aspx">Fashion Trends</a></li>
<li><a href="home.aspx">Google Scoreboard</a></li>
<li><a href="home.aspx">Marketing Forum</a></li>
</ul>
<!-- end blogroll -->
<!-- begin meta -->
<h2>Meta</h2>
<ul>
<li><a href="home.aspx">Login</a></li>
</ul>
<!-- end meta -->
</div>
<!-- END right -->
</div>
</div>
</form>
</div>
</body>
</html>
4.1.1.24 Reporter.master.cs
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.Configuration;
using System.Data;
4.1.1.25 Reporter_feedback.aspx
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<center>
<h1>Give us your FeedBack</h1>
<table>
<tr>
<td>
<span>Name</span>
</td>
<td>
<asp:TextBox ID="TextBox_name" runat="server" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="TextBox_name" ErrorMessage="Please enter your name"
Display="None" />
</td>
</tr>
<tr>
<td>
<span>Contact No.</span>
</td>
<td>
<asp:TextBox ID="Textbox_Contact" runat="server" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="Textbox_Contact" Display="None" ErrorMessage="Please enter
your Contact No." />
</td>
</tr>
<tr>
<td>
<span>EmailID</span>
</td>
<td>
<asp:TextBox ID="textbox_emailid" runat="server" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="textbox_emailid" Display="None" ErrorMessage="Please enter
your Email ID" />
<asp:RegularExpressionValidator runat="server"
ControlToValidate="textbox_emailid" Display="None" ErrorMessage="Please Enter
a valid E-Mail ID" ValidationExpression="\w+@\w+([-.]\w+)*\.\w+([-.]\w+)*" />
</td>
</tr>
<tr>
<td>
<span>FeedBack</span>
</td>
<td>
<asp:TextBox ID="TextBox_feedback" runat="server" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="TextBox_feedback" Display="None" ErrorMessage="Please
enter your feedback" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="button_submit" runat="server" Text="Submit"
onclick="button_submit_Click" />
<asp:Button ID="button_reset" runat="server" Text="Reset"
onclick="button_reset_Click" />
</td>
</tr>
<asp:ValidationSummary runat="server" ShowMessageBox="true"
ShowSummary="false" />
</table>
</center>
</asp:Content>
4.1.1.26 Reporter_feedback.aspx.cs
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.Configuration;
public partial class Reporter_Feedback : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["Mystring"].ConnectionStri
ng);
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["reporter_Loginid"] == null)
{
Response.Redirect("reporter_home.aspx");
}
}
protected void button_submit_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("insert into FeedBack_Table values('"
+TextBox_name.Text+"',"
+Textbox_Contact.Text+",'"
+textbox_emailid.Text+"','"
+TextBox_feedback.Text+"',"
+DateTime.Now.ToShortDateString()+")", con);
con.Open();
int check=cmd.ExecuteNonQuery();
if (check > 0)
{
Response.Write("<script>alert('Thanks For YOur FeedBack')</script>");
}
con.Close();
}
protected void button_reset_Click(object sender, EventArgs e)
{
textbox_emailid.Text = "";
Textbox_Contact.Text = "";
TextBox_name.Text = "";
TextBox_feedback.Text = "";
}
}
4.1.1.27 Reporter_home.aspx
4.1.1.28 Reporter_home.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
}
4.1.1.29 Reporter_postreport.aspx
4.1.1.30 Reporter_postreport.aspx.cs
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.Configuration;
using System.Data;
using System.IO;
public partial class Reporter_Post_Report : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.ConnectionStrings["Mystring"].ConnectionStri
ng);
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["reporter_Loginid"] == null)
{
Response.Redirect("reporter_home.aspx");
}
else
{
if (!IsPostBack)
{
Ddl_Region();
Ddl_Category();
}
}
}
void Ddl_Region()
{
SqlDataAdapter dar = new SqlDataAdapter("select Region_name,region_ID
from Region_table", con);
DataTable dtr = new DataTable();
dar.Fill(dtr);
if (dtr.Rows.Count > 0)
{
DropDownList_Region.DataSource = dtr;
DropDownList_Region.DataTextField = "Region_name";
DropDownList_Region.DataValueField = "region_ID";
DropDownList_Region.DataBind();
}
}
void Ddl_Category()
{
SqlDataAdapter dac = new SqlDataAdapter("Select * from Category_Table",
con);
DataTable dtc = new DataTable();
dac.Fill(dtc);
if (dtc.Rows.Count > 0)
{
DropDownList_Category.DataSource = dtc;
DropDownList_Category.DataTextField = "Category_name";
DropDownList_Category.DataValueField = "category_ID";
DropDownList_Category.DataBind();
}
}
protected void Button_Submit_Click(object sender, EventArgs e)
{
uploadfile();
}
protected void Button_Reset_Click(object sender, EventArgs e)
{
textbox_headline.Text = "";
TextBox_Descripton.Text = "";
textbox_DetailedReport.Text = "";
con.Open();
int check = cmdinsert.ExecuteNonQuery();
if (check > 0)
{
Response.Write("<script>alert('Report Added successfully')</script>");
}
con.Close();
}
}
}
}
4.1.1.31 Reporter_registration.aspx
4.1.1.32 Reporter_registration.aspx.cs
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.Data.SqlClient;
using System.Configuration;
Response.Redirect("Reporter_LogIn.aspx");
}
}
void dropdownlist_country_bind()
{
SqlDataAdapter da_country = new SqlDataAdapter("select
Country_name,country_id from country_table",con);
DataTable dt_country = new DataTable();
da_country.Fill(dt_country);
ddlcountry.DataSource=dt_country;
ddlcountry.DataTextField = "country_name";
ddlcountry.DataValueField = "country_id";
ddlcountry.DataBind();
}
txtaddress.Text = "";
txtconpassword.Text = "";
txtcontact.Text = "";
txtdob.Text = "";
txtemail.Text = "";
txtfirstname.Text = "";
txtlastname.Text = "";
txtLoginID.Text = "";
txtmiddlename.Text = "";
txtpassword.Text = "";
txtqualifications.Text = "";
txtsecurityans.Text = "";
rblgender.ClearSelection();
ddlcountry.ClearSelection();
ddllanguage.ClearSelection();
ddlsecurityques.ClearSelection();
}
}
CHAPTER 5
SYSTEM TESTING
The aim of the system testing process was to determine all defects in our
project .The program was subjected to a set of test inputs and various observations
were made and based on these observations it will be decided whether the program
behaves as expected or not. Our Project went through two levels of testing
1. Unit testing
2. Integration testing
UNIT TESTING
Unit testing is undertaken when a module has been created and succesfully
reviewed .In order to test a single module we need to provide a complete environment
ie besides the module we would require
The procedures belonging to other modules that the module under test calls
Non local data structures that module accesses
A procedure to call the functions of the module under test with appropriate
parameters Unit testing was done on each and every module that is described under
module description of chapter 4 .
Reporter registration- In this section the admin can verify reporter details and then
only add reporter details to database it contains add and delete buttons if user click
add button data will be added to reporter database and if he clicks delete button the
reporter data will be deleted.
Test for Reporter login Form-This form is used for log in of Reporter.In this we
enter the Reporter id, and password if all these are correct Reporter login page will
redirect to the reporter section.Other wise if any of data is wrong it will get redirected
back to the login page and again ask for Reporter id, and password.
Test for account creation-This form is used for new account creation when Reporter
does not fill the form completely it asks again to fill the whole form when he fill the
form fully it gets redirected to page which show waiting for conformation message as
his data will be only added by administrator after verification.
INTEGRATION TESTING
In this type of testing we test various integration of the project module by providing
the input .The primary objective is to test the module interfaces in order to ensure that
no errors are occurring when one module invokes the other module.
CHAPTER 7
REFERENCES
http://www.w3schools.com/html/html_intro.asp
http://www.w3schools.com/css/css_background.asp
http://www.w3schools.com/js/js_datatypes.asp
http://www.w3schools.com/sql/sql_insert.asp
http://www.w3schools.com/sql/sql_update.asp
http://www.w3schools.com/php/php_forms.asp
Fundamentals of software engineering by Rajib mall, PHIlearning
Web development and application development by Ivan Byross BPB publications