Mega Mart Project
Mega Mart Project
Mega Mart Project
ADVERTISEMENT
RELEASE
MANAGEMENT
For the partial fulfillment of Bachelor in Technology in
COMPUTER SCIENCE AND ENGINEERING
Submitted By
AMIT
SAMEER KU. SAHU
MADHUSMITA SENAPATY
NIBEDITA NAIK
MAYOOR KU. JAIN
SHIBA PRASAD SAHU
1
CERTIFICATE
ACKNOWLEDGEMENT
2
Behind every student who ascends the height of success and
achievement has a group effort and it is reflected in this project.
We cannot undermine the role and responsibility of the people who
were instrumental in extending all possible support for preparation
of this project report.
AMIT
SAMEER KU. SAHOO
MADHUSMITA SENAPATY
NIVIDETA NAIK
MAYOOR KU. JAIN
SIBA PRASAD SAHOO
ABSTRACT
3
We can widespread our knowledge in the field of
MARKETING. In this system we can innovatively create
ads and can use them for publicity of the mega mart.
We can find out their effectiveness and hence, can
study the market along with the customers’ mind set.
Mega Mart wanted to revive its brand image ,so it hired
an ad agency for it.The ad agency came up with brilliant
ideas for marketing.They created ads of all types like
audio, video, print media etc.The task of managing
these ads was huge and they wanted a software
developed to manage the process better.
CONTENTS
CHAPTERS PAGE
NO:
1. Introduction ............................................................................6
2. Overall Description..…………………………………………7
3. Feasibility……………………………………………………11
3.1 Technical Feasibility:
3.2 Operational Feasibility:
3.3 Economical Feasibility:
4. Software paradigm used…………………………………….12
5. Hardware & software requirements……………………........15
5.1 Hardware Specifications:
5.2 Software Specifications:
6. System Features………………………………………….......16
6.1 login page
6.2 Staff Report page
6.3 Manager Report Page
4
7. Analysis……………………………………………………..19
Functional Requirements:
. Data flow Diagram
. An Entity Relationship Diagram Description:
8. Screen shots …………………………………………….......27
9. Coding ………………………………………………………28
10. Testing……………………………………………………….60
10.1 independent unit tests (iut):
10.2 system testing:
10.3 psychology of testing:
10.4 testing objectives:
10.5 levels of testing:
10.5.1 unit testing:
10.5.2 integration testing:
10.5.3 system testing:
1. INTRODUCTION
Purpose
This document is intended for the referral of the following section of readers:
• Developers
5
• Project Managers
• Users
• Testers
• Documentation Writers
• Mega mart and Forum mart Managers
• Advertisers
Project Scope
References
Overall Description
Product Perspective
6
item as only some selections need to be done rather than entering the values
manually. And can be viewed publicly without any tempering in it.
Product Features
All the ads, the budget, the pricing details, the valid dates for the
ads and so on, whatever it is created `by the staff or the manger,
every data is required to be added and saved in the existing
database of the mega mart. Every data or record that is entered and
saved in the database is of significance and is unique. No duplicate
data are entertained in the database.
This software will be generally used by the staff and member, manager or the
official-in-charge of advertisement management of the mega mart. But the
authentication of various users is different.
Operating Environment
9
User Documentation
After the completion of the project, the user will be not provided with a User
Manual like other software. But shall definitely have a pamphlet or a booklet
depending upon the type of the ad released. If the ad is on a medium like
internet (website), he/she shall have a ‘help column’ on the page of display
itself. if the ad is a audio or video one the users shall be given with the
booklet with every detail in it. And a brochure if it’s a home to home
advertisement. This lets the user help in knowing the product efficiently, so
that they don’t regret about their decision of having spent their money on an
advertised product.
3.Feasibility
3.1 Technical Feasibility
• Proposed project is beneficial only if it can turn
into an online system that will meet the
requirement.
• .NET is also platform independent. It operates
at the server side and provides output at the
client end.
• It will run in those clients in which visual studio
are installed.
11
Fig:
Prototyping model of
software
development
12
System Change system, adding or Improved system
Modification/ deleting features to satisfy containing modifications
Maintenance users(modified) needs and improvement
5.Hardware / Software
Requirements
Secondary Memory : 40 GB
13
5.2 Software Specifications
Operating System: Windows (XP, Vista, 7)
Front End: NET 3.5/4.0
6. System Features
This section illustrates organizing the functional requirements for the product
by system features, the major services provided by the product.
6.1) Login page
The login page is the first page before entering into the database and
account
section of the department.
Here the Login screen is required to allow only validated users to use the
application.
The Login screen, allows the user to enter his/her User Id and Password.
On validating the user he/she is redirected to the next page depending on
whether he’s staff or manager.
In case the User forgets his password by clicking on the forgotten
password link, he’s directed to another page which displays a message
stating ‘password has been sent to his mail id’.
This is done only when the User enters a valid user id.
14
The staff can only enter the new Ad details and is not allowed to modify or
delete any records.
All the data and ads are unique and different from each other. Duplicate
and null data is not allowed.
Once the details are entered they are saved into the database. This is done
for every new data.
If the applicable rate is more than the budget amount then a prompt is
generated whether he still wants to save the record else the record is saved
normally.
Managers are allowed to view the details of the Ads created by the staff
members.
Here also the ads are sorted and viewed in the descending order of the
applicable rate in order to allocate budget.
The manager creates a new budget after viewing the strategy report in
which he enters the details of the budget.
The budget allocation page contains the following columns-
a) Budget amount
b) Start date and
c) End date of the budget.
A new budget cannot be created until the existing tenure is completed.
The manager is the only person authorized to prepare budgets.
User Interfaces
The interfaces are to be prepared using the platform of vb.Net (Visual Studio
2005).The standards that will be used for the designing of the interfaces are as
follows:
• Text boxes
o Border Style = fixed 3D
• Buttons
o Font Size = 10, bold
• Style = Microsoft Sans Serif
15
• Forms
o Back Color = light cyan
• Labels
o Font Size = 10, bold
o Style = Microsoft Sans Serif
Software Interfaces
The interfaces are connected to the database that stores all the details that are
required for the working of the project as per the user requirement. The
database is prepared using MYSQL server 2005.
Performance Requirements
Security Requirements
For the security reasons, the user authentications are to be given as follows:
1. Administrator
o Creating an user
Here the administrator has the power to create a new user
who can access the accounts section. Here the individual can
be the staff or the manager.
o Deleting an user
16
Here the administrator has the power to delete any user,
means he has the authority to deprive any user from
accessing the accounts section. The users here can be the
staff or the manager.
o Changing the password
Here the administrator can change the password of any part
of the part of the complete database.
o Assigning authority to other users
Here the administrator has the power to assign authority to
any outside user to access the accounts section, i.e., the
database (only some restricted pages) in view mode only.
2. Manager
o This person has the authority to estimate and prepare a budget, can
change the budget.
o He / she can take important decisions regarding any transaction.
o Can do any sort of manipulations in the database.
o Can punish his peers.
After the Administrator, the manager is the only very important person.
7. Analysis
Functional Requirements:
This project is for to make campus recruitment drive of a college online, so that a student
can access about the Upcoming Company, package, date. Student can also view their
result on college website. Placement officer can also get information about students’
record anywhere. They can modify and update the record.
18
• External Entity:
The External Entity symbol represents sources of data to the
system, or destinations of data from the system. i.e. a Person, a
System, or an organization that sends or receives data.
AD
GIVES RELEASE GIVES
DATA
MANAGER DATA MANAGE ADMGT_AD_IDS_TB
STAFF
MENT GETS
GETS DATA
DATA SYSTEM
GIVES DATA GIVES DATA GET
DAT
0.0 A
GIVES ADMGT_CHANNEL_TB
DATA
GIVES
DATA
Fig: DFD levelGIVES
0
GIVES
DATA
DATA
GIVES MAINTAINS GIVES
USERID STAFF USERID
MANAG DETAILS STAFF
& PWD & PWD
ER MANAG
MANAGER MANAG STAFF
E-MENT
E-MENT 2.0
1.0
GIVES
DATA GIVES
DATA
GET DATA
ADMGT_DURATION_TB
ADMGT_TIME_SLOT_TB
20
ADMGT_BUDGET_TB
Fig : DFD level 1
Level 2
21
ADMGT_LOGIN
ADMGT_CHANNEL_TB
_TB ADMGT_AD_IDS_TB
GIVES
GIVES
DATA GIVES
DATA
DATA
BUDGET
VALIDAT
ALLOCA ADMGT_DURATION_T
ION
TION B
1.1 GIVES
1.2 DATA
ADMGT_TIME_SLOT_T ADMGT_BUDGET_TB
B
VALIDATI AD
ON ENTRY GIVES
DATA
2.1 2.2 ADMGT_DURATION_T
B
STAFF GIVES
DATA
GIVES
DATA
22
ADMGT_TIME_SLOT_T ADMGT_BUDGET_TB
B
LEVEL -2 OF STAFF
23
MAI
ADMGT_BUDGE
N- ADMGT_LOGIN_
T_TB
TAI TB
NS
US
ES
ADMGT_CHANNE ADMGT_AD_IDS
L_TB _TB
US US
ES ES
ADMGT_TIME_SLO ADMGT_DURATIO
T_TB US N_TB
ES
8. SCREEN SHOTS:-
24
9.CODING
Application Code
Global.asax.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
namespace Group_17
{
/// <summary>
/// Summary description for Global.
/// </summary>
public class Global : System.Web.HttpApplication
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
public Global()
{
InitializeComponent();
}
25
}
AssemblyInfo.cs
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
26
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name)
utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the "project output directory". The location of the project
output
// directory is dependent on whether you are working with a local or web
project.
// For local projects, the project output directory is defined as
// <Project Directory>\obj\<Configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// For web projects, the project output directory is defined as
// %HOMEPATH%\VSWebCache\<Machine Name>\<Project
Directory>\obj\<Configuration>.
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
Forgot_Password.aspx*
<%@ Page language="c#" Inherits="Group_17.WebForm4"
CodeFile="Forgot_Password.aspx.cs" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>ForGot Password...</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
27
<body bgColor="aliceblue" onload="javascript:history.go(1)">
<form id="Form1" method="post" runat="server">
<br><br><br><br><br><br><br><br><br><br><br><br><br>
<h5>Pass word sent to your E-mail address</h5>
</form>
</body>
</HTML>
Forgot_Password.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Group_17
{
/// <summary>
/// Summary description for WebForm4.
/// </summary>
public partial class WebForm4 : System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
}
}
28
Global.asax
<%@ Application Inherits="Group_17.Global" Language="C#" %>
Login_Page.aspx
<%@ Page language="c#" Inherits="Group_17.WebForm1" CodeFile="Login_Page.aspx.cs"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Mega Mart Ad Agency</title>
</HEAD>
<BODY bgColor="aliceblue" onload="javascript:history.go(1)">
<P align="center">
<asp:Label id="lblHeader" runat="server" ForeColor="Indigo"
BackColor="AliceBlue" Width="920px"
Font-Size="X-Large" Height="64px" BorderStyle="Double"
BorderColor="AliceBlue" Font-Bold="True"
Font-Italic="True"> MEGA MART VIDEO-ADS
MANAGEMENT</asp:Label>
<meta content="Microsoft Visual Studio .NET 7.1"
name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</P>
<form id="Form1" method="post" runat="server">
<DIV style="Z-INDEX: 101; BORDER-LEFT-COLOR: dimgray; LEFT:
430px; BORDER-BOTTOM-COLOR: dimgray; WIDTH: 512px; BORDER-TOP-COLOR: dimgray;
POSITION: absolute; TOP: 128px; HEIGHT: 320px; BACKGROUND-COLOR: lavender; BORDER-
RIGHT-COLOR: dimgray"
align="right" id="grdLogin" title="Login Form"
runat="server"><asp:label id="lblUsername" style="Z-INDEX: 101; LEFT: 40px;
POSITION: absolute; TOP: 64px"
runat="server" ForeColor="Navy">Username
*</asp:label><asp:label id="lblPass" style="Z-INDEX: 102; LEFT: 40px; POSITION:
absolute; TOP: 120px" runat="server"
ForeColor="Navy">Password *</asp:label><asp:button
id="btnLogin" style="Z-INDEX: 103; LEFT: 40px; POSITION: absolute; TOP: 176px"
runat="server"
ForeColor="Navy" Width="72px" Text="Login"
BackColor="Silver" onclick="btnLogin_Click"></asp:button><asp:button id="btnReset"
style="Z-INDEX: 106; LEFT: 160px; POSITION: absolute; TOP: 176px"
runat="server" ForeColor="Navy" Width="73px"
Text="Reset" CausesValidation="False" BackColor="Silver"
onclick="btnReset_Click"></asp:button><asp:label id="lblGridHead" style="Z-INDEX:
105; LEFT: 160px; POSITION: absolute; TOP: 8px"
runat="server" ForeColor="Indigo" Width="100px" Font-
Size="Medium" Font-Italic="True" Font-Bold="True">Login
29
Form</asp:label><asp:requiredfieldvalidator id="rfvUsername" style="Z-INDEX: 107;
LEFT: 320px; POSITION: absolute; TOP: 64px"
runat="server" ForeColor="Sienna" Width="168px"
ErrorMessage="Please Enter the UserName"
ControlToValidate="txtUser"></asp:requiredfieldvalidator><asp:requiredfieldvalidato
r id="rfvPassword" style="Z-INDEX: 108; LEFT: 320px; POSITION: absolute; TOP:
120px"
runat="server" ForeColor="SaddleBrown" Width="168px"
ErrorMessage="Please Enter the Password"
ControlToValidate="txtPass"></asp:requiredfieldvalidator>
<asp:LinkButton id="lnkbtnForgotPass" style="Z-INDEX: 109;
LEFT: 16px; POSITION: absolute; TOP: 224px"
runat="server" ForeColor="Navy" Width="140px"
CausesValidation="False" onclick="lnkbtnForgotPass_Click">Forgot Password ?
</asp:LinkButton>
<asp:Label id="lblInvalidUser" style="Z-INDEX: 110; LEFT:
192px; POSITION: absolute; TOP: 224px"
runat="server" Width="264px"></asp:Label>
<asp:Label id="lblMessage" style="Z-INDEX: 111; LEFT:
256px; POSITION: absolute; TOP: 176px"
runat="server" ForeColor="Navy" Width="176px">*
Fields are mandatory</asp:Label>
<asp:TextBox id="txtPass" style="Z-INDEX: 105; LEFT: 160px;
POSITION: absolute; TOP: 120px" runat="server"
BackColor="#E0E0E0"
TextMode="Password"></asp:TextBox>
<asp:TextBox id="txtUser" style="Z-INDEX: 104; LEFT: 160px;
POSITION: absolute; TOP: 64px" runat="server"
BackColor="#E0E0E0"></asp:TextBox></DIV>
</form>
<DIV id="grdImage" style="WIDTH: 416px; POSITION: relative; HEIGHT:
400px" align="center"
noWrap runat="server">
<asp:Image id="imgSunrise" style="Z-INDEX: 101; LEFT: 8px;
POSITION: absolute; TOP: 8px" runat="server"
Width="400px" Height="175px" ImageUrl="Gaint_sparkler.jpg"
ImageAlign="Middle"></asp:Image>
<asp:Image id="imgSunset" style="Z-INDEX: 102; LEFT: 8px;
POSITION: absolute; TOP: 216px" runat="server"
Width="400px" Height="175px" BorderStyle="Dotted"
BorderColor="DarkGoldenrod" ImageUrl="Sunset_at_Murudeshwar.jpg"
ImageAlign="Middle"></asp:Image>
<asp:Label id="lblAdMessage" style="Z-INDEX: 103; LEFT: 48px;
POSITION: absolute; TOP: 184px"
runat="server" ForeColor="Purple" Width="354px" Font-
Size="Small" Font-Bold="True" Font-Italic="True">We Serve You from Dawn to
Dusk</asp:Label></DIV>
</BODY>
</HTML>
Login_Page.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
30
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;
namespace Group_17
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public partial class WebForm1 : System.Web.UI.Page
{
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
con.Open();
string dr=Convert.ToString(cmd.ExecuteScalar());
Session["ROLE"]=dr;
Session["PK_LOGIN_USER_NAME"]=txtUser.Text;
31
if(dr=="mgr")
{
Response.Redirect("Manager_Report.aspx");
}
else if(dr=="staff")
{
Response.Redirect("Staff_Report.aspx");
}
else
{
lblInvalidUser.Visible=false;
txtUser.Text="";
txtPass.Text="";
int returnval=Convert.ToInt32(cmd.ExecuteScalar());
if(returnval<=0)
{
lblInvalidUser.Text="Username InValid";
lblInvalidUser.Visible=true;
}
else
{
lblInvalidUser.Visible=false;
Server.Transfer("Forgot_Password.aspx");
}
32
con.Close();
}
}
Logout_Page.aspx
<%@ Page language="c#" Inherits="Group_17.Logout_Page"
CodeFile="Logout_Page.aspx.cs" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Logout_Page</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body bgColor="aliceblue" onload="javascript:history.go(1)">
<form id="Form1" method="post" runat="server">
<asp:Image id="imgLogout" style="Z-INDEX: 101; LEFT: 16px;
POSITION: absolute; TOP: 56px" runat="server"
Width="704px" Height="424px"
ImageUrl="Rays_of_hope.jpg"></asp:Image>
<marquee><h5>Thank You! You have Successfully Logged Out!
</h5></marquee>
<marquee></marquee>
</form>
</body>
</HTML>
Logout_Page.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
33
namespace Group_17
{
/// <summary>
/// Summary description for Logout_Page.
/// </summary>
public partial class Logout_Page : System.Web.UI.Page
{
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
}
}
Manager_Report.aspx
<%@ Page language="c#" Inherits="Group_17.WebForm2"
CodeFile="Manager_Report.aspx.cs" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm2</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body bgColor="aliceblue" onload="javascript:history.go(1)">
<form id="Form1" style="BACKGROUND-IMAGE: none; VERTICAL-ALIGN:
baseline; BORDER-TOP-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-LEFT-STYLE:
solid; BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: center; BORDER-BOTTOM-STYLE: solid"
method="post" runat="server">
34
<asp:Label id="lblMessage" style="Z-INDEX: 109; LEFT: 376px;
POSITION: absolute; TOP: 480px"
runat="server" ForeColor="Navy" BackColor="AliceBlue"
Width="224px" Height="27px"></asp:Label>
<asp:Button id="btnLogout" style="Z-INDEX: 108; LEFT: 568px;
POSITION: absolute; TOP: 544px"
runat="server" Text="Logout" Width="120px"
BackColor="Silver" ForeColor="Navy" onclick="btnLogout_Click"></asp:Button>
<asp:button id="btnStrategy" style="Z-INDEX: 107; LEFT: 216px;
POSITION: absolute; TOP: 544px"
runat="server" Text="Strategy Report" Width="120px"
BackColor="Silver" ForeColor="Navy" onclick="btnStrategy_Click"></asp:button>
<asp:button id="btnBudget" style="Z-INDEX: 106; LEFT: 384px;
POSITION: absolute; TOP: 544px"
runat="server" Text=" Budget Report" Width="120px"
BackColor="Silver" ForeColor="Navy" BorderColor="DarkGray"
onclick="btnBudget_Click"></asp:button><asp:label id="lblHeader" style="Z-INDEX:
101; LEFT: 280px; POSITION: absolute; TOP: 32px"
runat="server" ForeColor="DarkGreen" BackColor="AliceBlue"
Width="393px" Height="32px" Font-Italic="True" Font-Size="Large" Font-
Bold="True">Management Reports</asp:label>
<DIV id="grdInsert" style="Z-INDEX: 103; LEFT: 232px; WIDTH:
638px; POSITION: absolute; TOP: 104px; HEIGHT: 356px; BACKGROUND-COLOR: aliceblue"
runat="server">
<asp:Button id="btnAddRec" style="Z-INDEX: 101; LEFT: 56px;
POSITION: absolute; TOP: 280px"
runat="server" Text="Add Record" Width="120px"
BackColor="Silver" ForeColor="Navy" BorderColor="Silver"
onclick="btnAddRec_Click"></asp:Button>
<asp:Button id="btnReset" style="Z-INDEX: 102; LEFT: 224px;
POSITION: absolute; TOP: 280px"
runat="server" Text="Reset" Width="120px"
BackColor="Silver" ForeColor="Navy" BorderColor="LightGray"
onclick="btnReset_Click"></asp:Button>
<asp:Label id="lblEndDate" style="Z-INDEX: 103; LEFT: 48px;
POSITION: absolute; TOP: 216px"
runat="server" Width="120px" BackColor="Transparent"
ForeColor="Navy" Height="10px">End Date</asp:Label>
<asp:Label id="lblStartDate" style="Z-INDEX: 104; LEFT:
48px; POSITION: absolute; TOP: 160px"
runat="server" Width="120px" BackColor="Transparent"
ForeColor="Navy" Height="10px">Start Date</asp:Label>
<asp:Label id="lblBudget" style="Z-INDEX: 105; LEFT: 48px;
POSITION: absolute; TOP: 104px"
runat="server" Width="120px" BackColor="Transparent"
ForeColor="Navy" Height="10px">Budget Amount</asp:Label>
<asp:TextBox id="txtBudget" style="Z-INDEX: 106; LEFT:
200px; POSITION: absolute; TOP: 104px"
runat="server" BackColor="Gainsboro"></asp:TextBox>
<asp:TextBox id="txtStartDate" style="Z-INDEX: 107; LEFT:
200px; POSITION: absolute; TOP: 160px"
runat="server" BackColor="#E0E0E0">select date from
calendar</asp:TextBox>
<asp:TextBox id="txtEndDate" style="Z-INDEX: 108; LEFT:
200px; POSITION: absolute; TOP: 216px"
runat="server" BackColor="#E0E0E0">select date from
calendar</asp:TextBox>
<asp:Label id="lblInsert" style="Z-INDEX: 109; LEFT: 136px;
POSITION: absolute; TOP: 40px"
35
runat="server" Width="145px" BackColor="AliceBlue"
ForeColor="Navy" Height="24px" Font-Bold="True">Add New Record</asp:Label>
<asp:RegularExpressionValidator id="rfvBudget" style="Z-
INDEX: 110; LEFT: 384px; POSITION: absolute; TOP: 104px"
runat="server" ForeColor="Maroon"
ErrorMessage="Please enter valid amount" ControlToValidate="txtBudget"
ValidationExpression="\d{3,6}"></asp:RegularExpressionValidator>
<asp:Calendar id="clnStartDate" style="Z-INDEX: 111; LEFT:
368px; POSITION: absolute; TOP: 136px"
runat="server" Height="202px" Width="232px"
BackColor="AliceBlue" BorderColor="Gainsboro"
SelectMonthText="Next;Previous;"
PrevMonthText="Previous" NextMonthText="Next" SelectWeekText="Next"
onselectionchanged="clnStartDate_SelectionChanged"></asp:Calendar>
<asp:Calendar id="clnEndDate" style="Z-INDEX: 110; LEFT:
368px; POSITION: absolute; TOP: 136px"
runat="server" Height="174px" Width="232px"
SelectMonthText="Next;Previous" PrevMonthText="Previous"
NextMonthText="Next" SelectWeekText="Next"
onselectionchanged="clnEndDate_SelectionChanged"></asp:Calendar></DIV>
<asp:datagrid id="dgView" style="Z-INDEX: 104; LEFT: 80px;
POSITION: absolute; TOP: 144px" runat="server"
Height="258px" Width="864px" BorderColor="White"
HorizontalAlign="Center" AllowPaging="True"
PageSize="5" BorderStyle="Ridge" CellSpacing="1"
BorderWidth="2px" CellPadding="3" GridLines="None"
onselectedindexchanged="dgView_SelectedIndexChanged">
<SelectedItemStyle Font-Bold="True"
HorizontalAlign="Center" ForeColor="White" VerticalAlign="Middle"
BackColor="#9471DE"></SelectedItemStyle>
<EditItemStyle HorizontalAlign="Center"
VerticalAlign="Middle"></EditItemStyle>
<ItemStyle HorizontalAlign="Center" ForeColor="Black"
VerticalAlign="Middle" BackColor="#DEDFDE"></ItemStyle>
<HeaderStyle Font-Underline="True" Font-Bold="True"
HorizontalAlign="Center" ForeColor="Linen"
VerticalAlign="Middle"
BackColor="#4A3C8C"></HeaderStyle>
<FooterStyle ForeColor="Black"
BackColor="White"></FooterStyle>
<PagerStyle NextPageText="Next" Font-Size="Smaller" Font-
Names="Verdana" Font-Italic="True"
PrevPageText="Previous" HorizontalAlign="Right"
ForeColor="Navy" BackColor="Silver" PageButtonCount="5"></PagerStyle>
</asp:datagrid><asp:label id="lblGridHead" style="Z-INDEX: 105;
LEFT: 352px; POSITION: absolute; TOP: 80px"
runat="server" ForeColor="Navy" BackColor="AliceBlue"
Width="241px" Height="32px" Font-Italic="True" Font-Size="Larger"
Font-Bold="True"></asp:label>
<asp:Button id="btnInsertRec" style="Z-INDEX: 102; LEFT: 432px;
POSITION: absolute; TOP: 432px"
runat="server" Text="Insert New Record" Width="120px"
BackColor="Silver" ForeColor="Navy"
onclick="btnInsertRec_Click"></asp:Button></form>
</body>
</HTML>
36
Manager_Report.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
namespace Group_17
{
/// <summary>
/// Summary description for WebForm2.
/// </summary>
public partial class WebForm2 : System.Web.UI.Page
{
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dgView.PageIndexChanged += new
System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.dgView_PageIndexChan
ged);
37
}
#endregion
38
if(role=="mgr")
{
strQuery="select * from ADMGT_BUDGET_TB";
}
else
{
strQuery="";
}
SqlDataAdapter da=new SqlDataAdapter(strQuery,con);
DataSet ds=new DataSet();
da.Fill(ds);
dgView.DataSource=ds;
dgView.DataBind();
dgView.Visible=true;
lblGridHead.Text="Budget Allocation Report";
lblGridHead.Visible=true;
btnInsertRec.Visible=true;
grdInsert.Visible=false;
lblMessage.Visible=false;
}
}
userid=Convert.ToString(Session["PK_LOGIN_USER_NAME"]);
SqlConnection con = new SqlConnection("data
source=.;database=master;uid=sa;password=renny");
string strQuery="";
if(role=="mgr")
{
strQuery="select * from ADMGT_BUDGET_TB";
}
else
{
strQuery="";
}
SqlDataAdapter da=new
SqlDataAdapter(strQuery,con);
dgView.CurrentPageIndex=0;
DataSet ds=new DataSet();
Session["temp"]=1;
da.Fill(ds);
dgView.DataSource=ds;
dgView.DataBind();
dgView.Visible=true;
lblGridHead.Text="Budget Allocation Report";
lblGridHead.Visible=true;
btnInsertRec.Visible=true;
grdInsert.Visible=false;
lblMessage.Visible=false;
}
else
{
Server.Transfer("Login_Page.aspx");
39
}
}
DateTime dt=DateTime.Parse(txtStartDate.Text);
while(dr.Read())
{
DateTime
stdt=DateTime.Parse(Convert.ToString(dr.GetValue(0)));
DateTime
enddt=DateTime.Parse(Convert.ToString(dr.GetValue(1)));
if(dt<=stdt || dt<=enddt )
{
flag=1;
}
}
con.Close();
if(flag==1)
{
lblMessage.Visible=true;
lblMessage.Text="Record cannot be
inserted";
}
else
40
{
lblMessage.Visible=true;
lblMessage.Text="Enter valid Date";
}
41
dgView.CurrentPageIndex=e.NewPageIndex;
dgView.DataBind();
int x=Convert.ToInt16(Session["temp"]);
bind(x);
}
txtStartDate.Text=clnStartDate.SelectedDate.ToShortDateString();
if(txtStartDate.Text!="")
{
clnStartDate.Visible=false;
clnEndDate.Visible=true;
}
txtEndDate.Text=clnEndDate.SelectedDate.ToShortDateString();
}
}
Staff_Report.aspx
<%@ Page language="c#" Inherits="Group_17.WebForm3" CodeFile="Staff_Report.aspx.cs"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm3</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body bgColor="aliceblue" onload="javascript:history.go(1)">
<form id="Form1" method="post" runat="server">
<asp:label id="lblReport" style="Z-INDEX: 105; LEFT: 360px;
POSITION: absolute; TOP: 16px"
42
runat="server" Font-Bold="True" Font-Size="Larger"
ForeColor="DarkSlateGray" BackColor="#E0E0E0"
Width="184px">Individual Staff
Report</asp:label><asp:datagrid id="dgAdsView" style="Z-INDEX: 104; LEFT: 32px;
POSITION: absolute; TOP: 58px" runat="server"
Font-Size="Smaller" Width="904px" PageSize="5"
GridLines="Vertical" CellPadding="3" AllowSorting="True" BorderWidth="2px"
BorderStyle="None" BorderColor="MidnightBlue"
Height="289px">
<SelectedItemStyle Font-Bold="True"
HorizontalAlign="Center" ForeColor="White" VerticalAlign="Middle"
BackColor="#008A8C"></SelectedItemStyle>
<EditItemStyle HorizontalAlign="Center"
VerticalAlign="Middle"></EditItemStyle>
<AlternatingItemStyle HorizontalAlign="Center"
VerticalAlign="Middle" BackColor="Gainsboro"></AlternatingItemStyle>
<ItemStyle HorizontalAlign="Center" ForeColor="Black"
VerticalAlign="Middle" BackColor="#EEEEEE"></ItemStyle>
<HeaderStyle Font-Size="Smaller" Font-Names="Verdana" Font-
Italic="True" Font-Bold="True" BorderWidth="2px"
ForeColor="BlanchedAlmond" BorderStyle="Solid"
BorderColor="Gray" BackColor="#000084"></HeaderStyle>
<FooterStyle HorizontalAlign="Right" ForeColor="Black"
BackColor="#CCCCCC"></FooterStyle>
<PagerStyle NextPageText="Next" Font-Size="Smaller" Font-
Names="Verdana" Font-Italic="True"
PrevPageText="Previous" HorizontalAlign="Right"
ForeColor="Navy" Position="TopAndBottom"
BackColor="Silver"></PagerStyle>
</asp:datagrid>
<DIV id="grdPrompt" style="Z-INDEX: 118; LEFT: 224px; WIDTH:
368px; POSITION: absolute; TOP: 400px; HEIGHT: 168px"
runat="server"><asp:label id="lblPrompt"
style="Z-INDEX: 101; LEFT: -140px; POSITION: absolute; TOP:
10px" runat="server"
Font-Bold="True" Font-Size="Small"
ForeColor="MediumBlue" BackColor="Silver"
Width="208px"></asp:label><asp:button id="btnOk" style="Z-
INDEX: 102; LEFT: 24px; POSITION: absolute; TOP: 136px" runat="server"
Width="80px" Text="OK"
onclick="btnOk_Click"></asp:button><asp:button id="btnCancel" style="Z-INDEX: 103;
LEFT: 136px; POSITION: absolute; TOP: 136px"
runat="server" Width="80px" Text="Cancel"
onclick="btnCancel_Click"></asp:button></DIV>
<asp:button id="btnLogout" style="Z-INDEX: 124; LEFT: 536px;
POSITION: absolute; TOP: 520px"
runat="server" ForeColor="Navy" BackColor="LightGray"
Width="120px" Text="Logout" onclick="btnLogout_Click"></asp:button><asp:button
id="btnInsertNew" style="Z-INDEX: 124; LEFT: 304px; POSITION: absolute; TOP: 520px"
runat="server" ForeColor="Navy" Width="152px" Height="24px"
Text="Insert New Ad" onclick="btnInsertNew_Click"></asp:button>
<DIV id="grdInsertRec" style="Z-INDEX: 119; LEFT: 312px; WIDTH:
560px; POSITION: absolute; TOP: 48px; HEIGHT: 436px"
align="left" noWrap runat="server"><asp:label
id="lblChannel" style="Z-INDEX: 101; LEFT: 144px; POSITION: absolute; TOP: 48px"
runat="server" Width="120px" Height="10px">Channel
Name</asp:label><asp:label id="lblTimeslot" style="Z-INDEX: 102; LEFT: 144px;
POSITION: absolute; TOP: 80px"
43
runat="server" Width="120px" Height="10px">Time
Slot</asp:label><asp:label id="lblDuration" style="Z-INDEX: 103; LEFT: 144px;
POSITION: absolute; TOP: 200px"
runat="server" Width="120px"
Height="10px">Duration</asp:label><asp:label id="lblDiscount" style="Z-INDEX: 104;
LEFT: 144px; POSITION: absolute; TOP: 152px"
runat="server" Width="120px"
Height="10px">Discount</asp:label><asp:label id="lblApplicableRate" style="Z-INDEX:
106; LEFT: 144px; POSITION: absolute; TOP: 240px"
runat="server" Width="120px" Height="10px">Applicable
Rate</asp:label><asp:label id="lblRecommendations" style="Z-INDEX: 109; LEFT:
144px; POSITION: absolute; TOP: 320px"
runat="server" Width="120px"
Height="10px">Recommendations</asp:label><asp:dropdownlist id="ddlChannel"
style="Z-INDEX: 110; LEFT: 312px; POSITION: absolute; TOP: 48px"
runat="server" BackColor="#E0E0E0" Width="160px"
Height="10px" AutoPostBack="True"
onselectedindexchanged="ddlChannel_SelectedIndexChanged"></asp:dropdownlist><asp:dr
opdownlist id="ddlTimeslot" style="Z-INDEX: 111; LEFT: 312px; POSITION: absolute;
TOP: 80px"
runat="server" BackColor="#E0E0E0" Width="160px"
Height="10px" AutoPostBack="True"
onselectedindexchanged="ddlTimeslot_SelectedIndexChanged"></asp:dropdownlist><asp:d
ropdownlist id="ddlDuration" style="Z-INDEX: 112; LEFT: 312px; POSITION: absolute;
TOP: 200px"
runat="server" BackColor="#E0E0E0" Width="160px"
Height="10px" AutoPostBack="True"
onselectedindexchanged="ddlDuration_SelectedIndexChanged"></asp:dropdownlist><asp:l
abel id="lblDiscountPer" style="Z-INDEX: 113; LEFT: 312px; POSITION: absolute; TOP:
152px"
runat="server" ForeColor="Black" BackColor="#E0E0E0"
Width="160px" Height="10px"></asp:label><asp:label id="lblAppRate" style="Z-INDEX:
114; LEFT: 304px; POSITION: absolute; TOP: 240px"
runat="server" BackColor="#E0E0E0" Width="160px"
Height="10px"></asp:label><asp:textbox id="txtRecommendations" style="Z-INDEX: 115;
LEFT: 304px; POSITION: absolute; TOP: 320px"
runat="server" BackColor="#E0E0E0" Width="160px"
TextMode="MultiLine"
ontextchanged="txtRecommendations_TextChanged"></asp:textbox><asp:button
id="btnAddRec" style="Z-INDEX: 108; LEFT: 88px; POSITION: absolute; TOP: 376px"
runat="server" ForeColor="Navy" Width="114px"
Text="Add Record" onclick="btnAddRec_Click"></asp:button><asp:button id="btnReset"
style="Z-INDEX: 107; LEFT: 224px; POSITION: absolute; TOP: 376px"
runat="server" ForeColor="Navy" Width="114px"
Text="Reset" onclick="btnReset_Click"></asp:button><asp:label id="lblResponse"
style="Z-INDEX: 116; LEFT: 168px; POSITION: absolute; TOP: 416px"
runat="server" Width="192px"></asp:label><asp:button
id="btnView" style="Z-INDEX: 105; LEFT: 368px; POSITION: absolute; TOP: 376px"
runat="server"
ForeColor="Navy" Width="104px" Text="View Records"
onclick="btnView_Click"></asp:button><asp:label id="lblAdMessage" style="Z-INDEX:
117; LEFT: 176px; POSITION: absolute; TOP: 8px"
runat="server" Font-Size="Medium" ForeColor="Indigo"
BackColor="#E0E0E0" Width="232px" Font-Italic="True">Add
Advertisement Details</asp:label><asp:label id="lblTotal" style="Z-
INDEX: 118; LEFT: 144px; POSITION: absolute; TOP: 280px"
runat="server" Width="120px" Height="10px">Total
Price</asp:label><asp:label id="lblTotalPrice" style="Z-INDEX: 119; LEFT: 304px;
POSITION: absolute; TOP: 288px"
44
runat="server" BackColor="#E0E0E0" Width="152px"
BorderColor="White"></asp:label><asp:label id="lblNumTimes" style="Z-INDEX: 120;
LEFT: 144px; POSITION: absolute; TOP: 120px"
runat="server" Width="120px" Height="10px">Times Ad
displayed *</asp:label><asp:textbox id="txtNumTimes" style="Z-INDEX: 121; LEFT:
312px; POSITION: absolute; TOP: 120px"
runat="server"
BackColor="Gainsboro"></asp:textbox><asp:requiredfieldvalidator id="rfvTimes"
style="Z-INDEX: 122; LEFT: 480px; POSITION: absolute; TOP: 128px"
runat="server" ForeColor="Maroon" Width="72px"
ErrorMessage="Required"
ControlToValidate="txtNumTimes"></asp:requiredfieldvalidator></DIV>
</form>
</body>
</HTML>
Staff_Report.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;
using System.IO;
namespace Group_17
{
/// <summary>
/// Summary description for WebForm3.
/// </summary>
public partial class WebForm3 : System.Web.UI.Page
{
if(Session.Count>1)
{
45
string userid,role;
role=Convert.ToString(Session["ROLE"]);
userid=Convert.ToString(Session["PK_LOGIN_USER_NAME"]);
SqlConnection con = new SqlConnection("data
source=.;database=master;uid=sa;password=renny");
string strQuery="";
if(role=="staff")
{
strQuery= "select PK_AD_ID
[AdvertisementId],CHANNEL_NAME[ChannelName],TIME_SLOT[TimeSlot],AD_DURATION[Ad
Duration],APPLICABLE_RATE[Applicable Rate],DISCOUNT[Discount],NUM_TIMES[No oF
Times],TOTAL_PRICE[Total Price],RECOMMENDATIONS[Recommendations] from
ADMGT_AD_IDS_TB inner join ADMGT_DURATION_TB on
ADMGT_AD_IDS_TB.FK_AD_IDS_DURATION=ADMGT_DURATION_TB.PK_DURA_DID inner join
ADMGT_TIME_SLOT_TB on
ADMGT_DURATION_TB.FK_DURATION_TIME_SLOT=ADMGT_TIME_SLOT_TB.PK_TID inner join
ADMGT_CHANNEL_TB on ADMGT_TIME_SLOT_TB.FK_TIME_SLOT_CH=ADMGT_CHANNEL_TB.PK_CH_ID
where ADMGT_AD_IDS_TB.FK_AD_IDS_LOGIN='"+userid+"' order by APPLICABLE_RATE DESC";
}
else
{
strQuery="";
}
SqlDataAdapter da=new SqlDataAdapter(strQuery,con);
DataSet ds=new DataSet();
da.Fill(ds);
dgAdsView.DataSource=ds;
dgAdsView.DataBind();
}
else
{
Server.Transfer("Login_Page.aspx");
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dgAdsView.PageIndexChanged += new
System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.dgAdsView_PageIndexC
hanged);
}
#endregion
46
private void dgAdsView_SelectedIndexChanged(object sender,
System.EventArgs e)
{
dgAdsView.Visible=false;
grdInsertRec.Visible=true;
lblReport.Visible=false;
grdPrompt.Visible=false;
SqlConnection con = new SqlConnection("data
source=.;database=master;uid=sa;password=renny");
string strQuery="select CHANNEL_NAME from ADMGT_CHANNEL_TB";
SqlDataAdapter da=new SqlDataAdapter(strQuery,con);
DataSet ds=new DataSet();
da.Fill(ds,"channel");
ddlChannel.DataSource=ds;
ddlChannel.DataTextField=ds.Tables[0].Columns[0].ColumnName;
ddlChannel.DataBind();
con.Close();
47
protected void ddlTimeslot_SelectedIndexChanged(object sender,
System.EventArgs e)
{
dgAdsView.Visible=false;
grdInsertRec.Visible=true;
lblReport.Visible=false;
grdPrompt.Visible=false;
SqlConnection con = new SqlConnection("data
source=.;database=master;uid=sa;password=renny");
string timeStr="select PK_TID from ADMGT_TIME_SLOT_TB where
TIME_SLOT='"+ddlTimeslot.SelectedValue+"'";
con.Open();
SqlCommand cmd=new SqlCommand(timeStr,con);
string timeidStr=Convert.ToString(cmd.ExecuteScalar());
string discountStr="select DISCOUNT from ADMGT_TIME_SLOT_TB where
PK_TID='"+timeidStr+"'";
string adDurationStr="select AD_DURATION from ADMGT_DURATION_TB
where FK_DURATION_TIME_SLOT='"+timeidStr+"'";
SqlDataAdapter da=new SqlDataAdapter(adDurationStr,con);
DataSet ds=new DataSet();
da.Fill(ds);
ddlDuration.DataSource=ds;
ddlDuration.DataTextField=ds.Tables[0].Columns[0].ColumnName;
ddlDuration.DataBind();
SqlCommand cmd1=new SqlCommand(discountStr,con);
lblDiscountPer.Text=Convert.ToString(cmd1.ExecuteScalar());
con.Close();
double total=(num*(Convert.ToDouble(lblAppRate.Text)));
double price=total-
(total*(Convert.ToDouble((Convert.ToDouble(lblDiscountPer.Text))/100)));
lblTotalPrice.Text=Convert.ToString(price);
con.Close();
}
48
grdInsertRec.Visible=true;
lblReport.Visible=false;
grdPrompt.Visible=false;
SqlConnection con = new SqlConnection("data
source=.;database=master;uid=sa;password=renny");
DateTime currdt=DateTime.Now;
string dtStr="select * from ADMGT_BUDGET_TB";
con.Open();
SqlCommand dc=new SqlCommand(dtStr,con);
SqlDataReader dr=dc.ExecuteReader();
while(dr.Read())
{
DateTime
stdt=DateTime.Parse(Convert.ToString(dr.GetValue(1)));
DateTime
enddt=DateTime.Parse(Convert.ToString(dr.GetValue(2)));
if(currdt>=stdt && currdt<=enddt)
{
if(Convert.ToDouble(lblAppRate.Text)>Convert.ToDouble(dr.GetValue(0)))
{
grdPrompt.Visible=true;
grdInsertRec.Visible=false;
btnInsertNew.Visible=false;
btnLogout.Visible=false;
lblPrompt.Text="Ad Rate greater than
Budget ! Do you still want to continue?";
flag=1;
}
else
{
flag=0;
}
}
}
if(flag==0)
{
insert();
dr.Close();
con.Close();
}
else
{
lblResponse.Text="Unable to Insert an empty record";
dgAdsView.Visible=false;
lblReport.Visible=false;
grdPrompt.Visible=false;
grdInsertRec.Visible=true;
lblResponse.Visible=true;
}
49
}
string
userid=Convert.ToString(Session["PK_LOGIN_USER_NAME"]);
con.Open();
SqlCommand cmd=new SqlCommand(tidQStr,con);
string tidStr=Convert.ToString(cmd.ExecuteScalar());
string didQStr="select PK_DURA_DID from ADMGT_DURATION_TB
where AD_DURATION='"+ddlDuration. SelectedValue+"'and
FK_DURATION_TIME_SLOT='"+tidStr+"'";
txtRecommendations.Text+"','"+txtNumTimes.Text+"',"+Convert.ToDouble(lblTotalPrice.
Text)+")";
con.Close();
}
grdPrompt.Visible=false;
dgAdsView.Visible=false;
grdInsertRec.Visible=true;
lblReport.Visible=false;
txtRecommendations.Text="";
lblAppRate.Text="";
lblDiscountPer.Text="";
}
void insert()
{
string tidQStr="select PK_TID from ADMGT_TIME_SLOT_TB where
TIME_SLOT='"+ddlTimeslot. SelectedValue+"'";
string userid=Convert.ToString(Session["PK_LOGIN_USER_NAME"]);
51
SqlCommand cmd1=new SqlCommand(didQStr,con1);
string didStr=Convert.ToString(cmd1.ExecuteScalar());
string insertQStr="Insert into ADMGT_AD_IDS_TB
values('"+userid+"','"+didStr+"','"+
txtRecommendations.Text+"','"+txtNumTimes.Text+"',"+Convert.ToDouble(lblTotalPrice.
Text)+")";
}
}
}
Web.config
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting"
type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler"
type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
52
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" requirePermission="false"
allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices"
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization"
type="System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" requirePermission="false"
allowDefinition="Everywhere"/>
<section name="profileService"
type="System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" requirePermission="false"
allowDefinition="MachineToApplication"/>
<section name="authenticationService"
type="System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" requirePermission="false"
allowDefinition="MachineToApplication"/>
<section name="roleService"
type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
requirePermission="false"
allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGrou
p></configSections><appSettings>
<add key="DSN" value="Server=.;DATABASE=Group_17;USER ID=sa;PWD=sa"/>
</appSettings>
<system.web>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to enable ASPX debugging. Otherwise,
setting this value to
false will improve runtime performance of this application.
Set compilation debug="true" to insert debugging symbols (.pdb
information)
into the compiled page. Because this creates a larger file that executes
more slowly, you should set this value to true only when debugging and to
false at all other times. For more information, refer to the
documentation about
debugging ASP.NET files.
-->
<compilation defaultLanguage="c#" debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions,
Version=3.5.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom error
messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.
53
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to users not running
on the local Web server. This setting is recommended for security
purposes, so
that you do not display application detail information to remote
clients.
-->
<customErrors mode="RemoteOnly"/>
<!-- AUTHENTICATION
This section sets the authentication policies of the application.
Possible modes are "Windows",
"Forms", "Passport" and "None"
54
If cookies are not available, a session can be tracked by adding a
session identifier to the URL.
To disable cookies, set sessionState cookieless="true".
-->
<sessionState mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>
<!-- GLOBALIZATION
This section sets the globalization settings of the application.
-->
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
<xhtmlConformance mode="Legacy"/>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/></controls></pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false"
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/></httpModules></system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" warningLevel="4" compilerOptions="/d:DEBUG;TRACE">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError"
value="false"/></compiler>
<compiler language="vb;vbs;visualbasic;vbscript"
extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError"
value="false"/></compiler></compilers></system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
55
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*"
path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" verb="GET,HEAD"
path="ScriptResource.axd" preCondition="integratedMode"
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions"
publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0"
newVersion="3.5.0.0"/></dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design"
publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0"
newVersion="3.5.0.0"/></dependentAssembly></assemblyBinding></runtime></configurati
on>
10.Testing
Testing plays a critical role in quality assurance for software .Due to
the limitation of the verification method for the previous phases,
56
design and requirement fault also appear in the code. Testing is used
to detect these errors, in edition to the error introduced during coding
phase.
Testing is a dynamic method for verification and validation,
where the system is to be tested is executed and behavior of the
system is observed. Due to this testing the failure of the system can
be observed, from which the presence of fault can be deduced.
However, separate activities have to be performed to identify the
faults.
There are two method of testing: functional and structural. In
functional testing, the internal logic of the system under testing is not
considered and the test cases are decided from the specification or
the requirements. It is often called “Black Box Testing”. Equivalence
class partitioning, boundary analysis, and cause effect graphing are
examples of methods for selecting test cases for functional testing. In
structural testing, the test cases are decided entirely on the internal
logic of the program or module being tested.
As the goal of testing is to detect any errors in the programs
different flavor of testing are often used. Unit testing are used to test a
module or a small collection of modules and the focus is on detecting
coding errors in modules. During integration testing modules are
combined into sub-system, which are then tested. The goal here is to
test the system design. In system testing and acceptance testing, the
entire System is tested. The goal here is to test the requirement
themselves. Structural testing can be used for unit testing while at
higher level mostly functional testing is used.
In the project Monthly Materialization Report System we used
the unit testing and functional testing. System testing is a critical
57
phase in systems implementation. Testing of a system involves
hardware device testing and debugging of computer programs and
testing information processing procedures. Testing can be done with
test data, which attempts to simulate all possible conditions that may
arise during processing. The plane for testing are prepared and then
implemented.
The testing methods adopted in the testing of the system were
Independent Unit Testing and System Testing
Here the system testing involved is the most widely used testing
process consists of five stages as shown in the figure. In general, the
58
sequence of testing activities is component testing, integration testing
then user testing. However, as defects are discovered at any one
stage, they required program modifications to correct them and this
may required other stages in the testing process to be repeated.
60
Through the web applications are characteristically different from
there software counterparts but the basic approach for testing these
web applications is quite similar. These basic steps of testing have
been picked from software engineering practices. The following are
the steps, we undertook:
61
4. The Assembled web application is tested for overall functionality and
content delivery. The various user cases are used that test the system
for errors and mistakes.
5. The Web application is tested for a variety of environmental settings
and is tested for various configurations and upon various platforms.
62
10.4 TESTING OBJECTIVES
63
10.5.1 Unit testing
Unit testing focuses verification effort on the smallest unit of software
i.e. the module. Using the detailed design and the process
specifications, testing is done to uncover errors within the boundary of
the module. All modules must be successful in the unit test before the
start of the integration testing begins.
In this project each service can be thought of a module. There are so
many modules like Login, HR Department, Interviewer Section, etc.
Each module has been tested by giving different sets of inputs. When
developing the module as well as finishing the development, the
module works without any error. The inputs are validated when
accepting them from the user.
64
10.5.2 Integration Testing
65
focused on external behavior of the system; the internal logic of
program is not emphasized.
Test cases should be selected so that the largest number of attributes
of an equivalence class is exercised at once. The testing phase is an
important part of software development. It is the process of finding
errors and missing operations and also a complete verification to
determine whether the objectives are met and the user requirements
are satisfied.
This is a unit testing method, where a unit will be taken at a time and
tested thoroughly at a statement level to find the maximum possible
errors.
I tested step wise every piece of code, taking care that every
statement in the code is executed at least once. The white box testing
is also called Glass Box Testing.
I have generated a list of test cases, sample data, which is used to
check all possible combinations of execution paths through the code at
every module level.
67
10.6 TEST INFORMATION FLOW
68
69
10.7 SYSTEM SECURITY
There are basically two types of security associated with this
system:-
70
11. Future scope of the Project
71