Online Society Tracking: A Project Report On

Download as pdf or txt
Download as pdf or txt
You are on page 1of 187

A PROJECT REPORT ON

ONLINE SOCIETY TRACKING


Submitted by
MR. SAYED AFTAAB AHMED

[2025194]

Under the guidance of,


PROF. KAMAL JAIN SIR

Submitted in partial fulfillment of the requirements for qualifying


B.Sc.(CS), Semester – VI Examination

ACADMIC YEAR 2017-2018

ORIENTAL EDUCATION SOCIETY’S


SANPADA COLLEGE OF COMMERCE AND
TECHNOLOGY.

Sanpada (W) – 400705,


Navi Mumbai.

1
SANPADA COLLEGE OF COMMERCE AND TECHNOLOGY

CERTIFICATE

This is to Certify that the Project Entitled (ONLINE SOCIETY


TRACKING ) Undertaken at the Sanpada College of Commerce &
Technology by Mr SAYED AFTAAB AHMED , Seat no (2025194) in partial
fullfilment of B.Sc. CS degree (Semester-VI) Examination has not been
submitted for any other Examination and does not form part of any other
course undergone by the candidate.
It is further certified that he has completed All required phases of the project.

Signature of Internal Guide Signature of External

Signature of Co-Ordinator Signature of Principle

College Seal
2
ACKNOWLEDGEMENT

This Project, being a maiden experience for me, has been a big
confidence booster. Contributions of the following individuals / persons are
noteworthy. It gives me immense pleasure to acknowledge the innumerable
guidance extended to me by Mr.________ (Online Society Tracking). I extend
my sincere thanks to him who helped me in getting the details of the
processes of the shop. I would like to thank my classmates for their help in
ASP.NET.

In this endeavor I acknowledge the valuable contribution and


expert guidance of our internal project guide Prof. Kamal jain of
Department of Information Technology, Oriental college of commerce
and technology,sanpada(w)NaviMumbai-400 703. Her frank
suggestions for improvements & innovative ideas have inspired us.

I am greatly thankful to our Principal Mr Rao Saheb for his


continued and unending support. I also thank Prof. Smita Negi Head of
Information Technology Department for granting me permission to
work on this project.

I wish to express our gratitude to the staff of CS, department for their
co-operative & considerate approach. Last but not least, our sincere thanks
to College who gives us a great opportunity to grape the knowledge.

Students Signature,

MR. SAYED AFTAAB AHMED

T.Y.B.sc.(CS.)

3
INDEX

SR.NO TOPIC PAGE NO

1. ACKNOWLEDGEMENT

2. PRELIMINARY INVESTIGATION
Organizational Overview
Description of System
Limitations of present system
Proposed system & its advantages
Feasibility Study
Stakeholders,
technologies used
Gantt Chart
3. SYSTEM ANALYSIS
Fact Finding Techniques
Use Case Diagram
ERD
Activity Diagram
Class Diagram
Object Diagram
Sequence Diagram
4. SYSTEM DESIGN
ER Diagram
Converting ERD to Tables
5. SYSTEM CODING
Validation
Tests
6 SYSTEM IMPLEMENTATIONS
Form design
Coding
7. FUTURE ENHANCEMENT
8. CONCLUSION
9. REFERENCES

4
2.1 : Organizational Overview

Project is based on Packing and Moving related services for Re-alocation of household
and other heavy things.

Main facilities available in this project are:-

 Maintaining the details of the user who order for a packing and moving their
goods for one place to another place.
 Providing different types of service to user as per his needs and requirements.

Computerized quotation, Fast access to data, and Decrease consumption of time.

Systematic organization of records.

Also maintains the details via login process and record their order details.

Maintaining customer details (Name, Address, Phone No).

Maintaining availability of Date and Time as well as with Vehicles and Labours.

Details about the requirement of the Labours and Vehicle from the admin are maintained
properly.

Generation of Bill.

Systematic arrangement of all resources, Smooth functioning environment.

ORGANIZATIONAL CHART:

5
2.2 : Description Of System

In present non-computerized packers and movers management system all the jobs
are performed manually. All the records of Order ,User, Labour details ,vehicle details ,
Confirmed
are written in different register. Accountant will have to maintain all separate registers of each
new information. So managing them is very complex and has become a impossible task to be
performed manually systematic way. As the job is done manually, it has its own limitations
and lot’s of paperwork. This system maintain all the record in short memory space.
The daily and monthly records, which are done manually, are not easy to maintain in
files or registers, which can be destroyed anytime by any person. But in this system we can
store large amount of data & whenever we want we can see in few seconds.

Time required for searching records of particular day sale information is more. But this
system shows all dates information with all information. In present system entire work depend
upon sales and purchase. Billing is also done manually; it takes lots of time and throws open
doors manipulation and updating of records they can be done by cashier. Bill is not readable
which creates confusion in customer as well as Supplier. Any manual error can be lead to wrong
result.

6
2.3 : Limitation of Present System

The manually handled system is time consuming.

Data security is not assured.

It is difficult to maintain records in long run.

Daily and usual records are not maintained in proper manner.

Large number of manpower is required.

It is difficult to keep records in registers for long period of time


or for some months safely and securely.

It’s hectic to handle huge number of transactions.

7
2.4 : Proposed System

The Benefits of Computerized System:

It Facilitates quick processing of data

Data present in database in highly secure

Searching of data is done very easily & more efficiently.

It guarantees minimal or no data loss or data corruption.

Maintaining of data is very properly and accurately.

Information of any Customer can be retrieved within short period of time.

It provides a facility to modify records.

Information of each Customer with its record can be maintained in computer and
user will not have to maintain register / paperwork.

Report will be generated automatically.

8
2.5 : Advantage of Proposed System

All the information about customer, labours, vehicle, bills, will be maintain properly in this
system.

All manual calculation of realocation order or all the money management will be performed by
the computer automatically.

This system will provide timely report information.

It will produce report for customer and order,vehicle , labours.

The computer can hold amount of data in its storage device.

The operation and speed of the computer is very high.

We can calculate result and print any report within a second.

Most of the problems we can solve easily.

A database application can be stored in computer effectively.

It is very user friendly and easy to handle. So the computerized system is more suitable than
the manual system.

9
2.6 : Feasibility Study

Feasibility study tells whether the system would be beneficial for the organization with
respect of the organization. Feasibility study is divided into following phases

Phase of feasibility:

I. Operational Feasibility:

Operational feasibility is dependent on the human resources available for the project
and involves projecting whether the system will operate and be used once it is installed.
The proposed system is according to the requirements of the Auto Fuel Technologies,
and after when it will be implemented in the AFT, is likely to yield benefits for the
whole Company. As the people are already familiar with using application programs
like Microsoft Office so, there is no chance of any sort of destructive resistance to the
implementation of this project. It is mainly concerned with the availability of human
resources for the project and it also tells whether the system would be operating -able
after its deployment or not. If the project meets the needs of an organization then it is
operationally feasible. The proposed system would be beneficial in this regard as it
would be exactly according to user requirements and will give the guarantee of
complete data security. It will provide the end users with timely pertinent, accurate and
usefully formatted information by making a full use of the available resources.

II. Technological Feasibility:

Technical feasibility is a measurement of the practicality of a specific technical solution


and the availability of technical resources and expertise. Today, very little is technically
impossible, consequently, technical feasibility looks at what is practical and reasonable.
It is the measure of specific technical solution and the availability of technical resource
and expertise. In technical feasibility we see that the technology in which we are
implementing the project provides data security, reliability and ease of access. In Auto
Fuel Technologies project I use vb.Net a powerful, productive and extensible
programming environment.ASP.Net unlocks the door toward the development of
project. For Database I use SQL server 2000, which has power to hold the data for
heavy project. Technical feasibility addresses three major issues: Is the proposed
technology or solution practical? Do we currently possess the necessary technology?
Do we possess the necessary technical expertise and is the schedule reasonable? Yes!
Technical problem can be there if there is no computer operator .So there should be a
computer operator for current working of the software and different technical issues
will be solved during the testing process. A large part of determining resources has to
do with accessing technical feasibility. If existing system cannot be added onto then the
next question becomes whether there is technology in existence that meets the
specification.

III. Social Feasibility:

10
With the deployment of the new system on one hand the organization got benefited but
on the other hand it also affects the employees of the organization .Social Feasibility is
done in order to check this effect. It checks whether the system affects the job of
employees and how much it affects the employees. The social evaluation how the
proposed system may improve the job and the working environment of those affected.
My proposed system will affect the staff of the organization. As many persons would
be enough to run this system despite how many manual records keepers, but other
persons would be accommodated on the other places as the organization is escalating
and he see that person are worked in proper way or not. In AFT I have to see that the
staff working in Auto Fuel Technical has knowledge of how to use the technology as
well as user training to use the project.

IV. Economical and Financial Feasibility:

Economic Feasibility is the measurement of the cost effectiveness of the project proposed
system. The bottom line in many projects is economic feasibility. During the early phase
of the perfect economic feasibility analysis amount little more judging whether the possible
benefits of the solution or worthwhile. Costs are practically impossible to estimate at that
stage because the end user requirement and alternative technical solutions have not been
identified. However as soon as specific requirement have been identified, the analyst can
weigh the cost and benefit of each alternative solution. This called the cost and benefit
analysis. It is the measure of cost effectiveness of a project. This is often calling cost and
benefits analysis. So in economical feasibility we see what cost required implementing the
new system. In AFT Automation system I have to see what costs are involved. So I have to
consider all the facts that are related to new system cost.

11
Software Specification :

Software requirements for this system are as listed follows:

Front End Visual Basic.NET

Back End MICROSOFT SQL SERVER 2008

Operating system Windows XP

Hardware Specification :

Hardware requirements for this system are as listed follows:

The hardware interfaces defines the hardware devices needed for an application to run
such as type of processor and the amount of memory required.

Processor Core 2 duo

RAM 512 MB

Free Hard Disk Space 50 GB

12
FRONTEND : MICROSOFT VISUAL STUDIO 2010

1. First of all, ASP.NET provides managed code execution that runs under the Common
Language Runtime (CLR), resulting in robust, stable and secure applications. All features
of the .NET framework are readily available in ASP.NET
2. The .NET framework comes with ADO.NET, which follows the disconnected paradigm,
i.e. once the required records are fetched the connection no longer exists. It also retrieves
the records that are expected to be accessed in the immediate future. This enhances
Scalability of the application to a great extent.
3. ASP.NET MVC 4 is a framework for developing highly testable and maintainable Web
applications that follow the Model-View-Controller (MVC) pattern. The framework
encourages you to maintain a clear separation of concerns— views for UI, controllers for
handling user input, and models for domain logic. ASP.NET MVC applications are
particularly suited for unit testing and using test-driven development (TDD) techniques.
ASP.NET MVC 4 makes it easy to write applications for the mobile web through adaptive
rendering and device specific display modes.

• ASP.NET Web API, a framework for building and consuming HTTP services that can
reach a broad range of clients including browsers, phones, and tablets. ASP.NET Web API
is great for building services that follow the REST architectural style, plus it supports RPC
patterns.

• ASP.NET Web Pages and the new Razor syntax provide a fast, approachable, and
lightweight way to combine server code with HTML to create dynamic web content.

• Web Optimization, a framework for bundling and minifying scripts and CSS files.
4. We are using the c# for this project ,c# the important programming language.
5. C# is a multi paradigm language encompassing strong typing, imperative, declarative,
functional, generic, object-oriented (class-based), and component-oriented programming
disciplines. It was developed by Microsoft within its .NET initiative and later approved as a
standard by Ecma .C# is one of the programming languages designed for the Common
Language Infrastructure.
6. C# is a general-purpose, object-oriented programming language
7.

BACKEND : SQL SERVER 2008(R2)

IBM developed the original version of SQL, originally called Sequel, as part of the
System R Project in the early 1970s. The Sequel language has evolved since then, and its
name has changed to SQL (Structured Query Language).Many products now support the
SQL language. SQL has clearly established itself as the standard relational database
language.
In 1986,the American Standards Institute (ANSI) and the International Organization
for Standardization (ISO) published an SQL standard, called SQL-86.ANSI published an
extended standard for SQL,SQL-89,in 1989.The next version of the standard was SQL-92

13
standard followed by SQL:1999,SQL:2003 and then SQL:2005, the versions of SQL:2008
and SQL :2008(R2), SQL :2012, SQL :2014, SQL :2016, SQL :2017.
The SQL language has several parts:
Data-definition language (DDL): The SQL DDL provides commands for defining
relation schemas, deleting relations, and modifying relation schemas.

Interactive data-manipulation language (DML):The SQL DML includes query


language based on both the relational algebra (2) and the tuple relational calculus
(5).It includes also commands for specifying integrity constraints that the data
stored in the database must satisfy. Updates that violate integrity constraints are
disallowed.

View definition: The SQL DDL includes commands for defining views.

Transaction control: SQL includes commands for specifying the beginning and
ending of transactions.

Embedded SQL and Dynamic SQL: Embedded and dynamic SQL define how SQL
statements can be embedded within general-purpose programming languages, such
as C, C++.Java, PL/I, COBOL, Pascal, and FORTRAN.

Authorization: The SQL DDL includes commands for specifying access rights to
relations and views.

Wheres the SQL server 2008(R2) contain :

 SQL Server 2008 R2 is Microsoft’s latest release of its enterprise relational database and
business intelligence (BI) platform, and it builds on the base of functionality established
by SQL Server 2008. However, in spite of the R2 moniker, Microsoft has added an
extensive set of new features to SQL Server 2008 R2. Although the new support for self-
service BI and PowerPivot has gotten the lion’s share of attention, SQL Server 2008 R2
includes several other important enhancements. In this article, we’ll look at the most
important new features in SQL Server 2008 R2.

 New Editions

 Some of the biggest changes with the R2 release of SQL Server 2008 are the new
editions that Microsoft has added to the SQL Server lineup. SQL Server 2008 R2
Datacenter Edition has been added to the top of the relational database product lineup
and brings the SQL Server product editions in-line with the Windows Server product
editions, including its Datacenter Edition. SQL Server 2008 R2 Datacenter Edition
provides support for systems with up to 256 processor cores. In addition, it offers
multiserver management and a new event-processing technology called
StreamInsight. (I’ll cover multiserver management and StreamInsight in more detail
later in this article.)

14
 The other new edition of SQL Server 2008 R2 is the Parallel Data Warehouse Edition.
The Parallel Data Warehouse Edition, formerly code-named Madison, is a different
animal than the other editions of SQL Server 2008 R2. It’s designed as a Plug and
Play solution for large data warehouses. It’s a combination hardware and software
solution that’s available only through select OEMs such as HP, Dell, and IBM. OEMs
supply and preconfigure all of the hardware, including the storage to support the data
warehouse functionality. The Parallel Data Warehouse Edition uses a shared-nothing
Massively Parallel Processing (MPP) architecture to support data warehouses from
10TB to hundreds of terabytes in size. As more scalability is required, additional
compute and storage nodes can be added to the data warehouse.

 As you would expect, the Parallel Data Warehouse Edition is integrated with SQL
Server Integration Services (SSIS), SQL Server Analysis Services (SSAS), and SQL
Server Reporting Services (SSRS). For more in-depth information about the SQL
Server 2008 R2 Parallel Data Warehouse Edition, see "Getting Started with Parallel
Data Warehouse,” June 2010.

 The new SQL Server 2008 R2 lineup includes

 SQL Server 2008 R2 Parallel Data Warehouse Edition

 SQL Server 2008 R2 Datacenter Edition

 SQL Server 2008 R2 Enterprise Edition

 SQL Server 2008 R2 Developer Edition

 SQL Server 2008 R2 Standard Edition

 SQL Server 2008 R2 Web Edition

 SQL Server 2008 R2 Workgroup Edition

 SQL Server 2008 R2 Express Edition (Free)

 SQL Server 2008 Compact Edition (Free) SQL Server 2008 Compact Edition (Free)

15
2.7 : Stakeholders

Stakeholders are anyone who has an interest in the project. Project stakeholders are
individuals and organizations that are actively involved in the project, or whose interests may
be affected as a result of project execution or project completion. They may also exert influence
over the project’s objectives and outcomes. The project management team must identify the
stakeholders, determine their requirements and expectations, and, to the extent possible,
manage their influence in relation to the requirements to ensure a successful project.

The following are examples of project stakeholders:


1. Project Developers :

Project Developers is one who develops software for customer. In my project I am the
first stakeholder i.e. Project Developer.

2. Project customer :

Project Customer is one who pays for the developed software.

3. Project user Group :

Project User group are those people who use the software on daily basis for the Project
Customer.

4. Project Testers :

Project Testers are those who test the software. In my project myself, my project guide
are the Project Testers.

16
2.8 : Gantt Chart

 Gantt Chart :

17
CHAPTER : 3

System Analysis

18
3.0 : SYSTEM ANALYSIS

 The goal of systems analysis is to determine where the problem is in attempt to fix the
system. This step involves breaking down the system in different pieces and drawing
diagrams to analyze the situation. Analysts project goals, breaking down functions that
need to be created, and attempt to engage users so that definite requirements can be
defined.

Design: In systems design functions and operations are described in detail, including
screen layouts, business rules, process diagrams and other documentation. The output
of this stage will describe the new system as a collection of modules or subsystems.

Coding: Modular and subsystem programming code will be accomplished during this
stage. This stage is intermingled with the next in that individual modules will need
testing before integration to the main project. Planning in software life cycle involves
setting goals, defining targets, establishing schedules, and estimating budgets for an
entire software project.

Testing: The code is tested at various levels in software testing. Unit, system and user
acceptance testing are often performed. This is a grey area as many different opinions
exist as to what the stages of testing are and how much if any iteration occurs. Iteration
is not generally part of the waterfall model, but usually some occurs at this stage.

Operations and Maintenance: The deployment of the system includes changes and
enhancements before the decommissioning or sunset of the system. Maintaining the
system is an important aspect of SDLC. As key personnel change positions in the
organization, new changes will be implemented, which will require

19
3.1 : Fact Finding

Introduction :

The Current System is the manual one, hence is not speedy, accurate, efficient as well
as time consuming. An essential part of the system analysis, which enables the developer to
understand & the system correctly. It is undertaken to obtain details of the system. To
understand the physical flow of the information through the current system. Collect various
information through various fact finding techniques. Identify the procedural difficulties
experienced by the user. Study the bottlenecks find out the redundant work being performed in
the system.

Fact Finding Techniques Employed:

1. Interviews :
Information was obtained from the employees at the organization by interviewing
them at the location and time convention both.

2. Document Searching :
An extensive study of existing document an official correspondence was done to
understand the present working status of organization.

FACT FINDING STRATEGY :

1. Learn from existing documents, forms, reports, and files.


2. If appropriate, observe the system in action.
3. Given all the facts that already collected, design and distribute questionnaires to
clear up things that aren’t fully understood.
4. Conduct interviews (or group work sessions).
5. (Optional). Build discovery prototypes for any functional requirements that are
not understood or for requirements that need to be validated.
6. Follow up to verify facts.

20
DIAGRAMS :

3.3 : Use Case Diagram

 A use case diagram at its simplest is a representation of a user's interaction with the
system that shows the relationship between the user and the different use cases in
which the user is involved.

21
3.4 : ER Diagram

 An entity–relationship model describes interrelated things of interest in a specific


domain of knowledge. A basic ER model is composed of entity types and specifies
relationships that can exist between instances of those entity types.

22
3.5 : Activity Diagram

Activity diagram is another important diagram in UML to describe the dynamic aspects of
the system. Activity diagram is basically a flowchart to represent the flow from
one activity to another activity. The activity can be described as an operation of the system.
The control flow is drawn from one operation to another.

23
24
3.6 : Class Diagam

 A class diagram is an illustration of the relationships and source code dependencies


among classes in the Unified Modeling Language (UML). In this context, a class defines
the methods and variables in an object, which is a specific entity in a program or the unit
of code representing that entity.

25
3.7 : Sequence Diagram
 A sequence diagram shows object interactions arranged in time sequence. It depicts the
objects and classes involved in the scenario and the sequence of messages exchanged
between the objects needed to carry out the functionality of the scenario.

 Login Sequence Diagram :

26
 Sequence diagram for user :

27
CHAPTER : 4

System Design.

28
4.0 : System Design

4.1 : ER Diagram

29
4.2 : Converting ERD to Tables

Sr.No TABLE NAME PURPOSE


This table is use to store, the user id ,login
name,and password
1 Security

This table is use to the information about


Different types of Labors
2 Owner Owner id, Owner_name,Owner_payment.

This table is use store the vehicle


information,and we can add different types
3 Room of rooms in different buildings.
room_id, room_no,room sqft_amount.
This table is use to store, the Events which
are confirmed by Admin,
4 Events Eventid, Event name

This table is use to store the payment


Payment Details.
user_id.
5
6 Unpayed This table is used to show the unpayed
amont of users

This table is use to store, retrieve and


information about the order,labors, Vehicle
7 Admin The field are
OrderNo, Date, User_id, TotalAmount,
Add_labor,Add_vehicle,View_bookings.

30
CHAPTER: 5

System Coding

31
5.3 : Validations.

Validation is important part of any web application. User's input must always be validated
before sending across different layers of the application.

Validation controls are used to:

 Implement presentation logic.


 To validate user input data.
 Data format, data type and data range is used for validation.

Validation is of two types:


1. Client Side
2. Serve Side

Client side validation is good but we have to be dependent on browser and scripting language
support.

Client side validation is considered convenient for users as they get instant feedback. The
main advantage is that it prevents a page from being postback to the server until the client
validation is executed successfully.

For developer point of view serve side is preferable because it will not fail, it is not dependent
on browser and scripting language.

You can use ASP.NET validation, which will ensure client, and server validation. It work on
both end; first it will work on client validation and than on server validation. At any cost
server validation will work always whether client validation is executed or not. So you have a
safety of validation check.

For client script .NET used JavaScript. WebUIValidation.js file is used for client validation
by .NET

Validation Controls in ASP.NET

An important aspect of creating ASP.NET Web pages for user input is to be able to check
that the information users enter is valid. ASP.NET provides a set of validation controls that
provide an easy-to-use but powerful way to check for errors and, if necessary, display
messages to the user.

There are six types of validation controls in ASP.NET

1. RequiredFieldValidation Control
2. CompareValidator Control

32
3. RangeValidator Control
4. RegularExpressionValidator Control
5. CustomValidator Control
6. ValidationSummary

The below table describes the controls and their work:

Validation Control Description

RequiredFieldValidation Makes an input control a required field

CompareValidator Compares the value of one input control to the


value of another input control or to a fixed value

RangeValidator Checks that the user enters a value that falls


between two values

RegularExpressionValidator Ensures that the value of an input control matches


a specified pattern

CustomValidator Allows you to write a method to handle the


validation of the value entered

ValidationSummary Displays a report of all validation errors occurred


in a Web page

All validation controls are rendered in form as <span> (label are referred as <span> on client
by server)

Important points for validation controls

 ControlToValidate property is mandatory to all validate controls.


 One validation control will validate only one input control but multiple validate
control can be assigned to a input control.

33
5.4: Test Cases

5.4.1: Test cases.

For forms:

Form Valid data In valid data


Add rooms All field are compulsory Empty Fields, alphabets
,incorrect details

Add owner All field are compulsory Empty Fields

Add All field are compulsory Empty Fields


Maintanace
Add All field are compulsory Empty Fields, alphabets
Expences ,incorrect details
Add All field are compulsory Empty Fields, alphabets in
Meeting payment.

For controls:

Control Valid data In valid data


Contact no,text box 9966558844 Huuc#ihjgr8766@,,,,..//
Text box 8,55,52,854 Aphabets cbndj@#3

34
CHAPTER : 6

System Implementation

35
6.1 : Form Designing.
Home Page (Default.Aspx)
The Home Page Are The Startup Page Of The Website .
In This Page You Can View The Meetings, Calculate Mentanence,View Expensesand Add
Queries And Complaints
Basically It Is Designed For All The Users Of The Buildings

About We Page (About.Aspx)


The About Us Page Conatins The Information About The Developer And Also The Purpose
Of Developing The Website.

36
Maintenance (Calculate maintenance.Aspx)
The Maintenance Page Are The Page Which Is Use To Calculate The Mentainace Of Room
User Can Calculater There Own Mentanance Accoring To Mentanace Rate Which Is
Provcideds By The Admin

37
View Meeting Page (View Meeting.Aspx)
The View Meeting Page Conatins The Information About The Meeing
 Held Meeting
 Sheaduled Meeting

HELD MEETING
THE HELD MEETING IS USED TO SHOW THE MEETING WHICH IS HELD BEFORE.

38
SHEDULED MEETING

SHEDULE MEETING IS FOR WATCHING AT WHAT TIME MEETING IS SHEDULED

VIEW MANTANANCE (View maintenance.Aspx)

39
VIEW EVENT (Viewevent.Aspx)

VIEW SALARY (Viewsalary.Aspx)

40
ADD QUERY (Query.aspx)

Login page (Login.aspx)

Login page contains two login


 Admin
 Emp

41
Admin login page (Admin.aspx)
Admin login page conatins all the information about
 Room
 Owner
 Mentainance rate
 Mentainace payments
 Add expences
 View expences
 Meetings
 Complaints

Add rooms (Addroom.aspx)


In add room we can add room buildings and wings

42
Add Room (Addroom.aspx)

View room (Viewroom.aspx)


The view room is use for viewing the room
It shows all the information of room

43
Add owner (Addowner.aspx)

The add owner is used for adding the owner with respet to the room no

44
View owner (Viewowner.aspx)
View owner is used to view the owner of the room

Add maintenance (Addmaintenance.aspx)

45
View maintenance (viewmaintance.aspx)

Unpaid maintenance (Unpaid.aspx)

46
Add event (event.aspx)

47
Add salary (salary.aspx)

48
Complaint response (response.aspx)

View complaints (viewcomplaints.aspx)

49
Employee

Guest entry (entry.aspx)

50
View entries (viewentries.aspx)

51
Coding
Home Page(Default.aspx)

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


MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server"


ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server"
ContentPlaceHolderID="MainContent">
<h2>
Welcome to Hawre Green Park!
</h2>

</asp:Content>

Java Coading for Default

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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

52
About Us Page(About us.aspx)
<%@ Page Title="About Us" Language="C#" MasterPageFile="~/Site.master"
AutoEventWireup="true"
CodeFile="About.aspx.cs" Inherits="About" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">


</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
About&nbsp;&nbsp;&nbsp;&nbsp;
</h2>
<p>
<strong>
This Is The Best Website That I Have Built For Online Tracking Of Society Records Like
Maintance,Metting
Details,Event Celebraed In Society And Salary Given To Each Employess.
Here Each Member Of Society Can Query For The Different Problem To The Admin Or
Sactery Of The Building And They
Reply For That Problem And Try To Solvee It.
This Website Provide Many Fatures To The Every Man That Live In The Website And
They Get The Infomation By Seating At Home.
<Br />
Here Each Member Can Calculate Their Mantaince By Their Size And Rate Pr
Sqt/Ft.And Also Do The Complain If Some Service Is Not Provied To Them
Here Entry Of Each Guest Is Recorded And We Take The Track Record Of Guest Such
As Vehical And No Of Guest Mamber Etc.

</strong>
</p>
</asp:Content>

53
Calculate Maintenance Page(CalculateMaintenance.aspx)

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


AutoEventWireup="true" CodeFile="CalculateMaintance.aspx.cs"
Inherits="Admin_Payment" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="20"
CellSpacing="5" DataKeyNames="Id" DataSourceID="SqlDataSource1"
DefaultMode="Insert" GridLines="Both" Width="558px"
oniteminserted="FormView1_ItemInserted"
oniteminserting="FormView1_ItemInserting" HeaderText="Calculate Maintenance"
Height="294px" Font-Bold="False" Font-Italic="False" Font-Names="Rod"
Font-Overline="False" Font-Size="Medium">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Month:
<asp:TextBox ID="MonthTextBox" runat="server" Text='<%# Bind("Month") %>'
/>
<br />
Year:
<asp:TextBox ID="YearTextBox" runat="server" Text='<%# Bind("Year") %>' />
<br />
BulidingNo:
<asp:TextBox ID="BulidingNoTextBox" runat="server"
Text='<%# Bind("BulidingNo") %>' />
<br />
WingNo:
<asp:TextBox ID="WingNoTextBox" runat="server" Text='<%# Bind("WingNo")
%>' />
<br />
RoomNo:
<asp:TextBox ID="RoomNoTextBox" runat="server" Text='<%# Bind("RoomNo")
%>' />
<br />
Size:
<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>' />
<br />
Rate:
<asp:TextBox ID="RateTextBox" runat="server" Text='<%# Bind("Rate") %>' />
<br />
ReceivedFrom:
<asp:TextBox ID="ReceivedFromTextBox" runat="server"
Text='<%# Bind("ReceivedFrom") %>' />
<br />

54
Amount:
<asp:TextBox ID="AmountTextBox" runat="server" Text='<%# Bind("Amount")
%>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#FFCC99" />
<HeaderStyle BackColor="#FF9933" Font-Bold="True" ForeColor="White"
Font-Size="X-Large" Font-Strikeout="False" Font-Underline="False" Height="40px"
HorizontalAlign="Center" Wrap="False" />
<InsertItemTemplate>
Year:
<asp:DropDownList ID="ddl1" runat="server" AutoPostBack="True"
DataSourceID="sds2" DataTextField="Year" DataValueField="Year"
SelectedValue='<%# Bind("Year") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="sds2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [Year] FROM [tblMaintance]">
</asp:SqlDataSource>
<br />
Month:
<asp:DropDownList ID="ddl2" runat="server" AutoPostBack="True"
DataSourceID="sds3" DataTextField="Month" DataValueField="Month"
SelectedValue='<%# Bind("Month") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="sds3" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [Month] FROM [tblMaintance] WHERE
([Year] = @Year)">
<SelectParameters>
<asp:ControlParameter ControlID="ddl1" Name="Year"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<br />
Rate:
<asp:TextBox ID="RateTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("Rate") %>' />
<br />
BuildingNo:
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource5" DataTextField="BulidingNo"
DataValueField="BulidingNo">
</asp:DropDownList>

55
<asp:SqlDataSource ID="SqlDataSource5" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [BulidingNo] FROM [tblbuilding]">
</asp:SqlDataSource>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("BulidingNo") %>'
Visible="False"></asp:Label>
<br />
WingNo:
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource6" DataTextField="WingNo"
DataValueField="WingNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource6" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [WingNo] FROM [tblWing] WHERE
([BuildingNo] = @BuildingNo)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("WingNo") %>'
Visible="False"></asp:Label>
<br />
RoomNo:
<asp:DropDownList ID="DropDownList4" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource7" DataTextField="RoomNo"
DataValueField="RoomNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource7" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [RoomNo] FROM [tblRoom] WHERE (([BuildingNo]
= @BuildingNo) AND ([WingNo] = @WingNo))">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="DropDownList3" Name="WingNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("RoomNo") %>'
Visible="False"></asp:Label>
<asp:DropDownList ID="DropDownList5" runat="server"
DataSourceID="SqlDataSource8" DataTextField="Size" DataValueField="Size">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource8" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Size] FROM [tblRoom] WHERE (([BuildingNo] =
@BuildingNo) AND ([WingNo] = @WingNo) AND ([RoomNo] = @RoomNo))">
<SelectParameters>

56
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="DropDownList3" Name="WingNo"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList4" Name="RoomNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
&nbsp;<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>'
Visible="False" />
<br />
<asp:Button ID="Button1" runat="server" Text="Calculate" />
<br />
Amount:
<asp:TextBox ID="AmountTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("Amount") %>' />
<br />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Month:
<asp:Label ID="MonthLabel" runat="server" Text='<%# Bind("Month") %>' />
<br />
Year:
<asp:Label ID="YearLabel" runat="server" Text='<%# Bind("Year") %>' />
<br />
BulidingNo:
<asp:Label ID="BulidingNoLabel" runat="server"
Text='<%# Bind("BulidingNo") %>' />
<br />
WingNo:
<asp:Label ID="WingNoLabel" runat="server" Text='<%# Bind("WingNo") %>' />
<br />
RoomNo:
<asp:Label ID="RoomNoLabel" runat="server" Text='<%# Bind("RoomNo") %>' />
<br />
Size:
<asp:Label ID="SizeLabel" runat="server" Text='<%# Bind("Size") %>' />
<br />
Rate:
<asp:Label ID="RateLabel" runat="server" Text='<%# Bind("Rate") %>' />
<br />
ReceivedFrom:
<asp:Label ID="ReceivedFromLabel" runat="server"
Text='<%# Bind("ReceivedFrom") %>' />
<br />
Amount:
<asp:Label ID="AmountLabel" runat="server" Text='<%# Bind("Amount") %>' />

57
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblPayment] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblPayment] ([Month], [Year], [BulidingNo],
[WingNo], [RoomNo], [Size], [Rate], [ReceivedFrom], [Amount]) VALUES (@Month,
@Year, @BulidingNo, @WingNo, @RoomNo, @Size, @Rate, @ReceivedFrom,
@Amount)"
SelectCommand="SELECT * FROM [tblPayment]"
UpdateCommand="UPDATE [tblPayment] SET [Month] = @Month, [Year] = @Year,
[BulidingNo] = @BulidingNo, [WingNo] = @WingNo, [RoomNo] = @RoomNo, [Size] =
@Size, [Rate] = @Rate, [ReceivedFrom] = @ReceivedFrom, [Amount] = @Amount
WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Month" Type="String" />
<asp:Parameter Name="Year" Type="String" />
<asp:Parameter Name="BulidingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="String" />
<asp:Parameter Name="Rate" Type="Int32" />
<asp:Parameter Name="ReceivedFrom" Type="String" />
<asp:Parameter Name="Amount" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Month" Type="String" />
<asp:Parameter Name="Year" Type="String" />
<asp:Parameter Name="BulidingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="String" />
<asp:Parameter Name="Rate" Type="Int32" />
<asp:Parameter Name="ReceivedFrom" Type="String" />
<asp:Parameter Name="Amount" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>

58
</asp:SqlDataSource>
</asp:Content>

Java Code for Calculate Maintenance


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

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


{
protected void Page_Load(object sender, EventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

DropDownList y = (DropDownList)FormView1.FindControl("ddl1");
DropDownList m = (DropDownList)FormView1.FindControl("ddl2");
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd1 = new SqlCommand("Select RatePerSqarFoot from tblMaintance
where year='" + y.SelectedValue + "' and month='" + m.SelectedValue + "'", conn);
int rate = (int)cmd1.ExecuteScalar();

TextBox r = (TextBox)FormView1.FindControl("RateTextBox");
r.Text = rate.ToString();

int size1 = int.Parse(d5.SelectedValue);


int amt = rate * size1;

TextBox txtamt = (TextBox)FormView1.FindControl("AmountTextBox");

59
txtamt.Text = amt.ToString();
}
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;
}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

}
}

60
View Meeting(ViewMeeting.aspx)

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


AutoEventWireup="true" CodeFile="View Meeting.aspx.cs"
Inherits="Admin_View_Meeting" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<p>
Select:</p>
<p>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True"
onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">
<asp:ListItem Selected="True">Scheduled</asp:ListItem>
<asp:ListItem>Held Meeting</asp:ListItem>
</asp:RadioButtonList>
</p>
<p>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None"
BorderWidth="1px"
CellPadding="3" CellSpacing="2" DataKeyNames="Id"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Time" HeaderText="Time" SortExpression="Time"
/>
<asp:BoundField DataField="Venue" HeaderText="Venue"
SortExpression="Venue" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White"
/>
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

61
SelectCommand="SELECT [Id], [Title], [Date], [Time], [Venue], [Description]
FROM [tblMeeting] WHERE ([Date] &gt;= @Date) ORDER BY [Id]">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" DbType="Date" Name="Date"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
</p>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None"
BorderWidth="1px"
CellPadding="3" CellSpacing="2" DataKeyNames="Id"
datasourceid="SqlDataSource2"
Visible="False">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Time" HeaderText="Time" SortExpression="Time" />
<asp:BoundField DataField="Venue" HeaderText="Venue" SortExpression="Venue"
/>
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
<asp:BoundField DataField="Minutes" HeaderText="Minutes"
SortExpression="Minutes" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [tblMeeting] WHERE ([Date] &lt;= @Date)
ORDER BY [Id] DESC">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" DbType="Date" Name="Date"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
<p>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</p>
</asp:Content>

62
Java Code for View Meeting

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

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


{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = System.DateTime.Now.Date.ToString();
}
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)
{
GridView1.Visible = true;
GridView2.Visible = false;
}
else
{
GridView1.Visible = false;
GridView2.Visible = true;
}
}
}

63
View maintenance(View maintenance.aspx)

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


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

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource4">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblExpenses] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblExpenses] ([Title], [Date], [Cost], [Description])
VALUES (@Title, @Date, @Cost, @Description)"
SelectCommand="SELECT [Id], [Title], [Date], [Cost], [Description] FROM
[tblExpenses] WHERE ([Type] = @Type) ORDER BY [Id] DESC"

UpdateCommand="UPDATE [tblExpenses] SET [Title] = @Title, [Date] = @Date,


[Cost] = @Cost, [Description] = @Description WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />

64
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="Maintance" Name="Type" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java Code for (View maintenance)


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

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


{
protected void Page_Load(object sender, EventArgs e)
{ }}

65
View Event Page(Eventpage.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master"
AutoEventWireup="true" CodeFile="ViewEvents.aspx.cs" Inherits="Admin_ViewEvents"
%>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource4">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblExpenses] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblExpenses] ([Title], [Date], [Cost], [Description])
VALUES (@Title, @Date, @Cost, @Description)"
SelectCommand="SELECT [Id], [Title], [Date], [Cost], [Description] FROM
[tblExpenses] WHERE ([Type] = @Type) ORDER BY [Id] DESC"

UpdateCommand="UPDATE [tblExpenses] SET [Title] = @Title, [Date] = @Date,


[Cost] = @Cost, [Description] = @Description WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />

66
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="Event" Name="Type" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java Code for Eventpage

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

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


{
protected void Page_Load(object sender, EventArgs e)} } }

67
View Salary Page(ViewSalary.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master"
AutoEventWireup="true" CodeFile="ViewSalary.aspx.cs" Inherits="Admin_ViewSalary"
%>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource4">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblExpenses] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblExpenses] ([Title], [Date], [Cost], [Description])
VALUES (@Title, @Date, @Cost, @Description)"
SelectCommand="SELECT [Id], [Title], [Date], [Cost], [Description] FROM
[tblExpenses] WHERE ([Type] = @Type) ORDER BY [Id] DESC"

UpdateCommand="UPDATE [tblExpenses] SET [Title] = @Title, [Date] = @Date,


[Cost] = @Cost, [Description] = @Description WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />

68
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="Emp" Name="Type" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java Code for ViewSalary


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

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


{
protected void Page_Load(object sender, EventArgs e)
{ } }

69
Add query page(Add query.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master"
AutoEventWireup="true" CodeFile="Query.aspx.cs" Inherits="Query" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1"
DefaultMode="Insert" GridLines="Both" oniteminserted="FormView1_ItemInserted"
HeaderText="Query/Complaint ">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Query:
<asp:TextBox ID="QueryTextBox" runat="server" Text='<%# Bind("Query") %>' />
<br />
date:
<asp:TextBox ID="dateTextBox" runat="server" Text='<%# Bind("date") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
Query:
<asp:TextBox ID="QueryTextBox" runat="server" Height="56px"
Text='<%# Bind("Query") %>' TextMode="MultiLine" Width="239px" />
<br />
date:
<asp:TextBox ID="dateTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("date") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Query:

70
<asp:Label ID="QueryLabel" runat="server" Text='<%# Bind("Query") %>' />
<br />
date:
<asp:Label ID="dateLabel" runat="server" Text='<%# Bind("date") %>' />
<br />

</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Id], [Query], [date] FROM [tblComplaints]"
DeleteCommand="DELETE FROM [tblComplaints] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblComplaints] ([Query], [date]) VALUES (@Query,
@date)"
UpdateCommand="UPDATE [tblComplaints] SET [Query] = @Query, [date] = @date
WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Query" Type="String" />
<asp:Parameter DbType="Date" Name="date" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Query" Type="String" />
<asp:Parameter DbType="Date" Name="date" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Add query


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

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


{
protected void Page_Load(object sender, EventArgs e)
{
TextBox txtdate = (TextBox)FormView1.FindControl("dateTextBox");
txtdate.Text = System.DateTime.Now.Date.ToString();
}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
TextBox txtdate = (TextBox)FormView1.FindControl("dateTextBox");
txtdate.Text = System.DateTime.Now.Date.ToString();
Response.Redirect("~/Query.aspx"); } }

71
View complaint(View complaint‫۔‬aspx)

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


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

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Query" HeaderText="Query" SortExpression="Query"
/>
<asp:BoundField DataField="Respone" HeaderText="Respone"
SortExpression="Respone" />
<asp:BoundField DataField="date" HeaderText="date" SortExpression="date" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblComplaints] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblComplaints] ([Query], [Respone], [date])
VALUES (@Query, @Respone, @date)"
SelectCommand="SELECT * FROM [tblComplaints]"
UpdateCommand="UPDATE [tblComplaints] SET [Query] = @Query, [Respone] =
@Respone, [date] = @date WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Query" Type="String" />
<asp:Parameter Name="Respone" Type="String" />
<asp:Parameter DbType="Date" Name="date" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Query" Type="String" />

72
<asp:Parameter Name="Respone" Type="String" />
<asp:Parameter DbType="Date" Name="date" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for View complaint


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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

73
Login page(Login.aspx)

<%@ Page Title="Log In" Language="C#" MasterPageFile="~/Site.master"


AutoEventWireup="true"
CodeFile="Login.aspx.cs" Inherits="Account_Login" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">


</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
&nbsp;</h2>
<h2>
&nbsp;</h2>
<h2>
&nbsp;</h2>
<h2>
&nbsp;</h2>
<h2>
Log In
</h2>
<p align="center"
style="font-size: medium; font-weight: bolder; font-style: italic; font-variant: normal;
text-transform: inherit; color: #008000; text-decoration: blink; font-family: 'Microsoft YaHei
UI'">
Please enter your username and password.
</p>
<asp:Login ID="LoginUser" runat="server" EnableViewState="false"
RenderOuterTable="false" DestinationPageUrl="~/Account/Destination.aspx">
<LayoutTemplate>
<span class="failureNotification">
<asp:Literal ID="FailureText" runat="server"></asp:Literal>
</span>
<asp:ValidationSummary ID="LoginUserValidationSummary" runat="server"
CssClass="failureNotification"
ValidationGroup="LoginUserValidationGroup" ForeColor="Red"/>
<div class="accountInfo">
<fieldset class="login">
<legend>Account Information</legend>
<p>
<asp:Label ID="UserNameLabel" runat="server"
AssociatedControlID="UserName">Username:</asp:Label>
<asp:TextBox ID="UserName" runat="server"
CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server"
ControlToValidate="UserName"
CssClass="failureNotification" ErrorMessage="User Name is required."
ToolTip="User Name is required."

ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
</p>

74
<p>
<asp:Label ID="PasswordLabel" runat="server"
AssociatedControlID="Password">Password:</asp:Label>
<asp:TextBox ID="Password" runat="server" CssClass="passwordEntry"
TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server"
ControlToValidate="Password"
CssClass="failureNotification" ErrorMessage="Password is required."
ToolTip="Password is required."

ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:CheckBox ID="RememberMe" runat="server"/>
<asp:Label ID="RememberMeLabel" runat="server"
AssociatedControlID="RememberMe" CssClass="inline">Keep me logged in</asp:Label>
</p>
</fieldset>
<p class="submitButton">
<asp:Button ID="LoginButton" runat="server" CommandName="Login"
Text="Log In" ValidationGroup="LoginUserValidationGroup"/>
</p>
</div>
</LayoutTemplate>
</asp:Login>
</asp:Content>

Java code for Login


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

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


{
protected void Page_Load(object sender, EventArgs e)
{
//RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" +
HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
}
}

75
Admin home page(Admin .aspx)

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


AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="Admin_Home" %>

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


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

Java code for Admin


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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

76
Add room(Add room.aspx)

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


AutoEventWireup="true" CodeFile="AddRoom.aspx.cs" Inherits="Admin_AddRoom" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<p>
Add : <asp:RadioButtonList ID="RadioButtonList1" runat="server"
AutoPostBack="True"
onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">
<asp:ListItem Selected="True">Room</asp:ListItem>
<asp:ListItem>Buliding</asp:ListItem>
<asp:ListItem>Wing</asp:ListItem>
</asp:RadioButtonList>
</p>
<p>
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1"
DefaultMode="Insert" GridLines="Both" Width="373px" HeaderText="Add Room"
oniteminserted="FormView1_ItemInserted">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
BuildingNo:
<asp:TextBox ID="BuildingNoTextBox" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:TextBox ID="WingNoTextBox" runat="server" Text='<%# Bind("WingNo")
%>' />
<br />
RoomNo:
<asp:TextBox ID="RoomNoTextBox" runat="server" Text='<%#
Bind("RoomNo") %>' />
<br />
Size:
<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>' />
<br />
Intercom:
<asp:TextBox ID="IntercomTextBox" runat="server"
Text='<%# Bind("Intercom") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"

77
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
BuildingNo:
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource5" DataTextField="BulidingNo"
DataValueField="BulidingNo" SelectedValue='<%# Bind("BuildingNo") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource5" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [BulidingNo] FROM [tblbuilding]">
</asp:SqlDataSource>
<br />
WingNo:
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource6" DataTextField="WingNo"
DataValueField="WingNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource6" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [WingNo] FROM [tblWing] WHERE
([BuildingNo] = @BuildingNo)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("WingNo") %>'
Visible="False"></asp:Label>
<br />
RoomNo:
<asp:TextBox ID="RoomNoTextBox" runat="server" Text='<%#
Bind("RoomNo") %>' />
<br />
Size:
<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>' />
<br />
Intercom:
<asp:TextBox ID="IntercomTextBox" runat="server"
Text='<%# Bind("Intercom") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>

78
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
BuildingNo:
<asp:Label ID="BuildingNoLabel" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:Label ID="WingNoLabel" runat="server" Text='<%# Bind("WingNo") %>'
/>
<br />
RoomNo:
<asp:Label ID="RoomNoLabel" runat="server" Text='<%# Bind("RoomNo") %>'
/>
<br />
Size:
<asp:Label ID="SizeLabel" runat="server" Text='<%# Bind("Size") %>' />
<br />
Intercom:
<asp:Label ID="IntercomLabel" runat="server" Text='<%# Bind("Intercom") %>'
/>
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server"
CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblRoom] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblRoom] ([BuildingNo], [WingNo], [RoomNo],
[Size], [Intercom]) VALUES (@BuildingNo, @WingNo, @RoomNo, @Size, @Intercom)"
SelectCommand="SELECT * FROM [tblRoom]"
UpdateCommand="UPDATE [tblRoom] SET [BuildingNo] = @BuildingNo,
[WingNo] = @WingNo, [RoomNo] = @RoomNo, [Size] = @Size, [Intercom] = @Intercom
WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="BuildingNo" Type="Int32" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />

79
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="Intercom" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="BuildingNo" Type="Int32" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="Intercom" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:FormView ID="FormView2" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource2"
DefaultMode="Insert" GridLines="Both" Visible="False" Width="378px"
HeaderText="Add Building" oniteminserted="FormView1_ItemInserted">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
BulidingNo:
<asp:TextBox ID="BulidingNoTextBox" runat="server"
Text='<%# Bind("BulidingNo") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
BulidingNo:
<asp:TextBox ID="BulidingNoTextBox" runat="server"
Text='<%# Bind("BulidingNo") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
BulidingNo:
<asp:Label ID="BulidingNoLabel" runat="server"

80
Text='<%# Bind("BulidingNo") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server"
CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblbuilding] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblbuilding] ([BulidingNo]) VALUES
(@BulidingNo)"
SelectCommand="SELECT * FROM [tblbuilding]"
UpdateCommand="UPDATE [tblbuilding] SET [BulidingNo] = @BulidingNo
WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="BulidingNo" Type="Int32" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="BulidingNo" Type="Int32" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:FormView ID="FormView3" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource3"
DefaultMode="Insert" GridLines="Both" Visible="False" Width="381px"
HeaderText="Add Wing" oniteminserted="FormView1_ItemInserted">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
BuildingNo:
<asp:TextBox ID="BuildingNoTextBox" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:TextBox ID="WingNoTextBox" runat="server" Text='<%# Bind("WingNo")
%>' />

81
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
BuildingNo:
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource4" DataTextField="BulidingNo"
DataValueField="BulidingNo" SelectedValue='<%# Bind("BuildingNo") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [BulidingNo] FROM
[tblbuilding]"></asp:SqlDataSource>
<br />
WingNo:
<asp:TextBox ID="WingNoTextBox" runat="server" Text='<%# Bind("WingNo")
%>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
BuildingNo:
<asp:Label ID="BuildingNoLabel" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:Label ID="WingNoLabel" runat="server" Text='<%# Bind("WingNo") %>'
/>
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server"
CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>

82
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblWing] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblWing] ([BuildingNo], [WingNo]) VALUES
(@BuildingNo, @WingNo)"
SelectCommand="SELECT * FROM [tblWing]"
UpdateCommand="UPDATE [tblWing] SET [BuildingNo] = @BuildingNo,
[WingNo] = @WingNo WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="BuildingNo" Type="Int32" />
<asp:Parameter Name="WingNo" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="BuildingNo" Type="Int32" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</p>
</asp:Content>

Java code forAdd room


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

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


{
protected void Page_Load(object sender, EventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;
}
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)
{
FormView1.Visible = true;

83
FormView2.Visible = false;
FormView3.Visible = false;
}
else
if (RadioButtonList1.SelectedIndex == 1)
{
FormView2.Visible = true;
FormView1.Visible = false;
FormView3.Visible = false;
}
else
{
FormView3.Visible = true;
FormView2.Visible = false;
FormView1.Visible = false;
}
}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
Response.Redirect("~/Admin/AddRoom.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("~/Admin/AddRoom.aspx");
}
}

84
View room (Viewroom.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="ViewRoom.aspx.cs" Inherits="Admin_ViewRoom" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="BuildingNo" HeaderText="BuildingNo"
SortExpression="BuildingNo" />
<asp:BoundField DataField="WingNo" HeaderText="WingNo"
SortExpression="WingNo" />
<asp:BoundField DataField="RoomNo" HeaderText="RoomNo"
SortExpression="RoomNo" />
<asp:BoundField DataField="Size" HeaderText="Size" SortExpression="Size" />
<asp:BoundField DataField="Intercom" HeaderText="Intercom"
SortExpression="Intercom" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblRoom] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblRoom] ([BuildingNo], [WingNo], [RoomNo], [Size],
[Intercom]) VALUES (@BuildingNo, @WingNo, @RoomNo, @Size, @Intercom)"
SelectCommand="SELECT * FROM [tblRoom]"
UpdateCommand="UPDATE [tblRoom] SET [BuildingNo] = @BuildingNo, [WingNo] =
@WingNo, [RoomNo] = @RoomNo, [Size] = @Size, [Intercom] = @Intercom WHERE [Id]
= @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="BuildingNo" Type="Int32" />

85
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="Intercom" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="BuildingNo" Type="Int32" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="Intercom" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for View room


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

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


{
protected void Page_Load(object sender, EventArgs e)
{
} }

86
Add owner(Addowner.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="AddOwner.aspx.cs" Inherits="Admin_AddOwner" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1"
DefaultMode="Insert" GridLines="Both"
oniteminserting="FormView1_ItemInserting"

oniteminserted="FormView1_ItemInserted" HeaderText="Assign Owner"


Height="358px" Width="468px">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Name:
<asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
<br />
BuildingNo:
<asp:TextBox ID="BuildingNoTextBox" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:TextBox ID="WingNoTextBox" runat="server" Text='<%# Bind("WingNo")
%>' />
<br />
RoomNo:
<asp:TextBox ID="RoomNoTextBox" runat="server" Text='<%# Bind("RoomNo")
%>' />
<br />
Size:
<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>' />
<br />
EmailId:
<asp:TextBox ID="EmailIdTextBox" runat="server" Text='<%# Bind("EmailId")
%>' />
<br />
PhoneNo:
<asp:TextBox ID="PhoneNoTextBox" runat="server" Text='<%# Bind("PhoneNo")
%>' />
<br />
Gender:
<asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>'
/>
<br />

87
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
Name:
<asp:TextBox ID="NameTextBox0" runat="server" Text='<%# Bind("Name") %>' />
<br />
BuildingNo:
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource5" DataTextField="BulidingNo"
DataValueField="BulidingNo" SelectedValue='<%# Bind("BuildingNo") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource5" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [BulidingNo] FROM [tblbuilding]">
</asp:SqlDataSource>
<br />
WingNo:
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource6" DataTextField="WingNo"
DataValueField="WingNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource6" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [WingNo] FROM [tblWing] WHERE
([BuildingNo] = @BuildingNo)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("WingNo") %>'
Visible="False"></asp:Label>
<br />
RoomNo:
<asp:DropDownList ID="DropDownList4" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource7" DataTextField="RoomNo"
DataValueField="RoomNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource7" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [RoomNo] FROM [tblRoom] WHERE (([BuildingNo]
= @BuildingNo) AND ([WingNo] = @WingNo))">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"

88
PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="DropDownList3" Name="WingNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("RoomNo") %>'
Visible="False"></asp:Label>
<asp:DropDownList ID="DropDownList5" runat="server"
DataSourceID="SqlDataSource8" DataTextField="Size" DataValueField="Size"
Visible="False">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource8" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Size] FROM [tblRoom] WHERE (([BuildingNo] =
@BuildingNo) AND ([WingNo] = @WingNo) AND ([RoomNo] = @RoomNo))">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="DropDownList3" Name="WingNo"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList4" Name="RoomNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
&nbsp;<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>'
Visible="False" />
<br />
EmailId:
<asp:TextBox ID="EmailIdTextBox0" runat="server"
Text='<%# Bind("EmailId") %>' />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
Display="Dynamic" ErrorMessage="Enter Email"
ControlToValidate="EmailIdTextBox0">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="EmailIdTextBox0" Display="Dynamic"
ErrorMessage="Enter Correct Email"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-
.]\w+)*">*</asp:RegularExpressionValidator>
<br />
PhoneNo:
<asp:TextBox ID="PhoneNoTextBox0" runat="server"
Text='<%# Bind("PhoneNo") %>' />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="PhoneNoTextBox0" Display="Dynamic"
ErrorMessage="Enter Phone Number">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="PhoneNoTextBox0" Display="Dynamic"
ErrorMessage="Enter Correct Phone Number" ValidationExpression="[0-
9]{10}"></asp:RegularExpressionValidator>
<br />

89
Gender:
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Horizontal" SelectedValue='<%# Bind("Gender") %>'>
<asp:ListItem Selected="True">Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:RadioButtonList>
<br />
<asp:Button ID="InsertButton0" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:Button ID="InsertCancelButton0" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Name:
<asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>' />
<br />
BuildingNo:
<asp:Label ID="BuildingNoLabel" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:Label ID="WingNoLabel" runat="server" Text='<%# Bind("WingNo") %>' />
<br />
RoomNo:
<asp:Label ID="RoomNoLabel" runat="server" Text='<%# Bind("RoomNo") %>' />
<br />
Size:
<asp:Label ID="SizeLabel" runat="server" Text='<%# Bind("Size") %>' />
<br />
EmailId:
<asp:Label ID="EmailIdLabel" runat="server" Text='<%# Bind("EmailId") %>' />
<br />
PhoneNo:
<asp:Label ID="PhoneNoLabel" runat="server" Text='<%# Bind("PhoneNo") %>' />
<br />
Gender:
<asp:Label ID="GenderLabel" runat="server" Text='<%# Bind("Gender") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#000099" HorizontalAlign="Center" />

90
<RowStyle BackColor="#CC00FF" ForeColor="#6600CC" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblOwner] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblOwner] ([Name], [BuildingNo], [WingNo],
[RoomNo], [Size], [EmailId], [PhoneNo], [Gender]) VALUES (@Name, @BuildingNo,
@WingNo, @RoomNo, @Size, @EmailId, @PhoneNo, @Gender)"
SelectCommand="SELECT * FROM [tblOwner]"

UpdateCommand="UPDATE [tblOwner] SET [Name] = @Name, [BuildingNo] =


@BuildingNo, [WingNo] = @WingNo, [RoomNo] = @RoomNo, [Size] = @Size, [EmailId]
= @EmailId, [PhoneNo] = @PhoneNo, [Gender] = @Gender WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="PhoneNo" Type="String" />
<asp:Parameter Name="Gender" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="PhoneNo" Type="String" />
<asp:Parameter Name="Gender" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Addowner


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

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

91
{
protected void Page_Load(object sender, EventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

}
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

}
}

92
View room(Viewroom.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="ViewRoom.aspx.cs" Inherits="Admin_ViewRoom" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="BuildingNo" HeaderText="BuildingNo"
SortExpression="BuildingNo" />
<asp:BoundField DataField="WingNo" HeaderText="WingNo"
SortExpression="WingNo" />
<asp:BoundField DataField="RoomNo" HeaderText="RoomNo"
SortExpression="RoomNo" />
<asp:BoundField DataField="Size" HeaderText="Size" SortExpression="Size" />
<asp:BoundField DataField="Intercom" HeaderText="Intercom"
SortExpression="Intercom" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblRoom] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblRoom] ([BuildingNo], [WingNo], [RoomNo], [Size],
[Intercom]) VALUES (@BuildingNo, @WingNo, @RoomNo, @Size, @Intercom)"
SelectCommand="SELECT * FROM [tblRoom]"
UpdateCommand="UPDATE [tblRoom] SET [BuildingNo] = @BuildingNo, [WingNo] =
@WingNo, [RoomNo] = @RoomNo, [Size] = @Size, [Intercom] = @Intercom WHERE [Id]
= @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="BuildingNo" Type="Int32" />

93
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="Intercom" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="BuildingNo" Type="Int32" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="Intercom" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Viewroom

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

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


{
protected void Page_Load(object sender, EventArgs e)
{ } }

94
Add owner(Addowner.aspx)

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


AutoEventWireup="true" CodeFile="AddOwner.aspx.cs" Inherits="Admin_AddOwner" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1"
DefaultMode="Insert" GridLines="Both"
oniteminserting="FormView1_ItemInserting"
oniteminserted="FormView1_ItemInserted" HeaderText="Assign Owner"
Height="358px" Width="468px">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Name:
<asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
<br />
BuildingNo:
<asp:TextBox ID="BuildingNoTextBox" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:TextBox ID="WingNoTextBox" runat="server" Text='<%# Bind("WingNo")
%>' />
<br />
RoomNo:
<asp:TextBox ID="RoomNoTextBox" runat="server" Text='<%# Bind("RoomNo")
%>' />
<br />
Size:
<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>' />
<br />
EmailId:
<asp:TextBox ID="EmailIdTextBox" runat="server" Text='<%# Bind("EmailId")
%>' />
<br />
PhoneNo:
<asp:TextBox ID="PhoneNoTextBox" runat="server" Text='<%# Bind("PhoneNo")
%>' />
<br />
Gender:
<asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>'
/>
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"

95
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
Name:
<asp:TextBox ID="NameTextBox0" runat="server" Text='<%# Bind("Name") %>' />
<br />
BuildingNo:
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource5" DataTextField="BulidingNo"
DataValueField="BulidingNo" SelectedValue='<%# Bind("BuildingNo") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource5" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [BulidingNo] FROM [tblbuilding]">
</asp:SqlDataSource>
<br />
WingNo:
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource6" DataTextField="WingNo"
DataValueField="WingNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource6" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [WingNo] FROM [tblWing] WHERE
([BuildingNo] = @BuildingNo)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("WingNo") %>'
Visible="False"></asp:Label>
<br />
RoomNo:
<asp:DropDownList ID="DropDownList4" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource7" DataTextField="RoomNo"
DataValueField="RoomNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource7" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [RoomNo] FROM [tblRoom] WHERE (([BuildingNo]
= @BuildingNo) AND ([WingNo] = @WingNo))">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />

96
<asp:ControlParameter ControlID="DropDownList3" Name="WingNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("RoomNo") %>'
Visible="False"></asp:Label>
<asp:DropDownList ID="DropDownList5" runat="server"
DataSourceID="SqlDataSource8" DataTextField="Size" DataValueField="Size"
Visible="False">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource8" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Size] FROM [tblRoom] WHERE (([BuildingNo] =
@BuildingNo) AND ([WingNo] = @WingNo) AND ([RoomNo] = @RoomNo))">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="DropDownList3" Name="WingNo"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList4" Name="RoomNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
&nbsp;<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>'
Visible="False" />
<br />
EmailId:
<asp:TextBox ID="EmailIdTextBox0" runat="server"
Text='<%# Bind("EmailId") %>' />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
Display="Dynamic" ErrorMessage="Enter Email"
ControlToValidate="EmailIdTextBox0">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="EmailIdTextBox0" Display="Dynamic"
ErrorMessage="Enter Correct Email"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-
.]\w+)*">*</asp:RegularExpressionValidator>
<br />
PhoneNo:
<asp:TextBox ID="PhoneNoTextBox0" runat="server"
Text='<%# Bind("PhoneNo") %>' />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="PhoneNoTextBox0" Display="Dynamic"
ErrorMessage="Enter Phone Number">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="PhoneNoTextBox0" Display="Dynamic"
ErrorMessage="Enter Correct Phone Number" ValidationExpression="[0-
9]{10}"></asp:RegularExpressionValidator>
<br />
Gender:

97
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Horizontal" SelectedValue='<%# Bind("Gender") %>'>
<asp:ListItem Selected="True">Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:RadioButtonList>
<br />
<asp:Button ID="InsertButton0" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:Button ID="InsertCancelButton0" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Name:
<asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>' />
<br />
BuildingNo:
<asp:Label ID="BuildingNoLabel" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:Label ID="WingNoLabel" runat="server" Text='<%# Bind("WingNo") %>' />
<br />
RoomNo:
<asp:Label ID="RoomNoLabel" runat="server" Text='<%# Bind("RoomNo") %>' />
<br />
Size:
<asp:Label ID="SizeLabel" runat="server" Text='<%# Bind("Size") %>' />
<br />
EmailId:
<asp:Label ID="EmailIdLabel" runat="server" Text='<%# Bind("EmailId") %>' />
<br />
PhoneNo:
<asp:Label ID="PhoneNoLabel" runat="server" Text='<%# Bind("PhoneNo") %>' />
<br />
Gender:
<asp:Label ID="GenderLabel" runat="server" Text='<%# Bind("Gender") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#000099" HorizontalAlign="Center" />
<RowStyle BackColor="#CC00FF" ForeColor="#6600CC" />

98
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblOwner] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblOwner] ([Name], [BuildingNo], [WingNo],
[RoomNo], [Size], [EmailId], [PhoneNo], [Gender]) VALUES (@Name, @BuildingNo,
@WingNo, @RoomNo, @Size, @EmailId, @PhoneNo, @Gender)"
SelectCommand="SELECT * FROM [tblOwner]"

UpdateCommand="UPDATE [tblOwner] SET [Name] = @Name, [BuildingNo] =


@BuildingNo, [WingNo] = @WingNo, [RoomNo] = @RoomNo, [Size] = @Size, [EmailId]
= @EmailId, [PhoneNo] = @PhoneNo, [Gender] = @Gender WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="PhoneNo" Type="String" />
<asp:Parameter Name="Gender" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="PhoneNo" Type="String" />
<asp:Parameter Name="Gender" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Addowner


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

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


{

99
protected void Page_Load(object sender, EventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

}
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

}
}

100
View owner(Viewowner.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="ViewOwner.aspx.cs" Inherits="Admin_ViewOwner"
%>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1" Height="359px"
Width="768px">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="BuildingNo" HeaderText="BuildingNo"
SortExpression="BuildingNo" />
<asp:BoundField DataField="WingNo" HeaderText="WingNo"
SortExpression="WingNo" />
<asp:BoundField DataField="RoomNo" HeaderText="RoomNo"
SortExpression="RoomNo" />
<asp:BoundField DataField="Size" HeaderText="Size" SortExpression="Size" />
<asp:BoundField DataField="EmailId" HeaderText="EmailId"
SortExpression="EmailId" />
<asp:BoundField DataField="PhoneNo" HeaderText="PhoneNo"
SortExpression="PhoneNo" />
<asp:BoundField DataField="Gender" HeaderText="Gender"
SortExpression="Gender" />
</Columns>
<FooterStyle BackColor="#33CCCC" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="Black" />
<SortedAscendingHeaderStyle BackColor="Yellow" />
<SortedDescendingCellStyle BackColor="Black" />
<SortedDescendingHeaderStyle BackColor="Yellow" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblOwner] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblOwner] ([Name], [BuildingNo], [WingNo],
[RoomNo], [Size], [EmailId], [PhoneNo], [Gender]) VALUES (@Name, @BuildingNo,
@WingNo, @RoomNo, @Size, @EmailId, @PhoneNo, @Gender)"
SelectCommand="SELECT * FROM [tblOwner]"

101
UpdateCommand="UPDATE [tblOwner] SET [Name] = @Name, [BuildingNo] =
@BuildingNo, [WingNo] = @WingNo, [RoomNo] = @RoomNo, [Size] = @Size, [EmailId]
= @EmailId, [PhoneNo] = @PhoneNo, [Gender] = @Gender WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="PhoneNo" Type="String" />
<asp:Parameter Name="Gender" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="Int32" />
<asp:Parameter Name="EmailId" Type="String" />
<asp:Parameter Name="PhoneNo" Type="String" />
<asp:Parameter Name="Gender" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Viewowner


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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

102
Add maintenance(Addmaintenance.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="AddMaintanceRate.aspx.cs"
Inherits="Admin_AddMaintanceRate" %>

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


<style type="text/css">
.style1
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource9"
DefaultMode="Insert" GridLines="Both"
oniteminserted="FormView1_ItemInserted" onload="FormView1_Load"
HeaderText="Add Maintenece Rate">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Month:
<asp:TextBox ID="MonthTextBox" runat="server" Text='<%# Bind("Month") %>'
/>
<br />
Year:
<asp:TextBox ID="YearTextBox" runat="server" Text='<%# Bind("Year") %>' />
<br />
RatePerSqarFoot:
<asp:TextBox ID="RatePerSqarFootTextBox" runat="server"
Text='<%# Bind("RatePerSqarFoot") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
&nbsp;<table class="style1">
<tr>
<td>
Month:</td>
<td>

103
<asp:DropDownList ID="DropDownList6" runat="server"
SelectedValue='<%# Bind("Month") %>'>
<asp:ListItem>Jan</asp:ListItem>
<asp:ListItem>Feb</asp:ListItem>
<asp:ListItem>Mar</asp:ListItem>
<asp:ListItem>Apr</asp:ListItem>
<asp:ListItem>May</asp:ListItem>
<asp:ListItem>Jun</asp:ListItem>
<asp:ListItem>Jul</asp:ListItem>
<asp:ListItem>Aug</asp:ListItem>
<asp:ListItem>Sep</asp:ListItem>
<asp:ListItem>Oct</asp:ListItem>
<asp:ListItem>Nov</asp:ListItem>
<asp:ListItem>Dec</asp:ListItem>
</asp:DropDownList>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Year:</td>
<td>
<asp:TextBox ID="YearTextBox" runat="server" Text='<%# Bind("Year")
%>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="YearTextBox" Display="Dynamic"
ErrorMessage="Enter Correct Year">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server"
ControlToValidate="YearTextBox" Display="Dynamic"
ErrorMessage="Enter Correct Year" ValidationExpression="[0-2][0-0][0-
3][0-9]">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
Rate/SqFt:</td>
<td>
<asp:TextBox ID="RatePerSqarFootTextBox" runat="server"
Text='<%# Bind("RatePerSqarFoot") %>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="RatePerSqarFootTextBox" Display="Dynamic"
ErrorMessage="Enter Rate">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2"
runat="server"

104
ControlToValidate="RatePerSqarFootTextBox" Display="Dynamic"
ErrorMessage="Enter Correct Rate" ValidationExpression="[0-9][0-9][0-
9]">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<asp:Button ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;&nbsp;&nbsp;
<asp:Button ID="InsertCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</td>
<td>
&nbsp;</td>
</tr>
</table>
<br />
&nbsp;<asp:ValidationSummary ID="ValidationSummary1" runat="server"
ShowMessageBox="True" ShowSummary="False" />
<br />&nbsp;<br />&nbsp;
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Month:
<asp:Label ID="MonthLabel" runat="server" Text='<%# Bind("Month") %>' />
<br />
Year:
<asp:Label ID="YearLabel" runat="server" Text='<%# Bind("Year") %>' />
<br />
RatePerSqarFoot:
<asp:Label ID="RatePerSqarFootLabel" runat="server"
Text='<%# Bind("RatePerSqarFoot") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>

105
<asp:SqlDataSource ID="SqlDataSource9" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblMaintance] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblMaintance] ([Month], [Year], [RatePerSqarFoot])
VALUES (@Month, @Year, @RatePerSqarFoot)"
SelectCommand="SELECT * FROM [tblMaintance]"
UpdateCommand="UPDATE [tblMaintance] SET [Month] = @Month, [Year] =
@Year, [RatePerSqarFoot] = @RatePerSqarFoot WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Month" Type="String" />
<asp:Parameter Name="Year" Type="String" />
<asp:Parameter Name="RatePerSqarFoot" Type="Int32" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Month" Type="String" />
<asp:Parameter Name="Year" Type="String" />
<asp:Parameter Name="RatePerSqarFoot" Type="Int32" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Add maintenance

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

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


{
protected void Page_Load(object sender, EventArgs e)
{
TextBox yyyy = (TextBox)FormView1.FindControl("YearTextBox");
yyyy.Text = System.DateTime.Now.Year.ToString();

//DropDownList d6 = (DropDownList)FormView1.FindControl("DropDownList6");
//d6.SelectedIndex = System.DateTime.Now.Month-1;
}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
Response.Redirect("ViewRate.aspx");
//Page_Load(sender, e);
}

106
//{
// TextBox yyyy = (TextBox)FormView1.FindControl("YearTextBox");
// yyyy.Text = System.DateTime.Now.Year.ToString();

// DropDownList d6 = (DropDownList)FormView1.FindControl("DropDownList6");
// d6.SelectedIndex = System.DateTime.Now.Month+1;
//}

protected void FormView1_Load(object sender, EventArgs e)


{

//TextBox yyyy = (TextBox)FormView1.FindControl("YearTextBox");


//yyyy.Text = System.DateTime.Now.Year.ToString();

//DropDownList d6 = (DropDownList)FormView1.FindControl("DropDownList6");
//d6.SelectedIndex = System.DateTime.Now.Month + 1;
}
}

107
View maintenance(Viewmaintenance.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="ViewMaintance.aspx.cs" Inherits="ViewMaintance"
%>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource4">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblExpenses] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblExpenses] ([Title], [Date], [Cost], [Description])
VALUES (@Title, @Date, @Cost, @Description)"
SelectCommand="SELECT [Id], [Title], [Date], [Cost], [Description] FROM
[tblExpenses] WHERE ([Type] = @Type) ORDER BY [Id] DESC"

UpdateCommand="UPDATE [tblExpenses] SET [Title] = @Title, [Date] = @Date, [Cost]


= @Cost, [Description] = @Description WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />

108
<asp:Parameter Name="Description" Type="String" />
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="Maintance" Name="Type" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Viewmaintenance

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

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


{
protected void Page_Load(object sender, EventArgs e)
{ } }

109
Paid mantenence(Paidmantenence.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="PaidMaintance.aspx.cs"
Inherits="Admin_PaidMaintance" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
Select:
Select :
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1" DataTextField="Year" DataValueField="Year">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource2" DataTextField="Month" DataValueField="Month">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
Text="Paid Owner" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [Year] FROM [tblMaintance]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Month] FROM [tblMaintance] WHERE ([Year] =
@Year)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="Year"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<br />
&nbsp;<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource3"
Caption="Paid Maintence">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="BulidingNo" HeaderText="BulidingNo"
SortExpression="BulidingNo" />
<asp:BoundField DataField="WingNo" HeaderText="WingNo"
SortExpression="WingNo" />
<asp:BoundField DataField="RoomNo" HeaderText="RoomNo"
SortExpression="RoomNo" />
<asp:BoundField DataField="ReceivedFrom" HeaderText="ReceivedFrom"
SortExpression="ReceivedFrom" />

110
<asp:BoundField DataField="Amount" HeaderText="Amount"
SortExpression="Amount" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<br />
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblPayment] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblPayment] ([BulidingNo], [WingNo], [RoomNo],
[ReceivedFrom], [Amount]) VALUES (@BulidingNo, @WingNo, @RoomNo,
@ReceivedFrom, @Amount)"
SelectCommand="SELECT [Id], [BulidingNo], [WingNo], [RoomNo], [ReceivedFrom],
[Amount] FROM [tblPayment] WHERE (([Year] = @Year) AND ([Month] = @Month))"
UpdateCommand="UPDATE [tblPayment] SET [BulidingNo] = @BulidingNo, [WingNo]
= @WingNo, [RoomNo] = @RoomNo, [ReceivedFrom] = @ReceivedFrom, [Amount] =
@Amount WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="BulidingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="ReceivedFrom" Type="String" />
<asp:Parameter Name="Amount" Type="String" />
</InsertParameters>
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="Year"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList2" Name="Month"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="BulidingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="ReceivedFrom" Type="String" />
<asp:Parameter Name="Amount" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>

111
</asp:Content>

Java code for Paidmantenence

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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{

}
}

112
Unpaid(Unpaid.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="Unpaid.aspx.cs" Inherits="Admin_Unpaid" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<p>
Select :
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1" DataTextField="Year" DataValueField="Year">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource2" DataTextField="Month" DataValueField="Month">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
Text="Unpaid Owner" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [Year] FROM [tblMaintance]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Month] FROM [tblMaintance] WHERE ([Year] =
@Year)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="Year"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</p>
<p>
<asp:GridView ID="GridView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" AutoGenerateColumns="False"
Caption="Unpaid Payment Owner Details">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" />
<asp:BoundField DataField="BuildingNo" HeaderText="BulidingNo" />
<asp:BoundField DataField="WingNo" HeaderText="WingNo" />
<asp:BoundField DataField="RoomNo" HeaderText="RoomNo" />
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="EmailID" HeaderText="EmailID" />
<asp:BoundField DataField="PhoneNo" HeaderText="PhoneNo" />
<asp:HyperLinkField DataNavigateUrlFields="EmailId"
DataNavigateUrlFormatString="~/Admin/SendEmail.aspx?EmailID={0}"
HeaderText="Action" NavigateUrl="~/Admin/SendEmail.aspx" Text="Send Mail"
/>
</Columns>

113
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
</p>
</asp:Content>

Java code for Unpaid

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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();

//string cmd = "Select o.Id as ID, o.emailid as EmailId, o.phoneno As PhoneNo from
tblOwner o, tblPayment p where p.month='" + DropDownList2.SelectedValue + "' and
p.year='" + DropDownList1.SelectedValue + "' and p.roomno<>o.roomno and
p.wingno<>o.wingno and p.BulidingNo<>o.BuildingNo";
string cmd = "SELECT Id, Name, BuildingNo, WingNo, RoomNo, Size, EmailId,
PhoneNo, Gender FROM tblOwner WHERE (Id NOT IN (SELECT o.Id FROM tblOwner
AS o INNER JOIN tblPayment AS p ON p.RoomNo = o.RoomNo AND
p.WingNo = o.WingNo AND p.BulidingNo = o.BuildingNo WHERE (p.Month =
'"+DropDownList2.SelectedValue+"') AND (p.Year =
'"+DropDownList1.SelectedValue+"')))";
SqlDataAdapter objada = new SqlDataAdapter(cmd, conn);

114
DataTable objtbl = new DataTable();
objada.Fill(objtbl);
GridView1.DataSource = objtbl;
GridView1.DataBind();

}
}

115
Payment(Payment.aspx)

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


AutoEventWireup="true" CodeFile="Payment.aspx.cs" Inherits="Admin_Payment" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1"
DefaultMode="Insert" GridLines="Both" Width="366px"
oniteminserted="FormView1_ItemInserted"
oniteminserting="FormView1_ItemInserting" HeaderText="Add Payment">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Month:
<asp:TextBox ID="MonthTextBox" runat="server" Text='<%# Bind("Month") %>'
/>
<br />
Year:
<asp:TextBox ID="YearTextBox" runat="server" Text='<%# Bind("Year") %>' />
<br />
BulidingNo:
<asp:TextBox ID="BulidingNoTextBox" runat="server"
Text='<%# Bind("BulidingNo") %>' />
<br />
WingNo:
<asp:TextBox ID="WingNoTextBox" runat="server" Text='<%# Bind("WingNo")
%>' />
<br />
RoomNo:
<asp:TextBox ID="RoomNoTextBox" runat="server" Text='<%# Bind("RoomNo")
%>' />
<br />
Size:
<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>' />
<br />
Rate:
<asp:TextBox ID="RateTextBox" runat="server" Text='<%# Bind("Rate") %>' />
<br />
ReceivedFrom:
<asp:TextBox ID="ReceivedFromTextBox" runat="server"
Text='<%# Bind("ReceivedFrom") %>' />
<br />
Amount:
<asp:TextBox ID="AmountTextBox" runat="server" Text='<%# Bind("Amount")
%>' />

116
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
Year:
<asp:DropDownList ID="ddl1" runat="server" AutoPostBack="True"
DataSourceID="sds2" DataTextField="Year" DataValueField="Year"
SelectedValue='<%# Bind("Year") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="sds2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [Year] FROM [tblMaintance]">
</asp:SqlDataSource>
<br />
Month:
<asp:DropDownList ID="ddl2" runat="server" AutoPostBack="True"
DataSourceID="sds3" DataTextField="Month" DataValueField="Month"
SelectedValue='<%# Bind("Month") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="sds3" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [Month] FROM [tblMaintance] WHERE
([Year] = @Year)">
<SelectParameters>
<asp:ControlParameter ControlID="ddl1" Name="Year"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<br />
Rate:
<asp:TextBox ID="RateTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("Rate") %>' />
<br />
BuildingNo:
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource5" DataTextField="BuildingNo"
DataValueField="BuildingNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource5" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [BuildingNo] FROM [tblOwner]">
</asp:SqlDataSource>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("BuildingNo") %>'

117
Visible="False"></asp:Label>
<br />
WingNo:
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource6" DataTextField="WingNo"
DataValueField="WingNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource6" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT DISTINCT [WingNo] FROM [tblOwner] WHERE


([BuildingNo] = @BuildingNo)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("WingNo") %>'
Visible="False"></asp:Label>
<br />
RoomNo:
<asp:DropDownList ID="DropDownList4" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource7" DataTextField="RoomNo"
DataValueField="RoomNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource7" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT DISTINCT [BuildingNo], [RoomNo] FROM


[tblOwner] WHERE (([BuildingNo] = @BuildingNo) AND ([WingNo] = @WingNo))">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList3" Name="WingNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("RoomNo") %>'
Visible="False"></asp:Label>
<asp:DropDownList ID="DropDownList5" runat="server"
DataSourceID="SqlDataSource8" DataTextField="Size" DataValueField="Size">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource8" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Size] FROM [tblRoom] WHERE (([BuildingNo] =
@BuildingNo) AND ([WingNo] = @WingNo) AND ([RoomNo] = @RoomNo))">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="DropDownList3" Name="WingNo"

118
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList4" Name="RoomNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
Text="Calculate" />
<br />
<br />
Amount:
<asp:TextBox ID="AmountTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("Amount") %>' />
<br />
&nbsp;<asp:TextBox ID="SizeTextBox" runat="server" Text='<%# Bind("Size") %>'
Visible="False" />
<br />
ReceivedFrom:
<asp:TextBox ID="ReceivedFromTextBox" runat="server"
Text='<%# Bind("ReceivedFrom") %>' />
<br />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Month:
<asp:Label ID="MonthLabel" runat="server" Text='<%# Bind("Month") %>' />
<br />
Year:
<asp:Label ID="YearLabel" runat="server" Text='<%# Bind("Year") %>' />
<br />
BulidingNo:
<asp:Label ID="BulidingNoLabel" runat="server"
Text='<%# Bind("BulidingNo") %>' />
<br />
WingNo:
<asp:Label ID="WingNoLabel" runat="server" Text='<%# Bind("WingNo") %>' />
<br />
RoomNo:
<asp:Label ID="RoomNoLabel" runat="server" Text='<%# Bind("RoomNo") %>' />
<br />
Size:
<asp:Label ID="SizeLabel" runat="server" Text='<%# Bind("Size") %>' />
<br />
Rate:

119
<asp:Label ID="RateLabel" runat="server" Text='<%# Bind("Rate") %>' />
<br />
ReceivedFrom:
<asp:Label ID="ReceivedFromLabel" runat="server"
Text='<%# Bind("ReceivedFrom") %>' />
<br />
Amount:
<asp:Label ID="AmountLabel" runat="server" Text='<%# Bind("Amount") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblPayment] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblPayment] ([Month], [Year], [BulidingNo],
[WingNo], [RoomNo], [Size], [Rate], [ReceivedFrom], [Amount]) VALUES (@Month,
@Year, @BulidingNo, @WingNo, @RoomNo, @Size, @Rate, @ReceivedFrom,
@Amount)"
SelectCommand="SELECT * FROM [tblPayment]"
UpdateCommand="UPDATE [tblPayment] SET [Month] = @Month, [Year] = @Year,
[BulidingNo] = @BulidingNo, [WingNo] = @WingNo, [RoomNo] = @RoomNo, [Size] =
@Size, [Rate] = @Rate, [ReceivedFrom] = @ReceivedFrom, [Amount] = @Amount
WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Month" Type="String" />
<asp:Parameter Name="Year" Type="String" />
<asp:Parameter Name="BulidingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="String" />
<asp:Parameter Name="Rate" Type="Int32" />
<asp:Parameter Name="ReceivedFrom" Type="String" />
<asp:Parameter Name="Amount" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Month" Type="String" />
<asp:Parameter Name="Year" Type="String" />
<asp:Parameter Name="BulidingNo" Type="String" />

120
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="String" />
<asp:Parameter Name="Rate" Type="Int32" />
<asp:Parameter Name="ReceivedFrom" Type="String" />
<asp:Parameter Name="Amount" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Payment

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

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


{
protected void Page_Load(object sender, EventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

DropDownList y = (DropDownList)FormView1.FindControl("ddl1");
DropDownList m = (DropDownList)FormView1.FindControl("ddl2");
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd1 = new SqlCommand("Select RatePerSqarFoot from tblMaintance
where year='" + y.SelectedValue + "' and month='" + m.SelectedValue + "'", conn);

121
int rate = (int)cmd1.ExecuteScalar();

TextBox r = (TextBox)FormView1.FindControl("RateTextBox");
r.Text = rate.ToString();

int size1 = int.Parse(d5.SelectedValue);


int amt = rate * size1;

TextBox txtamt = (TextBox)FormView1.FindControl("AmountTextBox");


txtamt.Text = amt.ToString();
}
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;
}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

}
protected void Button1_Click(object sender, EventArgs e)
{

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

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


{
protected void Page_Load(object sender, EventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

DropDownList y = (DropDownList)FormView1.FindControl("ddl1");
DropDownList m = (DropDownList)FormView1.FindControl("ddl2");
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd1 = new SqlCommand("Select RatePerSqarFoot from tblMaintance
where year='" + y.SelectedValue + "' and month='" + m.SelectedValue + "'", conn);
int rate = (int)cmd1.ExecuteScalar();

TextBox r = (TextBox)FormView1.FindControl("RateTextBox");
r.Text = rate.ToString();

int size1 = int.Parse(d5.SelectedValue);


int amt = rate * size1;

TextBox txtamt = (TextBox)FormView1.FindControl("AmountTextBox");


txtamt.Text = amt.ToString();

123
}
protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;
}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

DropDownList d5 = (DropDownList)FormView1.FindControl("DropDownList5");
TextBox size = (TextBox)FormView1.FindControl("SizeTextBox");
size.Text = d5.SelectedValue;

}
protected void Button1_Click(object sender, EventArgs e)
{

}
}

124
View payment(Viewpayment.aspx)

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


AutoEventWireup="true" CodeFile="ViewPayment.aspx.cs"
Inherits="Admin_ViewPayment" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Month" HeaderText="Month" SortExpression="Month"
/>
<asp:BoundField DataField="Year" HeaderText="Year" SortExpression="Year" />
<asp:BoundField DataField="BulidingNo" HeaderText="BulidingNo"
SortExpression="BulidingNo" />
<asp:BoundField DataField="WingNo" HeaderText="WingNo"
SortExpression="WingNo" />
<asp:BoundField DataField="RoomNo" HeaderText="RoomNo"
SortExpression="RoomNo" />
<asp:BoundField DataField="Size" HeaderText="Size" SortExpression="Size" />
<asp:BoundField DataField="Rate" HeaderText="Rate" SortExpression="Rate" />
<asp:BoundField DataField="ReceivedFrom" HeaderText="ReceivedFrom"
SortExpression="ReceivedFrom" />
<asp:BoundField DataField="Amount" HeaderText="Amount"
SortExpression="Amount" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblPayment] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblPayment] ([Month], [Year], [BulidingNo],
[WingNo], [RoomNo], [Size], [Rate], [ReceivedFrom], [Amount]) VALUES (@Month,
@Year, @BulidingNo, @WingNo, @RoomNo, @Size, @Rate, @ReceivedFrom,
@Amount)"

125
SelectCommand="SELECT * FROM [tblPayment] ORDER BY [Id] DESC"
UpdateCommand="UPDATE [tblPayment] SET [Month] = @Month, [Year] = @Year,
[BulidingNo] = @BulidingNo, [WingNo] = @WingNo, [RoomNo] = @RoomNo, [Size] =
@Size, [Rate] = @Rate, [ReceivedFrom] = @ReceivedFrom, [Amount] = @Amount
WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Month" Type="String" />
<asp:Parameter Name="Year" Type="String" />
<asp:Parameter Name="BulidingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="String" />
<asp:Parameter Name="Rate" Type="Int32" />
<asp:Parameter Name="ReceivedFrom" Type="String" />
<asp:Parameter Name="Amount" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Month" Type="String" />
<asp:Parameter Name="Year" Type="String" />
<asp:Parameter Name="BulidingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Size" Type="String" />
<asp:Parameter Name="Rate" Type="Int32" />
<asp:Parameter Name="ReceivedFrom" Type="String" />
<asp:Parameter Name="Amount" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Viewpayment


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

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


{
protected void Page_Load(object sender, EventArgs e)
{

126
Add maintenance(Addmaintenance.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="Maintance.aspx.cs" Inherits="Admin_Maintance" %>

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


tagprefix="asp" %>

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


<style type="text/css">
.style1
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

<asp:ScriptManager ID="ScriptManager1" runat="server">


</asp:ScriptManager>
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource3"
DefaultMode="Insert" GridLines="Both"
oniteminserted="FormView1_ItemInserted" HeaderText="Add Maintence">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Title:
<asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
<br />
Date:
<asp:TextBox ID="DateTextBox" runat="server" Text='<%# Bind("Date") %>' />
<br />
Cost:
<asp:TextBox ID="CostTextBox" runat="server" Text='<%# Bind("Cost") %>' />
<br />
Description:
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text='<%# Bind("Description") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />

127
<InsertItemTemplate>
<table class="style1">
<tr>
<td>
Title:</td>
<td>
<asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title")
%>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
BorderColor="Red" ControlToValidate="TitleTextBox"
Display="Dynamic"
ErrorMessage="Please Enter Title">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Date:</td>
<td>
<asp:TextBox ID="DateTextBox" runat="server" Text='<%# Bind("Date")
%>' />
<asp:CalendarExtender ID="DateTextBox_CalendarExtender" runat="server"
Enabled="True" TargetControlID="DateTextBox">
</asp:CalendarExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
BorderColor="Red" ControlToValidate="DateTextBox"
Display="Dynamic"
ErrorMessage="Please Enter Date">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Cost:</td>
<td>
<asp:TextBox ID="CostTextBox" runat="server" Text='<%# Bind("Cost")
%>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
BorderColor="Red" ControlToValidate="TitleTextBox"
Display="Dynamic"
ErrorMessage="Please Enter Cost">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Description:</td>

128
<td>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Description")
%>'></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
BorderColor="Red" ControlToValidate="TextBox1" Display="Dynamic"
ErrorMessage="Please Enter Description">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="InsertCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
</table>
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Title:
<asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>' />
<br />
Date:
<asp:Label ID="DateLabel" runat="server" Text='<%# Bind("Date") %>' />
<br />
Cost:
<asp:Label ID="CostLabel" runat="server" Text='<%# Bind("Cost") %>' />
<br />
Description:
<asp:Label ID="DescriptionLabel" runat="server"
Text='<%# Bind("Description") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"

129
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblExpenses] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblExpenses] ([Title], [Date], [Cost], [Description])
VALUES (@Title, @Date, @Cost, @Description)"
SelectCommand="SELECT * FROM [tblExpenses]"
UpdateCommand="UPDATE [tblExpenses] SET [Title] = @Title, [Date] = @Date,
[Cost] = @Cost, [Description] = @Description WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
ShowMessageBox="True" ShowSummary="False" />
</asp:Content>

130
Java code forAdd maintenance
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();

SqlCommand cmd = new SqlCommand("update tblExpenses set type='Maintance'


where id=(select max(id) from tblExpenses)", conn);
cmd.ExecuteNonQuery();
}
}

131
Event(Event.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="Events.aspx.cs" Inherits="Admin_Events" %>

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


tagprefix="asp" %>

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


<style type="text/css">
.style1
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource3"
DefaultMode="Insert" GridLines="Both"
oniteminserted="FormView1_ItemInserted" HeaderText="Add Events">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Title:
<asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
<br />
Date:
<asp:TextBox ID="DateTextBox" runat="server" Text='<%# Bind("Date") %>' />
<br />
Cost:
<asp:TextBox ID="CostTextBox" runat="server" Text='<%# Bind("Cost") %>' />
<br />
Description:
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text='<%# Bind("Description") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>

132
&nbsp;<table class="style1">
<tr>
<td>
EventName:</td>
<td>
<asp:TextBox ID="TitleTextBox0" runat="server" Text='<%# Bind("Title")
%>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
BorderColor="Red" ControlToValidate="TitleTextBox0"
Display="Dynamic"
ErrorMessage="Enter Event Name">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Date:</td>
<td>
<asp:TextBox ID="DateTextBox0" runat="server" Text='<%# Bind("Date")
%>' />
<asp:CalendarExtender ID="DateTextBox0_CalendarExtender"
runat="server"
Enabled="True" TargetControlID="DateTextBox0">
</asp:CalendarExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
BorderColor="Red" ControlToValidate="DateTextBox0"
Display="Dynamic"
ErrorMessage="Please Enter Cost">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Cost:</td>
<td>
<asp:TextBox ID="CostTextBox0" runat="server" Text='<%# Bind("Cost")
%>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
BorderColor="Red" ControlToValidate="CostTextBox0"
Display="Dynamic"
ErrorMessage="Please Enter Cost">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Description:</td>

133
<td>
<asp:TextBox ID="DescriptionTextBox0" runat="server"
Text='<%# Bind("Description") %>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
BorderColor="Red" ControlToValidate="DescriptionTextBox0"
Display="Dynamic"
ErrorMessage="Please Enter Description">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
&nbsp;&nbsp;&nbsp;
<asp:Button ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="InsertCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
</table>
&nbsp;<asp:ValidationSummary ID="ValidationSummary1" runat="server"
ShowMessageBox="True" ShowSummary="False" />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Title:
<asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>' />
<br />
Date:
<asp:Label ID="DateLabel" runat="server" Text='<%# Bind("Date") %>' />
<br />
Cost:
<asp:Label ID="CostLabel" runat="server" Text='<%# Bind("Cost") %>' />
<br />
Description:
<asp:Label ID="DescriptionLabel" runat="server"
Text='<%# Bind("Description") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />

134
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblExpenses] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblExpenses] ([Title], [Date], [Cost], [Description])
VALUES (@Title, @Date, @Cost, @Description)"
SelectCommand="SELECT * FROM [tblExpenses]"
UpdateCommand="UPDATE [tblExpenses] SET [Title] = @Title, [Date] = @Date,
[Cost] = @Cost, [Description] = @Description WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

135
Java code for Event
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();

SqlCommand cmd = new SqlCommand("update tblExpenses set type='Event' where


id=(select max(id) from tblExpenses)", conn);
cmd.ExecuteNonQuery();
}
}

136
Add salary(Addsalary.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="Employee.aspx.cs" Inherits="Admin_Employee" %>

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


tagprefix="asp" %>

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


<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
height: 21px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource3"
DefaultMode="Insert" GridLines="Both"
oniteminserted="FormView1_ItemInserted" HeaderText="Add Employee Salary">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Title:
<asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
<br />
Date:
<asp:TextBox ID="DateTextBox" runat="server" Text='<%# Bind("Date") %>' />
<br />
Cost:
<asp:TextBox ID="CostTextBox" runat="server" Text='<%# Bind("Cost") %>' />
<br />
Description:
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text='<%# Bind("Description") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>

137
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
<table class="style1">
<tr>
<td>
EmaployeeName:</td>
<td>
<asp:TextBox ID="TitleTextBox0" runat="server" Text='<%# Bind("Title")
%>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
BorderColor="Red" ControlToValidate="TitleTextBox0"
Display="Dynamic"
ErrorMessage="Please Enter Employee
Name">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Date:</td>
<td>
<asp:TextBox ID="DateTextBox0" runat="server" Text='<%# Bind("Date")
%>' />
<asp:CalendarExtender ID="DateTextBox0_CalendarExtender"
runat="server"
Enabled="True" TargetControlID="DateTextBox0">
</asp:CalendarExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
BorderColor="Red" ControlToValidate="DateTextBox0"
Display="Dynamic"
ErrorMessage="Please Enter Date">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style2">
Cost:</td>
<td class="style2">
<asp:TextBox ID="CostTextBox0" runat="server" Text='<%# Bind("Cost")
%>' />
</td>
<td class="style2">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
BorderColor="Red" ControlToValidate="CostTextBox0"
Display="Dynamic"
ErrorMessage="Please Enter Cost">*</asp:RequiredFieldValidator>

138
</td>
</tr>
<tr>
<td>
Description:</td>
<td>
<asp:TextBox ID="DescriptionTextBox0" runat="server"
Text='<%# Bind("Description") %>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
BorderColor="Red" ControlToValidate="DescriptionTextBox0"
Display="Dynamic"
ErrorMessage="Please Enter Description">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="InsertCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
</table>
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Title:
<asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>' />
<br />
Date:
<asp:Label ID="DateLabel" runat="server" Text='<%# Bind("Date") %>' />
<br />
Cost:
<asp:Label ID="CostLabel" runat="server" Text='<%# Bind("Cost") %>' />
<br />
Description:
<asp:Label ID="DescriptionLabel" runat="server"
Text='<%# Bind("Description") %>' />
<br />

139
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblExpenses] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblExpenses] ([Title], [Date], [Cost], [Description])
VALUES (@Title, @Date, @Cost, @Description)"
SelectCommand="SELECT * FROM [tblExpenses]"
UpdateCommand="UPDATE [tblExpenses] SET [Title] = @Title, [Date] = @Date,
[Cost] = @Cost, [Description] = @Description WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
ShowMessageBox="True" ShowSummary="False" />
</asp:Content>

140
Java code for Addsalary

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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();

SqlCommand cmd = new SqlCommand("update tblExpenses set type='Emp' where


id=(select max(id) from tblExpenses)", conn);
cmd.ExecuteNonQuery();
}
}

141
View events(Viewevents.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="ViewEvents.aspx.cs" Inherits="Admin_ViewEvents"
%>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource4">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblExpenses] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblExpenses] ([Title], [Date], [Cost], [Description])
VALUES (@Title, @Date, @Cost, @Description)"
SelectCommand="SELECT [Id], [Title], [Date], [Cost], [Description] FROM
[tblExpenses] WHERE ([Type] = @Type) ORDER BY [Id] DESC"

UpdateCommand="UPDATE [tblExpenses] SET [Title] = @Title, [Date] = @Date, [Cost]


= @Cost, [Description] = @Description WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />

142
<asp:Parameter Name="Description" Type="String" />
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="Event" Name="Type" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Viewevents


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

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


{
protected void Page_Load(object sender, EventArgs e)
{ } }

143
View salary(Viewsalary.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="ViewSalary.aspx.cs" Inherits="Admin_ViewSalary"
%>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource4">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Employee"
SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Cost" HeaderText="Salary" SortExpression="Cost" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblExpenses] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblExpenses] ([Title], [Date], [Cost], [Description])
VALUES (@Title, @Date, @Cost, @Description)"
SelectCommand="SELECT [Id], [Title], [Date], [Cost], [Description] FROM
[tblExpenses] WHERE ([Type] = @Type) ORDER BY [Id] DESC"

UpdateCommand="UPDATE [tblExpenses] SET [Title] = @Title, [Date] = @Date, [Cost]


= @Cost, [Description] = @Description WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />

144
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="Emp" Name="Type" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Cost" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Viewsalary


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

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


{
protected void Page_Load(object sender, EventArgs e)
{

} }

145
Add meeting(Addmeeting.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="AddMeeting.aspx.cs" Inherits="Admin_AddMeeting"
%>

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


tagprefix="asp" %>

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


<style type="text/css">
.style1
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

<asp:ScriptManager ID="ScriptManager1" runat="server">


</asp:ScriptManager>
<asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource5"
DefaultMode="Insert" GridLines="Both"
oniteminserted="FormView1_ItemInserted" HeaderText="Schedule Meeting">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
Title:
<asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
<br />
Date:
<asp:TextBox ID="DateTextBox" runat="server" Text='<%# Bind("Date") %>' />
<br />
Time:
<asp:TextBox ID="TimeTextBox" runat="server" Text='<%# Bind("Time") %>' />
<br />
Venue:
<asp:TextBox ID="VenueTextBox" runat="server" Text='<%# Bind("Venue") %>' />
<br />
Description:
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text='<%# Bind("Description") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />

146
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
&nbsp;<table class="style1">
<tr>
<td>
Title:</td>
<td>
<asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title")
%>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TitleTextBox" Display="Dynamic"
ErrorMessage="Enter Title">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server"
ControlToValidate="TitleTextBox" Display="Dynamic"
ErrorMessage="Alphabates Only" ValidationExpression="[A-Z a-
z]+">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
Date:</td>
<td>
<asp:TextBox ID="DateTextBox" runat="server" Text='<%# Bind("Date")
%>' />
<asp:CalendarExtender ID="DateTextBox_CalendarExtender" runat="server"
Enabled="True" TargetControlID="DateTextBox">
</asp:CalendarExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="DateTextBox" Display="Dynamic"
ErrorMessage="Enter date">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Time:</td>
<td>
<asp:TextBox ID="TimeTextBox" runat="server" Text='<%# Bind("Time")
%>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"

147
ControlToValidate="TimeTextBox" Display="Dynamic"
ErrorMessage="Enter Time">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Venue:</td>
<td>
<asp:TextBox ID="VenueTextBox" runat="server" Text='<%# Bind("Venue")
%>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="VenueTextBox" Display="Dynamic"
ErrorMessage="Enter Venue">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2"
runat="server"
ControlToValidate="VenueTextBox" Display="Dynamic"
ErrorMessage="Alphabates Only" ValidationExpression="[A-Z a-
z]+">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
Description:
</td>
<td>
<asp:TextBox ID="DescriptionTextBox" runat="server" Height="60px"
Text='<%# Bind("Description") %>' TextMode="MultiLine"
Width="228px" />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ControlToValidate="DescriptionTextBox" Display="Dynamic"
ErrorMessage="Enter Decsription">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<asp:Button ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;&nbsp;&nbsp;
<asp:Button ID="InsertCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
<br />
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
ShowMessageBox="True" ShowSummary="False" />

148
</td>
<td>
&nbsp;</td>
</tr>
</table>
<br />
&nbsp;<br />&nbsp;<br />&nbsp;<br />
<br />
&nbsp;
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Title:
<asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>' />
<br />
Date:
<asp:Label ID="DateLabel" runat="server" Text='<%# Bind("Date") %>' />
<br />
Time:
<asp:Label ID="TimeLabel" runat="server" Text='<%# Bind("Time") %>' />
<br />
Venue:
<asp:Label ID="VenueLabel" runat="server" Text='<%# Bind("Venue") %>' />
<br />
Description:
<asp:Label ID="DescriptionLabel" runat="server"
Text='<%# Bind("Description") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server"
CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource5" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblMeeting] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblMeeting] ([Title], [Date], [Time], [Venue],
[Description]) VALUES (@Title, @Date, @Time, @Venue, @Description)"
SelectCommand="SELECT [Id], [Title], [Date], [Time], [Venue], [Description] FROM
[tblMeeting]"
UpdateCommand="UPDATE [tblMeeting] SET [Title] = @Title, [Date] = @Date,
[Time] = @Time, [Venue] = @Venue, [Description] = @Description WHERE [Id] = @Id">

149
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter DbType="Date" Name="Date" />
<asp:Parameter Name="Time" Type="String" />
<asp:Parameter Name="Venue" Type="String" />
<asp:Parameter Name="Description" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter DbType="Date" Name="Date" />
<asp:Parameter Name="Time" Type="String" />
<asp:Parameter Name="Venue" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Add meeting


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

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


{
TextBox title, date, time, venue;

protected void Page_Load(object sender, EventArgs e)


{

}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();

150
title = (TextBox)FormView1.FindControl("TitleTextBox");
date = (TextBox)FormView1.FindControl("DateTextBox");
time = (TextBox)FormView1.FindControl("TimeTextBox");
venue = (TextBox)FormView1.FindControl("VenueTextBox");
// Response.Write(title.Text + " " + time.Text +" " + date.Text + " " + venue.Text);
SqlCommand cmd = new SqlCommand("select emailid from tblowner", conn);
SqlDataReader sdr = cmd.ExecuteReader();

while (sdr.Read())
{
string em = sdr.GetString(0);
//Response.Write(em);

try
{
String EmailAddress;
EmailAddress = em;
MailMessage mail = new MailMessage();

mail.To.Add(EmailAddress);
mail.From = new MailAddress("[email protected]");
mail.Subject = "Meeting Schedule";
string Body = "Title : " + title.Text + "<br>" + "Date : " +date.Text + "<br> Time :
" +time.Text + "<br> Venue : " +venue.Text ;
mail.Body = Body;

mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("[email protected]", "suryainfoedge");
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);
}
catch
{
Response.Write("No Internet Connection....");
}
}

}
}

151
Cancle meating (Canclemeating.aspx)

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


AutoEventWireup="true" CodeFile="Cancel Meeting.aspx.cs"
Inherits="Admin_Cancel_Meeting" %>

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


<style type="text/css">
.style1
{
width: 100%;
margin-right: 0px;
}
.style2
{
width: 929px;
}
.style3
{
width: 54px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Date] FROM [tblMeeting]"></asp:SqlDataSource>
<table class="style1">
<tr>
<td class="style3">
Date :
</td>
<td class="style2">
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1" DataTextField="Date" DataValueField="Date">
</asp:DropDownList>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
BorderColor="Red" ControlToValidate="DropDownList1"
Display="Dynamic"
ErrorMessage="Please Enter Date">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style3">
Reason:
</td>
<td class="style2">

152
<asp:TextBox ID="TextBox1" runat="server" Height="62px" TextMode="MultiLine"
Width="229px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
BorderColor="Red" ControlToValidate="TextBox1" Display="Dynamic"
ErrorMessage="Please Enter Description">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style3">
<asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
</td>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td class="style3">
&nbsp;</td>
<td class="style2">
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
Text="Cancel Meeting" />
</td>
<td>
&nbsp;</td>
</tr>
</table>
</p>
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
ShowMessageBox="True" ShowSummary="False" />
<p>
</p>
<p>
&nbsp;</p>
<p>
&nbsp;</p></asp:Content>

Java code for Cancle meeating


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

153
public partial class Admin_Cancel_Meeting : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = System.DateTime.Now.Date.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();

// Response.Write(title.Text + " " + time.Text +" " + date.Text + " " + venue.Text);
SqlCommand cmd = new SqlCommand("select emailid from tblowner", conn);
SqlDataReader sdr = cmd.ExecuteReader();

while (sdr.Read())
{
string em = sdr.GetString(0);
//Response.Write(em);

try
{
String EmailAddress;
EmailAddress = em;
MailMessage mail = new MailMessage();

mail.To.Add(EmailAddress);
mail.From = new MailAddress("[email protected]");
mail.Subject = "Meeting Canceled";
string Body = "Date : " + DropDownList1.SelectedValue + "<br>Reason : " +
TextBox1.Text;
mail.Body = Body;

mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("[email protected]", "suryainfoedge");
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);
}
catch
{
Response.Write("No Internet Connection....");
}
} }}

154
View meeting(Viewmeeting.aspx)

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


AutoEventWireup="true" CodeFile="View Meeting.aspx.cs"
Inherits="Admin_View_Meeting" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<p>
Select:</p>
<p>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True"
onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">
<asp:ListItem Selected="True">Scheduled</asp:ListItem>
<asp:ListItem>Held Meeting</asp:ListItem>
</asp:RadioButtonList>
</p>
<p>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None"
BorderWidth="1px"
CellPadding="3" CellSpacing="2" DataKeyNames="Id"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Time" HeaderText="Time" SortExpression="Time"
/>
<asp:BoundField DataField="Venue" HeaderText="Venue"
SortExpression="Venue" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White"
/>
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

155
SelectCommand="SELECT [Id], [Title], [Date], [Time], [Venue], [Description]
FROM [tblMeeting] WHERE ([Date] &gt;= @Date) ORDER BY [Id]">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" DbType="Date" Name="Date"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
</p>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None"
BorderWidth="1px"
CellPadding="3" CellSpacing="2" DataKeyNames="Id"
datasourceid="SqlDataSource2"
Visible="False">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Time" HeaderText="Time" SortExpression="Time" />
<asp:BoundField DataField="Venue" HeaderText="Venue" SortExpression="Venue"
/>
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
<asp:BoundField DataField="Minutes" HeaderText="Minutes"
SortExpression="Minutes" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [tblMeeting] WHERE ([Date] &lt;= @Date)
ORDER BY [Id] DESC">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" DbType="Date" Name="Date"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
<p>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</p>
</asp:Content>

156
Java code for View meeting
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

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


{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = System.DateTime.Now.Date.ToString();
}
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)
{
GridView1.Visible = true;
GridView2.Visible = false;
}
else
{
GridView1.Visible = false;
GridView2.Visible = true;
}
}
}

157
Replay (Replay.aspx)

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


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

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


<style type="text/css">
.style1
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:FormView ID="FormView1" runat="server" AllowPaging="True"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None"
BorderWidth="1px"
CellPadding="3" CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1"
DefaultMode="Edit" GridLines="Both" Width="403px" HeaderText="Reply">
<EditItemTemplate>
<table class="style1">
<tr>
<td>
Id:</td>
<td>
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Query:</td>
<td>
<asp:TextBox ID="QueryTextBox" runat="server" Height="67px"
ReadOnly="True"
Text='<%# Bind("Query") %>' TextMode="MultiLine" Width="249px" />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
BorderColor="Red" ControlToValidate="QueryTextBox"
ErrorMessage="Please Enter Query">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Respone:</td>
<td>
<asp:TextBox ID="ResponeTextBox" runat="server" Height="61px"
Text='<%# Bind("Respone") %>' TextMode="MultiLine" Width="241px" />

158
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
BorderColor="Red" ControlToValidate="ResponeTextBox"
Display="Dynamic"
ErrorMessage="Please Enter Response">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
date:
</td>
<td>
<asp:TextBox ID="dateTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("date") %>' />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
BorderColor="Red" ControlToValidate="dateTextBox" Display="Dynamic"
ErrorMessage="Please Enter Date">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;<asp:Button ID="UpdateButton" runat="server"
CausesValidation="True"
CommandName="Update" Text="Update" />
</td>
<td style="margin-left: 80px">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="UpdateCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</td>
<td>
&nbsp;</td>
</tr>
</table>
&nbsp;<br />&nbsp;<asp:ValidationSummary ID="ValidationSummary1"
runat="server"

159
ShowMessageBox="True" ShowSummary="False" />
<br />&nbsp;<br />
<br />
&nbsp;
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
Query:
<asp:TextBox ID="QueryTextBox" runat="server" Text='<%# Bind("Query") %>'
Height="63px" ReadOnly="True" TextMode="MultiLine" Width="239px" />
<br />
Respone:
<asp:TextBox ID="ResponeTextBox" runat="server" Text='<%# Bind("Respone") %>'
Height="65px" TextMode="MultiLine" Width="230px" />
<br />
date:
<asp:TextBox ID="dateTextBox" runat="server" Text='<%# Bind("date") %>'
ReadOnly="True" />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
Query:
<asp:Label ID="QueryLabel" runat="server" Text='<%# Bind("Query") %>' />
<br />
Respone:
<asp:Label ID="ResponeLabel" runat="server" Text='<%# Bind("Respone") %>' />
<br />
date:
<asp:Label ID="dateLabel" runat="server" Text='<%# Bind("date") %>' />
<br />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [tblComplaints] WHERE ([Respone] = @Respone)"
DeleteCommand="DELETE FROM [tblComplaints] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblComplaints] ([Query], [Respone], [date])
VALUES (@Query, @Respone, @date)"

160
UpdateCommand="UPDATE [tblComplaints] SET [Query] = @Query, [Respone] =
@Respone, [date] = @date WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Query" Type="String" />
<asp:Parameter Name="Respone" Type="String" />
<asp:Parameter DbType="Date" Name="date" />
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="Pending" Name="Respone" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Query" Type="String" />
<asp:Parameter Name="Respone" Type="String" />
<asp:Parameter DbType="Date" Name="date" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Replay


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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

161
View complaint(Viewcomplaint.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master"
AutoEventWireup="true" CodeFile="ViewComplaints.aspx.cs" Inherits="ViewComplaints"
%>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Query" HeaderText="Query" SortExpression="Query" />
<asp:BoundField DataField="Respone" HeaderText="Respone"
SortExpression="Respone" />
<asp:BoundField DataField="date" HeaderText="date" SortExpression="date" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblComplaints] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblComplaints] ([Query], [Respone], [date]) VALUES
(@Query, @Respone, @date)"
SelectCommand="SELECT * FROM [tblComplaints]"
UpdateCommand="UPDATE [tblComplaints] SET [Query] = @Query, [Respone] =
@Respone, [date] = @date WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Query" Type="String" />
<asp:Parameter Name="Respone" Type="String" />
<asp:Parameter DbType="Date" Name="date" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Query" Type="String" />
<asp:Parameter Name="Respone" Type="String" />

162
<asp:Parameter DbType="Date" Name="date" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for View complaint


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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

163
Entry guest(Entryguest.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Security/Site.master"
AutoEventWireup="true" CodeFile="Entry.aspx.cs" Inherits="Security_Entry" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" GridLines="Both" oniteminserted="FormView1_ItemInserted"
HeaderText="Guest Entry">
<EditItemTemplate>
Id:
<asp:Label ID="IdLabel1" runat="server" Text='<%# Eval("Id") %>' />
<br />
BuildingNo:
<asp:TextBox ID="BuildingNoTextBox" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:TextBox ID="WingNoTextBox" runat="server" Text='<%# Bind("WingNo") %>'
/>
<br />
RoomNo:
<asp:TextBox ID="RoomNoTextBox" runat="server" Text='<%# Bind("RoomNo") %>'
/>
<br />
Name:
<asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
<br />
ContactNo:
<asp:TextBox ID="ContactNoTextBox" runat="server"
Text='<%# Bind("ContactNo") %>' />
<br />
InterCom:
<asp:TextBox ID="InterComTextBox" runat="server"
Text='<%# Bind("InterCom") %>' />
<br />
NoOfPerson:
<asp:TextBox ID="NoOfPersonTextBox" runat="server"
Text='<%# Bind("NoOfPerson") %>' />
<br />
Vehical:
<asp:TextBox ID="VehicalTextBox" runat="server" Text='<%# Bind("Vehical") %>' />
<br />
VehicalNo:
<asp:TextBox ID="VehicalNoTextBox" runat="server"
Text='<%# Bind("VehicalNo") %>' />

164
<br />
DateTime:
<asp:TextBox ID="DateTimeTextBox" runat="server"
Text='<%# Bind("DateTime") %>' />
<br />
CallResponse:
<asp:TextBox ID="CallResponseTextBox" runat="server"
Text='<%# Bind("CallResponse") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<InsertItemTemplate>
BuildingNo:
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource5" DataTextField="BuildingNo"
DataValueField="BuildingNo" SelectedValue='<%# Bind("BuildingNo") %>'
onselectedindexchanged="DropDownList2_SelectedIndexChanged">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource5" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT DISTINCT [BuildingNo] FROM [tblOwner]">
</asp:SqlDataSource>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("BulidingNo") %>'
Visible="False"></asp:Label>
<br />
WingNo:
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource6" DataTextField="WingNo"
DataValueField="WingNo"
onselectedindexchanged="DropDownList3_SelectedIndexChanged">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource6" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT DISTINCT [WingNo] FROM [tblOwner] WHERE


([BuildingNo] = @BuildingNo)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("WingNo") %>'
Visible="False"></asp:Label>
<br />

165
RoomNo:
<asp:DropDownList ID="DropDownList4" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource7" DataTextField="RoomNo"
DataValueField="RoomNo"
onselectedindexchanged="DropDownList4_SelectedIndexChanged">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource7" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT DISTINCT [RoomNo] FROM [tblOwner] WHERE


(([BuildingNo] = @BuildingNo) AND ([WingNo] = @WingNo))">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="BuildingNo"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList3" Name="WingNo"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("RoomNo") %>'
Visible="False"></asp:Label>
<br />
<asp:Button ID="Refresh" runat="server" onclick="Button1_Click"
Text="Refresh" />
<br />
<br />
Name:
<asp:TextBox ID="NameTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("Name") %>' />
<br />
ContactNo:
<asp:TextBox ID="ContactNoTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("ContactNo") %>' />
<br />
InterCom:
<asp:TextBox ID="InterComTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("InterCom") %>' />
<br />
NoOfPerson:
<asp:TextBox ID="NoOfPersonTextBox" runat="server"
Text='<%# Bind("NoOfPerson") %>' />
<br />
Vehical:
<asp:DropDownList ID="DropDownList5" runat="server" AutoPostBack="True"
SelectedValue='<%# Bind("Vehical") %>'>
<asp:ListItem>No</asp:ListItem>
<asp:ListItem>Yes</asp:ListItem>
</asp:DropDownList>
<br />
VehicalNo:
<asp:TextBox ID="VehicalNoTextBox" runat="server"

166
Text='<%# Bind("VehicalNo") %>' />
<br />
DateTime:
<asp:TextBox ID="DateTimeTextBox" runat="server" ReadOnly="True"
Text='<%# Bind("DateTime") %>' />
<br />
CallResponse:
<asp:DropDownList ID="DropDownList6" runat="server"
SelectedValue='<%# Bind("CallResponse") %>'>
<asp:ListItem>Dont Allow</asp:ListItem>
<asp:ListItem>Allow</asp:ListItem>
<asp:ListItem>Coming to Receive</asp:ListItem>
</asp:DropDownList>
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
<br />
<br />
</InsertItemTemplate>
<ItemTemplate>
Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
<br />
BuildingNo:
<asp:Label ID="BuildingNoLabel" runat="server"
Text='<%# Bind("BuildingNo") %>' />
<br />
WingNo:
<asp:Label ID="WingNoLabel" runat="server" Text='<%# Bind("WingNo") %>' />
<br />
RoomNo:
<asp:Label ID="RoomNoLabel" runat="server" Text='<%# Bind("RoomNo") %>' />
<br />
Name:
<asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>' />
<br />
ContactNo:
<asp:Label ID="ContactNoLabel" runat="server" Text='<%# Bind("ContactNo") %>' />
<br />
InterCom:
<asp:Label ID="InterComLabel" runat="server" Text='<%# Bind("InterCom") %>' />
<br />
NoOfPerson:
<asp:Label ID="NoOfPersonLabel" runat="server"
Text='<%# Bind("NoOfPerson") %>' />
<br />
Vehical:
<asp:Label ID="VehicalLabel" runat="server" Text='<%# Bind("Vehical") %>' />

167
<br />
VehicalNo:
<asp:Label ID="VehicalNoLabel" runat="server" Text='<%# Bind("VehicalNo") %>' />
<br />
DateTime:
<asp:Label ID="DateTimeLabel" runat="server" Text='<%# Bind("DateTime") %>' />
<br />
CallResponse:
<asp:Label ID="CallResponseLabel" runat="server"
Text='<%# Bind("CallResponse") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblGuest] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblGuest] ([BuildingNo], [WingNo], [RoomNo],
[Name], [ContactNo], [InterCom], [NoOfPerson], [Vehical], [VehicalNo], [DateTime],
[CallResponse]) VALUES (@BuildingNo, @WingNo, @RoomNo, @Name, @ContactNo,
@InterCom, @NoOfPerson, @Vehical, @VehicalNo, @DateTime, @CallResponse)"
SelectCommand="SELECT * FROM [tblGuest]"
UpdateCommand="UPDATE [tblGuest] SET [BuildingNo] = @BuildingNo, [WingNo] =
@WingNo, [RoomNo] = @RoomNo, [Name] = @Name, [ContactNo] = @ContactNo,
[InterCom] = @InterCom, [NoOfPerson] = @NoOfPerson, [Vehical] = @Vehical,
[VehicalNo] = @VehicalNo, [DateTime] = @DateTime, [CallResponse] = @CallResponse
WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="ContactNo" Type="String" />
<asp:Parameter Name="InterCom" Type="String" />
<asp:Parameter Name="NoOfPerson" Type="String" />
<asp:Parameter Name="Vehical" Type="String" />
<asp:Parameter Name="VehicalNo" Type="String" />
<asp:Parameter DbType="Date" Name="DateTime" />
<asp:Parameter Name="CallResponse" Type="String" />
</InsertParameters>

168
<UpdateParameters>
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="ContactNo" Type="String" />
<asp:Parameter Name="InterCom" Type="String" />
<asp:Parameter Name="NoOfPerson" Type="String" />
<asp:Parameter Name="Vehical" Type="String" />
<asp:Parameter Name="VehicalNo" Type="String" />
<asp:Parameter DbType="Date" Name="DateTime" />
<asp:Parameter Name="CallResponse" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

Java code for Entry guest


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

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


{
protected void Page_Load(object sender, EventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

TextBox date = (TextBox)FormView1.FindControl("DateTimeTextBox");


date.Text = System.DateTime.Now.Date.ToString();

169
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd = new SqlCommand("select COALESCE(name, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String name;
try
{
name = cmd.ExecuteScalar().ToString();
}
catch
{
name="Not allocate";
}
conn.Close();

TextBox txtname = (TextBox)FormView1.FindControl("NameTextBox");


txtname.Text = name;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd1 = new SqlCommand("select COALESCE(phoneno, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String phone;
try
{
phone = cmd1.ExecuteScalar().ToString();
}
catch
{
phone = "Not allocated";
}
conn.Close();
TextBox txtphone = (TextBox)FormView1.FindControl("ContactNoTextBox");
txtphone.Text = phone;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd3 = new SqlCommand("select COALESCE(intercom, 'Not
allocated')from tblroom where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
string intercom;
try

170
{
intercom = cmd3.ExecuteScalar().ToString();
}
catch
{
intercom="Not allocated";
}
conn.Close();
TextBox txtintercom = (TextBox)FormView1.FindControl("InterComTextBox");
txtintercom.Text = intercom;

TextBox vehicalno = (TextBox)FormView1.FindControl("VehicalNoTextBox");


DropDownList ddl5 = (DropDownList)FormView1.FindControl("DropDownList5");
if (ddl5.SelectedIndex == 0)
vehicalno.Visible = false;
else
vehicalno.Visible = true;

}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

TextBox date = (TextBox)FormView1.FindControl("DateTimeTextBox");


date.Text = System.DateTime.Now.Date.ToString();

SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd = new SqlCommand("select COALESCE(name, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String name;
try
{
name = cmd.ExecuteScalar().ToString();
}
catch
{

171
name = "Not allocate";
}
conn.Close();

TextBox txtname = (TextBox)FormView1.FindControl("NameTextBox");


txtname.Text = name;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd1 = new SqlCommand("select COALESCE(phoneno, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String phone;
try
{
phone = cmd1.ExecuteScalar().ToString();
}
catch
{
phone = "Not allocated";
}
conn.Close();
TextBox txtphone = (TextBox)FormView1.FindControl("ContactNoTextBox");
txtphone.Text = phone;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd3 = new SqlCommand("select COALESCE(intercom, 'Not
allocated')from tblroom where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
string intercom;
try
{
intercom = cmd3.ExecuteScalar().ToString();
}
catch
{
intercom = "Not allocated";
}
conn.Close();
TextBox txtintercom = (TextBox)FormView1.FindControl("InterComTextBox");
txtintercom.Text = intercom;

TextBox vehicalno = (TextBox)FormView1.FindControl("VehicalNoTextBox");


DropDownList ddl5 = (DropDownList)FormView1.FindControl("DropDownList5");
if (ddl5.SelectedIndex == 0)

172
vehicalno.Visible = false;
else
vehicalno.Visible = true;
}
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

TextBox date = (TextBox)FormView1.FindControl("DateTimeTextBox");


date.Text = System.DateTime.Now.Date.ToString();

SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd = new SqlCommand("select COALESCE(name, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String name;
try
{
name = cmd.ExecuteScalar().ToString();
}
catch
{
name = "Not allocate";
}
conn.Close();

TextBox txtname = (TextBox)FormView1.FindControl("NameTextBox");


txtname.Text = name;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd1 = new SqlCommand("select COALESCE(phoneno, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String phone;

173
try
{
phone = cmd1.ExecuteScalar().ToString();
}
catch
{
phone = "Not allocated";
}
conn.Close();
TextBox txtphone = (TextBox)FormView1.FindControl("ContactNoTextBox");
txtphone.Text = phone;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd3 = new SqlCommand("select COALESCE(intercom, 'Not
allocated')from tblroom where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
string intercom;
try
{
intercom = cmd3.ExecuteScalar().ToString();
}
catch
{
intercom = "Not allocated";
}
conn.Close();
TextBox txtintercom = (TextBox)FormView1.FindControl("InterComTextBox");
txtintercom.Text = intercom;

TextBox vehicalno = (TextBox)FormView1.FindControl("VehicalNoTextBox");


DropDownList ddl5 = (DropDownList)FormView1.FindControl("DropDownList5");
if (ddl5.SelectedIndex == 0)
vehicalno.Visible = false;
else
vehicalno.Visible = true;
}
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");

174
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

TextBox date = (TextBox)FormView1.FindControl("DateTimeTextBox");


date.Text = System.DateTime.Now.Date.ToString();

SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd = new SqlCommand("select COALESCE(name, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String name;
try
{
name = cmd.ExecuteScalar().ToString();
}
catch
{
name = "Not allocate";
}
conn.Close();

TextBox txtname = (TextBox)FormView1.FindControl("NameTextBox");


txtname.Text = name;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd1 = new SqlCommand("select COALESCE(phoneno, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String phone;
try
{
phone = cmd1.ExecuteScalar().ToString();
}
catch
{
phone = "Not allocated";
}
conn.Close();
TextBox txtphone = (TextBox)FormView1.FindControl("ContactNoTextBox");
txtphone.Text = phone;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);

175
conn.Open();
SqlCommand cmd3 = new SqlCommand("select COALESCE(intercom, 'Not
allocated')from tblroom where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
string intercom;
try
{
intercom = cmd3.ExecuteScalar().ToString();
}
catch
{
intercom = "Not allocated";
}
conn.Close();
TextBox txtintercom = (TextBox)FormView1.FindControl("InterComTextBox");
txtintercom.Text = intercom;

TextBox vehicalno = (TextBox)FormView1.FindControl("VehicalNoTextBox");


DropDownList ddl5 = (DropDownList)FormView1.FindControl("DropDownList5");
if (ddl5.SelectedIndex == 0)
vehicalno.Visible = false;
else
vehicalno.Visible = true;
}
protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList d2 = (DropDownList)FormView1.FindControl("DropDownList2");
Label l3 = (Label)FormView1.FindControl("Label3");
l3.Text = d2.SelectedValue;

DropDownList d3 = (DropDownList)FormView1.FindControl("DropDownList3");
Label l1 = (Label)FormView1.FindControl("Label1");
l1.Text = d3.SelectedValue;

DropDownList d4 = (DropDownList)FormView1.FindControl("DropDownList4");
Label l2 = (Label)FormView1.FindControl("Label2");
l2.Text = d4.SelectedValue;

TextBox date = (TextBox)FormView1.FindControl("DateTimeTextBox");


date.Text = System.DateTime.Now.Date.ToString();

SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd = new SqlCommand("select COALESCE(name, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String name;
try

176
{
name = cmd.ExecuteScalar().ToString();
}
catch
{
name = "Not allocate";
}
conn.Close();

TextBox txtname = (TextBox)FormView1.FindControl("NameTextBox");


txtname.Text = name;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd1 = new SqlCommand("select COALESCE(phoneno, 'Not allocated')
from tblowner where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
String phone;
try
{
phone = cmd1.ExecuteScalar().ToString();
}
catch
{
phone = "Not allocated";
}
conn.Close();
TextBox txtphone = (TextBox)FormView1.FindControl("ContactNoTextBox");
txtphone.Text = phone;

//SqlConnection conn = new


SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
conn.Open();
SqlCommand cmd3 = new SqlCommand("select COALESCE(intercom, 'Not
allocated')from tblroom where buildingno='" + d2.SelectedValue + "' and wingno='" +
d3.SelectedValue + "' and roomno='" + l2.Text + "'", conn);
string intercom;
try
{
intercom = cmd3.ExecuteScalar().ToString();
}
catch
{
intercom = "Not allocated";
}
conn.Close();
TextBox txtintercom = (TextBox)FormView1.FindControl("InterComTextBox");

177
txtintercom.Text = intercom;

TextBox vehicalno = (TextBox)FormView1.FindControl("VehicalNoTextBox");


DropDownList ddl5 = (DropDownList)FormView1.FindControl("DropDownList5");
if (ddl5.SelectedIndex == 0)
vehicalno.Visible = false;
else
vehicalno.Visible = true;
}
protected void Button1_Click(object sender, EventArgs e)
{

}
}

178
View guest(Viewguest.aspx)
<%@ Page Title="" Language="C#" MasterPageFile="~/Security/Site.master"
AutoEventWireup="true" CodeFile="View.aspx.cs" Inherits="Security_View" %>

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


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" DataKeyNames="Id" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="BuildingNo" HeaderText="BuildingNo"
SortExpression="BuildingNo" />
<asp:BoundField DataField="WingNo" HeaderText="WingNo"
SortExpression="WingNo" />
<asp:BoundField DataField="RoomNo" HeaderText="RoomNo"
SortExpression="RoomNo" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="ContactNo" HeaderText="ContactNo"
SortExpression="ContactNo" />
<asp:BoundField DataField="InterCom" HeaderText="InterCom"
SortExpression="InterCom" />
<asp:BoundField DataField="NoOfPerson" HeaderText="NoOfPerson"
SortExpression="NoOfPerson" />
<asp:BoundField DataField="Vehical" HeaderText="Vehical"
SortExpression="Vehical" />
<asp:BoundField DataField="VehicalNo" HeaderText="VehicalNo"
SortExpression="VehicalNo" />
<asp:BoundField DataField="DateTime" HeaderText="DateTime"
SortExpression="DateTime" />
<asp:BoundField DataField="CallResponse" HeaderText="CallResponse"
SortExpression="CallResponse" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

179
DeleteCommand="DELETE FROM [tblGuest] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [tblGuest] ([BuildingNo], [WingNo], [RoomNo],
[Name], [ContactNo], [InterCom], [NoOfPerson], [Vehical], [VehicalNo], [DateTime],
[CallResponse]) VALUES (@BuildingNo, @WingNo, @RoomNo, @Name, @ContactNo,
@InterCom, @NoOfPerson, @Vehical, @VehicalNo, @DateTime, @CallResponse)"
SelectCommand="SELECT * FROM [tblGuest] ORDER BY [Id] DESC"
UpdateCommand="UPDATE [tblGuest] SET [BuildingNo] = @BuildingNo, [WingNo] =
@WingNo, [RoomNo] = @RoomNo, [Name] = @Name, [ContactNo] = @ContactNo,
[InterCom] = @InterCom, [NoOfPerson] = @NoOfPerson, [Vehical] = @Vehical,
[VehicalNo] = @VehicalNo, [DateTime] = @DateTime, [CallResponse] = @CallResponse
WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="ContactNo" Type="String" />
<asp:Parameter Name="InterCom" Type="String" />
<asp:Parameter Name="NoOfPerson" Type="String" />
<asp:Parameter Name="Vehical" Type="String" />
<asp:Parameter Name="VehicalNo" Type="String" />
<asp:Parameter DbType="Date" Name="DateTime" />
<asp:Parameter Name="CallResponse" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="BuildingNo" Type="String" />
<asp:Parameter Name="WingNo" Type="String" />
<asp:Parameter Name="RoomNo" Type="String" />
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="ContactNo" Type="String" />
<asp:Parameter Name="InterCom" Type="String" />
<asp:Parameter Name="NoOfPerson" Type="String" />
<asp:Parameter Name="Vehical" Type="String" />
<asp:Parameter Name="VehicalNo" Type="String" />
<asp:Parameter DbType="Date" Name="DateTime" />
<asp:Parameter Name="CallResponse" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Content>

180
Java code for Viewguest

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

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

181
CHAPTER: 7

Future Enhancement

182
7.1 : FUTURE ENHANCEMENT

This project can be enhanced further by adding online payment facility for the
members to reduce the extra work of the admin.
The software is flexible enough to be modified and implemented as per future
requirements.
We have tried our best to pre- sent this free and user–friendly website to Society
members.
Message and Email alerts for various happenings in the society can be added to the
system so that users do not miss the updates and happenings of the society.

183
CHAPTER: 8

Conclusion

184
8.1: Conclusion

 System helps to keep all the data about customers and supplier to be stored in
computer and there is no need to do paper work.

 Data is going to be preserved carefully for longer period hence proper backup is
required otherwise there is chance of losing entries.

 There are also chances that calculation error can occur which can cause huge
problem.

 The System allows the user to add about new supplier machine, material to order.
It also allows entering the received material information, material return
information, working payment information.

 This information can be modified, deleted as required.

185
CHAPTER: 9

Reference

186
9.1: Reference:

1 ) http://www.w3schools.com

2 ) http://www.wikipedia.com

3 ) docs.oracle.com/javase/tutorial/

4 ) www.sqlservercentral.com

5 ) https://www.visualstudio.com/

6 ) https://Microsoft.net.msdn

7 ) https://www.tutorialspoint.com/csharp/

187

You might also like