Click here to load reader
Upload
armaan-amit
View
187
Download
9
Tags:
Embed Size (px)
Citation preview
MEGA MART ADVERTISEMENT
RELEASEMANAGEMENT
For the partial fulfillment of Bachelor in Technology in COMPUTER SCIENCE AND ENGINEERING
Submitted ByAMIT
SAMEER KU. SAHUMADHUSMITA SENAPATY
NIBEDITA NAIKMAYOOR KU. JAIN
SHIBA PRASAD SAHU
Under the guidance ofProf. R.K.MOHANTY
Prof. MANMATH NATH DAS
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERINGGANDHI INSTITUTE FOR TECHNOLOGY,
BHUBANESWAR
1
CERTIFICATE
This is to certify that the project report entitled MEGA MART ADVERTISMENT
RELEASE MANAGEMENT is being submitted by Amit, Sameer Ku. Sahu,
Madhusmita Senapaty, Nibedita Naik, Mayoor Ku. Jain, Shibaprasad Sahu in
partial fulfillment of Degree of Bachelor in Technology in Computer Science
and Technogogy to Biju Patnaik University of Technology, is a record of
bonafied work carried out by them under my guidance and supervision. The
results embodied in this project report have not been submitted to any other
University or Institute for the award of any degree.
Guide Prof. R.K.MOHANTYProf. MANMATH NATH DAS HOD (CSE)
Dept. Of COMPUTER SCIENCE AND ENGINEERING
2
ACKNOWLEDGEMENT
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.
We express our deep sense of gratitude and appreciation to Head of Computer
Science & Engineering department Prof. R.K.MOHANTY and our guide Prof.
MANMATH NATH DAS for their constant valuable guidance and help in
implementing our project report.
We further take this opportunity to thank all the staff members of our college for
taking active participation and providing us all the necessary data and statistics
during the preparation of our report so as to make it a great success.
AMIT SAMEER KU. SAHOO
MADHUSMITA SENAPATYNIVIDETA NAIK
MAYOOR KU. JAINSIBA 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.
CONTENTSCHAPTERS 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
7. Analysis……………………………………………………..19
4
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:
10.5.4 acceptance testing:
10.5.5 white box testing:
10.5.6 black box testing: 10.6 test information flow: 10.7 system security
11. Future scope of the Project…………………………….....73
1. INTRODUCTION
Purpose
Ad release and its maintenance is a very huge database. This database is a very sensitive part for any organization as on it depends, more or less the entire marketing. It requires a very keen and careful handling. By using this database, the person concerned for this section can update or retrieve any query he/she wants as per the requirement. As the whole organization is depending on this database so it needs to be under high security. Passwords in suitable sections help in enhancing the security level of the database. It is well managed by the authority concerned for the various segments of the database.
Intended Audience and Reading Suggestions
This document is intended for the referral of the following section of readers:
5
Developers Project Managers Users Testers Documentation Writers Mega mart and Forum mart Managers Advertisers
Project Scope
This project of Mega Mart Ad Release Management is to be integrated with the existing advertisement and marketing System. This will be added as a new feature to the ad release and maintenance department so that it will provide better publishing facilities for the firm and aims at the proper and easy management of the ad articles and market scenario.
References
This document includes the following references: Data Flow Diagram Data Model Diagram (E-R Diagram) Various User Interfaces
2. Overall Description Product Perspective
This product is going to be implemented against an existing system as it is more user-friendly and efficient. Using this software the concerned authority can enter the data via an interface which will be stored in the database, rather than directly manipulating with the database. It takes less time to enter an 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
The product contents are6
Entering User Id and password in the Login screen. Viewing Advertisement pricing details. Viewing Strategy report. Entering Advertisement pricing details. Budget Allocation by the manager. All the data should be saved to database generating unique records. Display message to the user.
Entering User Id and Password in the login screen:-
Here basically the persons associated or authorized with the database management are allowed to access. They are prior provided with a user name and a password to access the database or the main field of work. The user name is the identity through which they are known to the database and the password they enter for their user name is like a key to the lock at the database house. However, the password can be changed from time to time but not the user name. The user name gives the database the information about the user who is logging in.
Viewing Advertisement pricing details:-
Here the individual, whether it is a staff or an official or the developer or the customer (the public) can view the advertising details. The details can be the pricing details, the discounts on some articles, the exciting offers, and all valid stores for that advertisement.
Viewing Strategy report:-
Here basically the manager or an official, who is held the authority to supervise and overview all the advertisement and marketing management, takes a look of the scenario from here. He studies and reviews the marketing details from a report called the strategy report. No staff or the users are allowed to access this part.
7
Entering Advertisement pricing details:-
Here the staff and the manager or the official-in-charge of ad creation or ad release department enters their ads for the products along with the pricing details. Again here the pricing details include every bit of the rating details like the prices, the offers, the discounts, etc. Both the users and the manager can do this.
Budget Allocation by the manager:-
The pricing is basically dependant on a budget that is thought and decided by the manager-in-charge of the firm’s marketing and advertisement department. The staff or the person who creates and releases the ads for the mega mart or the forum mart is allowed to put up ads only in the decided budget. The manager is the one who decides a budget for the advertisements of the products. A new budget cannot be taken up while the old one is yet to be accomplished.
All the data should be saved to database generating unique records:-
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.
Display message to the user:-
The user being the final audience has the access to all the ads that the mega mart releases for its marketing purpose. But not to the database, of course. The user can see all the ads and use them for
8
buying the corresponding products. In case, the user is faced with some difficulties or violates or exceeds any term or condition of marketing, that is pre-defined, he is prompted with pre-defined messages. Also the user is provided with messages at required steps and times. This makes the interface more user friendly.
.
User Classes and Characteristics
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
The operating environment of this software is:1. Software required
i) Windows (Vista, 7, Xp)ii) NET 3.5/4.0iii) Visual Studio 2008/2010 iv) MYSQL
2. Hardware requiredi) Primary Disk RAM (min 512 MB)ii) Secondary Devices
i.1) Hard Disk (min 40 GB) i.2) External Disk
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
9
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.
3.2 Operational Feasibility:
The client has limited access. The client can access those informations
from the server which are being authenticated by the server.
3.3 Economical Feasibility
The project can be set up with minimal cost.
Since, all features regarding a management are available in this application, the
user need not to install different softwares.
10
4.Software Paradigm Used
A prototype model has been used that suggests that a working prototype of the
system should be built before carrying out the development of the actual software.
A prototype is a toy implementation of the system. By constructing the prototype
and submitting it for user evaluation, many customer requirements get properly
defined and technical issues get resolved by experimenting with the prototype
which finally minimizes the change requests from the customer and the associated
redesign costs.
The software engineering paradigm is also called a process model. A process model
for software engineering is chosen based on the nature of the project and
application, the methods and tools to be used, and the controls and deliverables
that are required.
In this project, System Development Life Cycle (SDLC) model is used. The various
phase of this method can be described briefly follows.
11
Fig: Prototyping model of software development
12
Phase What is done? What is the end
product?
Requiremen
ts
Determinati
on
Determine requirements to be
met by System being compiled.
Set of priorities
Requiremen
ts
Speciation
Draw up understandable plan of
what the system will provide as
outputs.
Determine needs and priority by
consensus among end users.
Detailed specifications of
information to be
provided.
Feasibility
Study
Taking into account available
resources such as human,
computers, time and money and
find whether specified
requirements can be met.
Feasibility Document
specifying resource
needs and availability.
Expected costs vs.
Benefits of the system
are carried
System
Design
Logical design of programs, design
of databases, test and
implementation plan.
Design programs.
Database, test plan.
System
Evolution
Find out from users if system
meets their requirement.
Evaluation report with
suggestion to improve.
System
Modification/
Maintenance
Change system, adding or
deleting features to satisfy
users(modified) needs
Improved system
containing modifications
and improvement
13
5.Hardware / Software
Requirements
5.1 Hardware Specifications
Hardware Used:
Microprocessor : Intel Pentium core 2 Duo
Processor Speed : 1.8GHz
Main Memory : 256 MB
Secondary Memory : 40 GB
Secondary Memory Speed : 1024 MHz
RAM Capacity : 512 MB
5.2 Software Specifications
Operating System: Windows (XP, Vista, 7)
Front End: NET 3.5/4.0
Web browser: Mozilla, Netscape
Other Supporting Software: Visual Studio 2008/2010Back End: MySQL
14
6. System FeaturesThis 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.
6.2) Staff Report page
The staff, after they login can see the data or ad details entered by them. The ads are sorted and viewed only in descending order of the applicable rates. And this is always.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.
6.3) Manager Report page
15
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.
External Interface Requirements
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 boxeso Border Style = fixed 3D
Buttonso Font Size = 10, bold
Style = Microsoft Sans Serif Forms
o Back Color = light cyan Labels
o Font Size = 10, boldo 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.
16
Other Nonfunctional Requirements
Performance Requirements
The project of Mega Mart Ad Release Management will be having the following business logic which has been decided after consulting with the users, who are the consumers and the public. They are listed below:
The database should be properly maintained for the efficient working of the software.
Enough data storage capacity should be there. The project should be user friendly and understandable. There should low coupling and high cohesion. The information and data need to be accurate and true. The pricing details and its validation should be mentioned very clearly
and precisely. The entire user requirement should be met.
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 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
17
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.
After studying and analyzing we concluded that the following details of the software
are required. The pictorial representation is the best way to represent the collection of
data at the time of analysis and represents in the form of HIPO diagram (Modular
Description), DFD (Data Flow Diagram), ERD (Entity Relationship Diagram) etc. The
pictorial representation provides better understandable approach for development.
Data flow Diagram
A dataflow diagram is a graphical representation that depicts information flow and the
transform that are applied as data move from input and output. The basic forms of a
Data Flow Diagram also move from known as a Data Flow Graph or a Bubble Chart. The
data flow diagram (DFD) shows the functional relationships of the values computed by
18
a system including input values and output values and internal data store. A data flow
diagram is graph showing the flow of data values.
In 0-level DFD shows how a visitor can register and how the registered user can login
to the software and access various options.
The level-1 DFD shows that a visitor enters the registration details and these details are
verified. The new registration details are send back to the database registered user and
the username is given to the visitor. Registered user can directly login with his/her
username and process the options but if the user enters any incorrect username or
password then he/she has to re-enter.
Types of Data Flow Diagram:
Logical Data Flow Diagrams
Physical Data Flow Diagrams
19
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.
20
Data flow symbol:
The Data Flow symbol represents movement of data.
Data Store Symbol
The Data Store symbol represents data that is saved on some file or in a table in
the database.
Process Symbol
The Process symbol represents an activity that transforms or manipulates the
data (A process transforms incoming data flow into outgoing data flow).
Data flow diagram
Fig: DFD level 0
Level 1
21
AD RELEASE MANAGE
MENT SYSTEM
0.0
MANAGER STAFFGIVES DATA
GIVES DATA
GETS DATAGETS DATA
Fig : DFD level 1
22
ADMGT_TIME_SLOT_TB
ADMGT_BUDGET_TB
ADMGT_DURATION_TB
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GET DATA
STAFF
GIVES USERID & PWDMANAG
ER MANAGE-MENT
1.0
STAFF MANAGE-MENT
2.0
MANAGER
ADMGT_LOGIN_TB
ADMGT_AD_IDS_TB
ADMGT_CHANNEL_TB
GIVES USERID & PWD
MAINTAINS STAFF
DETAILS
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA GIVES DATA GET DAT
A
Level 2
LEVEL-2 OF MANAGER
23
VALIDATION1.1
BUDGET ALLOCAT
ION1.2
MANAGER
ADMGT_LOGIN_TB
ADMGT_CHANNEL_TBADMGT_AD_IDS_TB
ADMGT_TIME_SLOT_TB
ADMGT_BUDGET_TB
ADMGT_DURATION_TB
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GIVES USERID & PSW MAINTAIN
S
LEVEL -2 OF STAFF
An Entity Relationship Diagram Description: -
E-R diagram is one of the pictorial representation in which the meaningful relationships
are entitled between various entities. It represents the real world application. The
24
VALIDATION2.1
AD ENTRY
2.2
STAFF
ADMGT_LOGIN_TB
ADMGT_CHANNEL_TBADMGT_AD_IDS_TB
ADMGT_TIME_SLOT_TB
ADMGT_BUDGET_TB
ADMGT_DURATION_TB
MAINTAINS
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GIVES DATA
GIVES USERID & PSW
relationship is used in data modeling to represent an association between entities.
This association has certain characteristic properties represented by the attributes of
the relationship set.
Fig: Entity relationship diagram
8. SCREEN SHOTS:-
25
ADMGT_DURATION_TB
ADMGT_AD_IDS_TB
ADMGT_BUDGET_TB
ADMGT_TIME_SLOT_TB
ADMGT_CHANNEL_TB
ADMGT_LOGIN_TB
USES
USES
USES
USES
MAIN-TAINS
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();}
protected void Application_Start(Object sender, EventArgs e){
}
protected void Session_Start(Object sender, EventArgs e){
}
protected void Application_BeginRequest(Object sender, EventArgs e){
}
protected void Application_EndRequest(Object sender, EventArgs e){
}
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
26
}
protected void Application_Error(Object sender, EventArgs e){
}
protected void Session_End(Object sender, EventArgs e){
}
protected void Application_End(Object sender, EventArgs e){
}
#region Web Form Designer generated code/// <summary>/// Required method for Designer support - do not modify/// the contents of this method with the code editor./// </summary>private void InitializeComponent(){
this.components = new System.ComponentModel.Container();}#endregion
}}
AssemblyInfo.csusing 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
27
// Revision//// 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">
28
<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"><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}
#region Web Form Designer generated codeoverride protected void OnInit(EventArgs e){
//// CODEGEN: This call is required by the ASP.NET Web Form
Designer.//InitializeComponent();base.OnInit(e);
}
/// <summary>/// Required method for Designer support - do not modify/// the contents of this method with the code editor./// </summary>private void InitializeComponent(){ }#endregion
}}
29
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"
30
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 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:requiredfieldvalidator 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
31
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;
namespace Group_17{
/// <summary>/// Summary description for WebForm1./// </summary>public partial class WebForm1 : System.Web.UI.Page{
protected void Page_Load(object sender, System.EventArgs e){}
#region Web Form Designer generated codeoverride protected void OnInit(EventArgs e){
//// CODEGEN: This call is required by the ASP.NET Web Form
Designer.//InitializeComponent();base.OnInit(e);
}
/// <summary>/// Required method for Designer support - do not modify/// the contents of this method with the code editor./// </summary>private void InitializeComponent(){
}#endregion
protected void btnLogin_Click(object sender, System.EventArgs e){
SqlConnection con=new SqlConnection("data source=.;database=master;uid=sa;password=renny");
con.Open();
32
SqlCommand cmd=new SqlCommand("select ROLE from ADMGT_LOGIN_TB where PK_LOGIN_USER_NAME='"+ txtUser.Text+"' and
PASS_WORD='"+txtPass.Text+"'",con);
string dr=Convert.ToString(cmd.ExecuteScalar());Session["ROLE"]=dr;Session["PK_LOGIN_USER_NAME"]=txtUser.Text;
if(dr=="mgr"){
Response.Redirect("Manager_Report.aspx");}else if(dr=="staff"){
Response.Redirect("Staff_Report.aspx");}else{
lblInvalidUser.Text="Invalid User Name or Password";lblInvalidUser.Visible=true;
}}
protected void btnReset_Click(object sender, System.EventArgs e){
lblInvalidUser.Visible=false;txtUser.Text="";txtPass.Text="";
}
protected void lnkbtnForgotPass_Click(object sender, System.EventArgs e)
{if(txtUser.Text==""){
lblInvalidUser.Text="Please enter user name";lblInvalidUser.Visible=true;
}else{
SqlConnection con = new SqlConnection("data source=.;database=master;uid=sa;password=renny");
con.Open();
SqlCommand cmd=new SqlCommand("select PK_LOGIN_USER_NAME from ADMGT_LOGIN_TB where
PK_LOGIN_USER_NAME='"+txtUser.Text+"'",con);
int returnval=Convert.ToInt32(cmd.ExecuteScalar());if(returnval<=0){
lblInvalidUser.Text="Username InValid";lblInvalidUser.Visible=true;
33
}else{
lblInvalidUser.Visible=false;Server.Transfer("Forgot_Password.aspx");
}
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;
34
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 Logout_Page./// </summary>public partial class Logout_Page : System.Web.UI.Page{
protected void Page_Load(object sender, System.EventArgs e){}
#region Web Form Designer generated codeoverride protected void OnInit(EventArgs e){
//// CODEGEN: This call is required by the ASP.NET Web Form
Designer.//InitializeComponent();base.OnInit(e);
}
/// <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">
35
<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"><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"
36
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"
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"
37
runat="server" Text="Insert New Record" Width="120px" BackColor="Silver" ForeColor="Navy" onclick="btnInsertRec_Click"></asp:Button></form>
</body></HTML>
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{
protected void Page_Load(object sender, System.EventArgs e){
if(!Page.IsPostBack){
lblGridHead.Visible=false;grdInsert.Visible=false;btnInsertRec.Visible=false;lblMessage.Visible=false;
}}
#region Web Form Designer generated codeoverride protected void OnInit(EventArgs e){
//// CODEGEN: This call is required by the ASP.NET Web Form
Designer.//InitializeComponent();base.OnInit(e);
}
/// <summary>/// Required method for Designer support - do not modify
38
/// the contents of this method with the code editor./// </summary>private void InitializeComponent(){
this.dgView.PageIndexChanged += new System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.dgView_PageIndexChanged);
}#endregion
protected void btnStrategy_Click(object sender, System.EventArgs e){
if(Session.Count>1){
Session["temp"]=0;bind(0);
}else{
Server.Transfer("Login_Page.aspx");}
}void bind(int x ){
if(x==0){
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=="mgr"){
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 order by APPLICABLE_RATE DESC";
}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="Strategy Report of the Staff";lblGridHead.Visible=true;lblMessage.Visible=false;
}
39
else{
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=="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;
}}
protected void btnBudget_Click(object sender, System.EventArgs e)
{if(Session.Count>1){
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=="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;
40
lblGridHead.Text="Budget Allocation Report";lblGridHead.Visible=true;btnInsertRec.Visible=true;grdInsert.Visible=false;lblMessage.Visible=false;
}else{
Server.Transfer("Login_Page.aspx");}
}
protected void btnInsertRec_Click(object sender, System.EventArgs e)
{txtBudget.Text="";txtStartDate.Text="";txtEndDate.Text="";grdInsert.Visible=true;dgView.Visible=false;btnInsertRec.Visible=false;lblMessage.Visible=false;clnEndDate.Visible=false;clnStartDate.Visible=true;
}
protected void btnAddRec_Click(object sender, System.EventArgs e)
{int flag=0;lblMessage.Text="";lblMessage.Visible=false;
SqlConnection con = new SqlConnection("data source=.;database=master;uid=sa;password=renny");
con.Open();string StrQuery="select
PK_BUDGET_START_DATE,END_DATE from ADMGT_BUDGET_TB";SqlCommand cmd=new SqlCommand(StrQuery,con);SqlDataReader dr=cmd.ExecuteReader();if(txtStartDate.Text!="") {
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;}
}
41
con.Close();
if(flag==1){
lblMessage.Visible=true;lblMessage.Text="Record cannot be
inserted";}else{
string insQuery="insert into ADMGT_BUDGET_TB values("+Convert.ToDouble (txtBudget.Text)+","+
txtStartDate.Text+","+txtEndDate.Text+")";con.Open();SqlCommand cmd1=new
SqlCommand(insQuery,con);int rowsret=cmd1.ExecuteNonQuery();if(rowsret<0){
lblMessage.Visible=true;lblMessage.Text="Record Insertion
Failed";}else{
lblMessage.Visible=true;lblMessage.Text="Record
Successfully Inserted";}txtBudget.Text="";txtStartDate.Text="";txtEndDate.Text="";con.Close();
}}else{
lblMessage.Visible=true;lblMessage.Text="Enter valid Date";
}
}
protected void btnReset_Click(object sender, System.EventArgs e)
{txtBudget.Text="";txtStartDate.Text="";txtEndDate.Text="";lblMessage.Visible=false;txtStartDate.Text="";txtEndDate.Text="";lblMessage.Text="";clnStartDate.Visible=true;clnEndDate.Visible=false;
}
42
protected void btnLogout_Click(object sender, System.EventArgs e)
{Server.Transfer("Logout_Page.aspx");
}
private void dgView_PageIndexChanged(object source, System.Web.UI. WebControls.DataGridPageChangedEventArgs e)
{dgView.CurrentPageIndex=e.NewPageIndex;
dgView.DataBind();int x=Convert.ToInt16(Session["temp"]);bind(x);
}
protected void dgView_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
protected void clnStartDate_SelectionChanged(object sender, System.EventArgs e)
{clnEndDate.Visible=false;
txtStartDate.Text=clnStartDate.SelectedDate.ToShortDateString();if(txtStartDate.Text!=""){
clnStartDate.Visible=false;clnEndDate.Visible=true;
}
}
protected void clnEndDate_SelectionChanged(object sender, System.EventArgs e)
{
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>
43
<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"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"
44
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"
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:dropdownlist 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:dropdownlist 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:label 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"
45
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"
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{
protected void Page_Load(object sender, System.EventArgs e){
dgAdsView.Visible=true;
46
StaffData();lblReport.Visible=true;grdPrompt.Visible=false;grdInsertRec.Visible=false;
}
public void StaffData(){
if(Session.Count>1){
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");}
}
#region Web Form Designer generated codeoverride protected void OnInit(EventArgs e){
//// CODEGEN: This call is required by the ASP.NET Web Form
Designer.//InitializeComponent();base.OnInit(e);
}
/// <summary>/// Required method for Designer support - do not modify
47
/// the contents of this method with the code editor./// </summary>private void InitializeComponent(){
this.dgAdsView.PageIndexChanged += new System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.dgAdsView_PageIndexChanged);
}#endregion
private void dgAdsView_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
protected void btnInsertNew_Click(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();
}
protected void btnLogout_Click(object sender, System.EventArgs e){
Server.Transfer("Logout_Page.aspx");}
protected void ddlChannel_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 channelStr="select PK_CH_ID from ADMGT_CHANNEL_TB where CHANNEL_NAME='"+ddlChannel.SelectedValue+"'";
con.Open();SqlCommand cmd=new SqlCommand(channelStr,con);string channelidStr=Convert.ToString(cmd.ExecuteScalar());string timeslotStr="select TIME_SLOT from ADMGT_TIME_SLOT_TB
where FK_TIME_SLOT_CH='"+channelidStr+"'";
48
SqlDataAdapter da=new SqlDataAdapter(timeslotStr,con);DataSet ds=new DataSet();da.Fill(ds);ddlTimeslot.DataSource=ds;ddlTimeslot.DataTextField=ds.Tables[0].Columns[0].ColumnName;ddlTimeslot.DataBind();con.Close();
}
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();
}
protected void ddlDuration_SelectedIndexChanged(object sender, System.EventArgs e)
{dgAdsView.Visible=false;grdInsertRec.Visible=true;lblReport.Visible=false;grdPrompt.Visible=false;int num=Convert.ToInt16(txtNumTimes.Text);
SqlConnection con = new SqlConnection("data source=.;database=master;uid=sa;password=renny");
con.Open();string apprateStr="select APPLICABLE_RATE from ADMGT_DURATION_TB
where AD_DURATION='"+ddlDuration .SelectedValue+"'";SqlCommand cmd=new SqlCommand(apprateStr,con);lblAppRate.Text=Convert.ToString(cmd.ExecuteScalar());
double total=(num*(Convert.ToDouble(lblAppRate.Text)));
49
double price=total-(total*(Convert.ToDouble((Convert.ToDouble(lblDiscountPer.Text))/100)));
lblTotalPrice.Text=Convert.ToString(price);con.Close();
}
protected void btnAddRec_Click(object sender, System.EventArgs e){
if(lblAppRate.Text!=""){
int flag=0;dgAdsView.Visible=false;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();
50
}
else{
lblResponse.Text="Unable to Insert an empty record";dgAdsView.Visible=false;lblReport.Visible=false;grdPrompt.Visible=false;grdInsertRec.Visible=true;lblResponse.Visible=true;
}
}
protected void btnReset_Click(object sender, System.EventArgs e){
dgAdsView.Visible=false;grdInsertRec.Visible=true;lblReport.Visible=false;lblResponse.Visible=false;grdPrompt.Visible=false;txtRecommendations.Text="";lblAppRate.Text="";lblDiscountPer.Text="";txtNumTimes.Text="";lblTotalPrice.Text="";
}
protected void btnView_Click(object sender, System.EventArgs e){
dgAdsView.Visible=true;lblResponse.Visible=false;StaffData();lblReport.Visible=true;grdInsertRec.Visible=false;
}
protected void btnOk_Click(object sender, System.EventArgs e){
if(lblAppRate.Text!=""){
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 tidQStr="select PK_TID from ADMGT_TIME_SLOT_TB where TIME_SLOT='"+ddlTimeslot.
SelectedValue+"'";
string userid=Convert.ToString(Session["PK_LOGIN_USER_NAME"]);
con.Open();SqlCommand cmd=new SqlCommand(tidQStr,con);string tidStr=Convert.ToString(cmd.ExecuteScalar());
51
string didQStr="select PK_DURA_DID from ADMGT_DURATION_TB where AD_DURATION='"+ddlDuration. SelectedValue+"'and
FK_DURATION_TIME_SLOT='"+tidStr+"'";
SqlCommand cmd1=new SqlCommand(didQStr,con);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)+")";
SqlCommand cmd2=new SqlCommand(insertQStr,con);int i=cmd2.ExecuteNonQuery();if(i<0){
lblResponse.Text="The Record Insertion failed";lblResponse.Visible=true;
}else{
lblResponse.Text="The Record has been Successfully Inserted";
lblResponse.Visible=true;}
con.Close();
}grdPrompt.Visible=false;
dgAdsView.Visible=false;grdInsertRec.Visible=true;lblReport.Visible=false;txtRecommendations.Text="";lblAppRate.Text="";lblDiscountPer.Text="";
}
protected void btnCancel_Click(object sender, System.EventArgs e){
dgAdsView.Visible=false;grdInsertRec.Visible=true;lblReport.Visible=false;lblResponse.Visible=true;txtRecommendations.Text="";lblAppRate.Text="";lblDiscountPer.Text="";grdPrompt.Visible=false;lblResponse.Text="Record Insert Cancelled";
}void insert(){
string tidQStr="select PK_TID from ADMGT_TIME_SLOT_TB where TIME_SLOT='"+ddlTimeslot. SelectedValue+"'";
52
string userid=Convert.ToString(Session["PK_LOGIN_USER_NAME"]);
SqlConnection con1 = new SqlConnection("data source=.;database=master;uid=sa;password=renny");
con1.Open();SqlCommand cmd=new SqlCommand(tidQStr,con1);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+"'";
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)+")";
SqlCommand cmd2=new SqlCommand(insertQStr,con1);int i=cmd2.ExecuteNonQuery();if(i<0){
lblResponse.Text="The Record Insertion failed";lblResponse.Visible=true;
}else{
lblResponse.Text="The Record has been Successfully Inserted";
lblResponse.Visible=true;}
}
private void dgAdsView_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{dgAdsView.CurrentPageIndex=e.NewPageIndex;//dgAdsView.DataSource=ds;dgAdsView.DataBind();
}
protected void txtRecommendations_TextChanged(object sender, System.EventArgs e)
{
}}
}
Web.config
53
<?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, 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></sectionGroup></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">
54
<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.
"On" Always display custom (friendly) messages. "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"
"None" No authentication is performed. "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to its settings for the application. Anonymous access must be disabled in IIS. "Forms" You provide a custom form (Web page) for users to enter their credentials, and then you authenticate them in your application. A user credential token is stored in a cookie. "Passport" Authentication is performed via a centralized authentication service provided by Microsoft that offers a single logon and core profile services for member sites. -->
<authentication mode="Windows"/><!-- AUTHORIZATION
This section sets the authorization policies of the application. You can allow or deny access to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous (unauthenticated) users. -->
<authorization><allow users="*"/><!-- Allow all users --><!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/> <deny users="[comma separated list of users]" roles="[comma separated list of roles]"/> -->
55
</authorization><!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every page within an application. Set trace enabled="true" to enable application trace logging. If pageOutput="true", the trace information will be displayed at the bottom of each page. Otherwise, you can view the application trace log by browsing the "trace.axd" page from your web application root. -->
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
<!-- SESSION STATE SETTINGS By default ASP.NET uses cookies to identify which requests belong to a particular session. 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">
56
<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"/><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></configuration>
57
10.Testing
Testing plays a critical role in quality assurance for software .Due to the limitation of
the verification method for the previous phases, 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 58
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 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
10.1 Independent Unit Test (IUT)
IUT focuses first on the modules, independently of one another, to locate errors. This
enables the tester to detect errors in coding and logic that are contained within that
module alone. Those resulting from the interaction between modules are initially
avoided.
IUT is generally white box oriented which is predicted on the close
examination of procedural detail. It exercises all the logical decisions on their true and
false side, executes all loops at their boundaries and within their operational bounds
and checks whether the required validations have been met. White box testing
exercises internal data structure to assure their validity.
59
10.2 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 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
Testing is the process of detecting errors. Testing performs a very critical role for
quality assurance and for ensuring the reliability of the software. The results of testing
are used later on during maintenance also.
Testing is vital to the success of the system. System testing makes a logical assumption
that if the parts of the system are correct, the goal will be successfully achieved. In
adequate testing or non-testing leads to errors that may not appear until months or
even years later (Remember the New York three day power failure due to a misplaced
‘Break’ statement).
This creates two problems:
1. The time lag between the cause and the appearance of the problem.
2. The time interval effect of the system errors on files and the records on the system.
A small error can conceivably explode into a much larger problem. Effective testing
early in the process translates directly into long term cost savings from a reduced
number of errors.
Another reason for system testing is its utility as a user oriented vehicle before
implementation. The best program is worthless if it does not meet the user
requirements. Unfortunately, the user’s demands are often compromised by efforts to
facilitate program or design efficiency in terms of processing time or design efficiency.
Thus in this phase we went to test the code we wrote. We needed to know if the code
compiled with the design or not? Whether the code gave the desired outputs on given
inputs? Whether it was ready to be installed on the user’s computer or some more
modifications were needed?
61
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:
1. The content of the Intranet site is reviewed to uncover Content errors. Content Errors
covers the typographical errors, grammatical errors, errors in content consistency,
graphical representation and cross referencing errors
2. The design model of the web application is reviewed to uncover the navigation errors.
Use cases, derived as a part of the analysis activity allows a web designer to exercise
each usage scenario against the architectural and navigational design. In essence these
non-executable tests help to uncover the errors in navigation.
3. When web applications are considered the concept of unit changes. Each web page
encapsulates content navigation links, content and processing elements. It is not
always possible to test each of these individually. Thus is the base of the web
applications the unit to be considered is the web page. Unlike the testing of the
algorithmic details of a module the data that flows across the module interface, page
level testing for web applications is driven by content, processing and links
encapsulating the web page.
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
The modules are integrated and integration test are conducted.
1. Thread based testing is done to monitor the regression tests so that the site does not
become very slow is a lot of users are simultaneously logged on.
2. A controlled and monitored population of end users tests Intranet application, this all
comprises of the User Acceptance Testing.
Because web application evolves continuously, the testing process is an ongoing
activity, conducted by web support staff in our case the Organization’s IS people who
will finally update and manage the application.
10.3 PSYCHOLOGY OF TESTING
The aim of testing is often to demonstrate that a program works by showing that it has
no errors. The basic purpose of testing phase is to detect the errors that may be
present in the program. Hence one should not start testing with the intent of showing
that a program works, but the intent should be to show that a program doesn’t work.
Testing is the process of executing a program with the intent of finding errors.
10.4 TESTING OBJECTIVES
The main objective of testing is to uncover a host of errors, systematically and with
minimum effort and time. Stating formally, we can say,
63
1. Testing is a process of executing a program with the intent of finding an error.
2. A successful test is one that uncovers an as yet undiscovered error.
3. A good test case is one that has a high probability of finding error, if it exists.
4. The tests are inadequate to detect possibly present errors.
5. The software more or less confirms to the quality and reliable standards.
10.5 LEVELS OF TESTING
In order to uncover the errors present in different phases, we have the concept of
levels of testing. The basic levels of testing are
64
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.
10.5.2 Integration Testing
After unit testing, we have to perform integration testing. The goal here is to see if
modules can be integrated properly, the emphasis being on testing interfaces between
modules. This testing activity can be considered as testing the design and hence the
emphasis on testing module interactions.
In this project the main system is formed by integrating all the modules. When
integrating all the modules I have checked whether the integration effects working of
any of the services by giving different combinations of inputs with which the two
services run perfectly before Integration.
10.5.3 SYSTEM TESTING
65
Here the entire software system is tested. The reference document for this process is
the requirements document, and the goal is to see if software meets its requirements.
Here entire ‘HRRP’ has been tested against requirements of project and it is checked
whether all requirements of project have been satisfied or not.
10.5.4 ACCEPTANCE TESTING
Acceptance Testing is performed with realistic data of the client to demonstrate that
the software is working satisfactorily. Testing here is 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.
10.5.5 WHITE BOX TESTING
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.
66
White-box test focuses on the program control structure. Test cases are derived
to ensure that all statement in the program control structure. Test cases are derived to
ensure that all statement in the program control structure. Test cases are derived to
ensure that all statement in the program has been executed at least once during
testing and that all logical conditions have been exercised. Basis path testing, a white
box technique, makes use of program graphs (or graph matrices) to derive the set of
linearly independent test that will ensure coverage. Condition and data flow testing
further exercising degrees of complexity.
10.5.6 BLACK BOX TESTING
Probes the program’s ability to handle data at the limits of acceptability. This
testing method considers a module as a single unit and checks the unit at interface and
communication with other modules rather getting into details at statement level. Here
the module will be treated as a block that will take some input and generate output.
Output for a given set of input combinations are forwarded to other modules.
Black-box test are designed to uncover errors functional requirement without
regard to the internal workings of a program. Black-box testing techniques focus on
the information domain of the software, deriving test cases by partitioning the input
and output domain of a program in manner that provides through test coverage. The
black-box test is used to demonstrate that software functions are operational, that
input is properly produced, and that the integrity of external information are
maintained. A black-box test examines some fundamental aspect of a system with little
or no regard for the integral logical structure of the software.
67
Graph based testing methods explore the relationship between and behavior of
program objects. Equivalence partitioning divides the input classes of data are likely to
exercise specific software function. Boundary values analysis
10.6 TEST INFORMATION FLOW
A strategy for software testing may also be viewed in the context of the spiral. Unit
testing begins at the vortex of the spiral and, concentrates on each unit, component of
the software as implemented in source code. Testing progresses moving outward along
the spiral to integration testing, where the focus is on designed the construction of the
software architecture. Taking another turn outward on spiral, we encounter validation
testing, where requirements established as part of software requirements analysis are
validated against the software that has been constructed. Finally, we arrive at system
testing, where the software and other system elements are tested as a whole. To test
computer software, we spiral out along stream lines that broaden the scope of testing
with each turn.
Considering the process from a procedural point of view, testing within the
context of software engineering is actually a series of four steps that are implemented
sequentially. The steps are shown in Figure. Initially, tests focus on each component
individually, ensuring that it functions properly as unit. Hence, the name is unit testing.
Unit testing makes heavy use of white-box testing techniques, exercising specific paths
in module’s control structure to ensure complete coverage and maximum error
detection.
68
69
10.7 SYSTEM SECURITY
There are basically two types of security associated with this system:-
10.7.1. Physical security
Damage due to natural causes like earth tremor, flooding, water logging, fire hazards,
atmospheric or environmental conditions etc.For overcoming these difficulties the
replica of the data are automatically stored at various networks and for environmental
conditions Air conditioning environment is created.
10.7.2. Data security
There are basically two problems associated with data security:-
1. Data not being available to the authorized person at the time of need.
2. Data becoming available to the unauthorized person.
To overcome these difficulties the following access facilities has been provided:-
i) Identification:-
Unique Ids for the different users have been provided.
ii) Authentication:-
System checks the password under the particular user identification. The computer
permits the various resources to the authorized person.
iii) Authorization:-
The access control mechanism to prevent unauthorized logging to the system.
70
11. Future scope of the Project
This way of advertisement can enhance the market
scenario and competition much better.
It also is going to decrease the total duration and efforts
put in publicity part of a mega mart.
More user friendly for the customers and the
publishers.
71