Professional Documents
Culture Documents
In P2P Systems
Abstract
in the system. This maintains a low cost for updating peer indexes when peers join or
leave and also achieves data and search load balancing,
Until recently, research has focused mostly on P2P systems that handle 1D data such as
strings and numbers. However, the need for P2P applications that manage
multidimensional data has emerged. These systems pose additional requirements that
stem from the particularities of such data. In centralized multidimensional applications,
information is stored according to its multidimensional extent using an indexing structure
Typically, these structures preserve the locality and the directionality of multidimensional
information. Intuitively, locality implies that neighboring multidimensional information
is stored in neighboring nodes, while directionality implies that the index structure
preserves orientation. The notions of locality and directionality are very important. If an
index structure preserves these properties then searching in the index corresponds to
searching in the multidimensional space which can highly improve query evaluation cost.
In the literature, there exist two different paradigms for handling multidimensional data in
P2P systems. The first paradigm proposes the use of a distributed version of some
centralized multidimensional index. The main challenge of these approaches is to avoid
the bottleneck occurring at the peer storing the root of the tree (since every search has to
pass through this peer). The work in alleviates the traffic burden of the root by initiating
the search at a pre specified level below the root. Moreover, the work in proposes
sideway index links that help to avoid searching the index from the root
1.1 PROJECT DESCRIPTION:
The project entitled as Active Learning Methods for Interactive Image Retrieval
developed using .NET using C#. Modules display as follows
1. Connecting Peer
2. Successors and Indexed Peer
3. Data Storing
Module Description
Connecting Peer
All the peers are connected here to form a LAN. Many nodes can connect in a LAN.LAN
is the collection of systems, a network. In this module, connecting al the system from a
remote machine and sharing the resources. This module helps to see how many systems
are connected and to know shared resources.
Successors and Indexed Peer
Successors assure that there is always a path between two arbitrary peers in the network.
a search that is entirely based on successors is not efficient since it may result in long
search paths. To speed up searching, a peer also stores the location of additional peers.
Such peers are called indexed peers.
Data Storing
Data of a same object or related data can store from various peers. This makes easy of
data storage in peer to peer systems.
2. SYSTEM STUDY
2.1 FEASIBILITY STUDY
The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During system
analysis the feasibility study of the proposed system is to be carried out. This is to ensure
that the proposed system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential.
Three key considerations involved in the feasibility analysis are
ECONOMICAL FEASIBILITY
TECHNICAL FEASIBILITY
SOCIAL FEASIBILITY
ECONOMICAL FEASIBILITY
This study is carried out to check the economic impact that the system will have on the
organization. The amount of fund that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the
developed system as well within the budget and this was achieved because most of the
technologies used are freely available. Only the customized products had to be purchased.
TECHNICAL FEASIBILITY
This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on the
available technical resources. This will lead to high demands on the available technical
resources. This will lead to high demands being placed on the client. The developed
system must have a modest requirement, as only minimal or null changes are required for
implementing this system.
SOCIAL FEASIBILITY
The aspect of study is to check the level of acceptance of the system by the user.
This includes the process of training the user to use the system efficiently. The user must
not feel threatened by the system, instead must accept it as a necessity. The level of
acceptance by the users solely depends on the methods that are employed to educate the
user about the system and to make him familiar with it. His level of confidence must be
raised so that he is also able to make some constructive criticism, which is welcomed, as
he is the final user of the system.
Existing System
SPATIALP2P distributes the spatial information to peers and guarantees the retrieval of
any spatial area that exists in the system with low space and time complexity. These
Systems can handle only 1D data such as strings and numbers. Storing and sharing the
spatial information in a centralized manner. The locality and directionality of the spatial
data is very tough and we cant partition the space and define the appropriate distance.
There is no sideway index links that help to avoid searching the index from the root. So
there is waste of time in searching from the beginning to the end and there is no proper
structure to get the spatial data.
Disadvantages:
We cant able to calculate the distance between two cells for the
multidimensional and spatial data.
The peer p that cant update its index list initiates individual searches for
each index entry.
There is no proper load balancing .so peers overloaded with stored data
and there is no traffic bottleneck in the network.
Proposed System
The Proposed System uses two techniques in the first category are based on the
idea that 1D index can be reused in order to manage multidimensional data, if the
dimensionality is reduced to one. This idea was the first to be explored. Techniques in the
second category are based on the idea that centralized hierarchical indexes can be reused
to manage dispersed multidimensional data, if they are properly distributed. . Finally,
contrary to existing DHT-based approaches, SPATIALP2P captures the locality and
directionality of the 2D space. In this network we can partition the space and define the
appropriate distance. It achieve data and search load balancing, i.e., there are no peers
overloaded with stored data and there are no traffic bottleneck in the network.
Advantages:
1. Using an indexing structure (e.g., R-tree). Typically, these structures preserve the
locality and the directionality of multidimensional information.
2. We can avoid the traffic of data by using index searching. The peer p that can
update its index list initiates individual searches for each index entry.
3. SYSTEM SPECIFICATION
Hardware Requirements
SYSTEM
HARD DISK
: 40 GB
FLOPPY DRIVE
: 1.44 MB
MONITOR
: 15 VGA colour
MOUSE
: Logitech.
RAM
: 256 MB
Software Requirements
Operating system
:- Windows XP Professional
Front End
Coding Language
Database
4. LANGAUGE SPECIFICATION
4.1 features OF. net
Microsoft .NET is a set of Microsoft software technologies for rapidly building and
integrating XML Web services, Microsoft Windows-based applications, and Web
solutions. The .NET Framework is a language-neutral platform for writing programs that
can easily and securely interoperate. Theres no language barrier with .NET: there are
numerous languages available to the developer including Managed C++, C#, Visual Basic
and Java Script. The .NET framework provides the foundation for components to interact
seamlessly, whether locally or remotely on different platforms. It standardizes common
data types and communications protocols so that components created in different
languages can easily interoperate.
.NET is also the collective name given to various software components built upon
the .NET platform. These will be both products (Visual Studio.NET and Windows.NET
Server, for instance) and services (like Passport, .NET My Services, and so on).
Conversion
from
low-level
assembler-style
language,
called
Loading and executing programs, with version control and other such
features.
The following features of the .NET framework are also worth description:
Managed Code
The code that targets .NET, and which contains certain extra
Information - metadata - to describe itself. Whilst both managed and unmanaged code
can run in the runtime, only managed code contains the information that allows the CLR
to guarantee, for instance, safe execution and interoperability.
Managed Data
With Managed Code comes Managed Data. CLR provides memory allocation and Deal
location facilities, and garbage collection. Some .NET languages use Managed Data by
default, such as C#, Visual Basic.NET and JScript.NET, whereas others, namely C++, do
not. Targeting CLR can, depending on the language youre using, impose certain
constraints on the features available. As with managed and unmanaged code, one can
have both managed and unmanaged data in .NET applications - data that doesnt get
garbage collected but instead is looked after by unmanaged code.
XML Web services. The .NET framework supports new versions of Microsofts old
favorites Visual Basic and C++ (as VB.NET and Managed C++), but there are also a
number of new additions to the family.
Visual Basic .NET has been updated to include many new and improved language
features that make it a powerful object-oriented programming language. These features
include inheritance, interfaces, and overloading, among others. Visual Basic also now
supports structured exception handling, custom attributes and also supports multithreading.
Visual Basic .NET is also CLS compliant, which means that any CLS-compliant
language can use the classes, objects, and components you create in Visual Basic .NET.
Managed Extensions for C++ and attributed programming are just some of the
enhancements made to the C++ language. Managed Extensions simplify the task of
migrating existing C++ applications to the new .NET Framework.
C# is Microsofts new language. Its a C-style language that is essentially C++ for Rapid
Application Development. Unlike other languages, its specification is just the grammar
of the language. It has no standard library of its own, and instead has been designed with
the intention of using the .NET libraries as its own.
Microsoft Visual J# .NET provides the easiest transition for Java-language developers
into the world of XML Web Services and dramatically improves the interoperability of
Java-language programs with existing software written in a variety of other programming
languages.
Active State has created Visual Perl and Visual Python, which enable .NET-aware
applications to be built in either Perl or Python. Both products can be integrated into the
Visual Studio .NET environment. Visual Perl includes support for Active States Perl Dev
Kit.
FORTRAN
COBOL
Eiffel
Windows Forms
C#.NET is also compliant with CLS (Common Language Specification) and supports
structured exception handling. CLS is set of rules and constructs that are supported by the
CLR (Common Language Runtime). CLR is the runtime environment provided by the
.NET Framework; it manages the execution of the code and also makes the development
process easier by providing services.
C#.NET is a CLS-compliant language. Any objects, classes, or components that created
in C#.NET can be used in any other CLS-compliant language. In addition, we can use
objects, classes, and components created in other CLS-compliant languages in C#.NET
.The use of CLS ensures complete interoperability among applications, regardless of the
languages used to create the application.
CONSTRUCTORS AND DESTRUCTORS:
Constructors are used to initialize objects, whereas destructors are used to
destroy them. In other words, destructors are used to release the resources allocated to the
object. In C#.NET the sub finalize procedure is available. The sub finalize procedure is
used to complete the tasks that must be performed when an object is destroyed. The sub
finalize procedure is called automatically when an object is destroyed. In addition, the
sub finalize procedure can be called only from the class it belongs to or from derived
classes.
GARBAGE COLLECTION
Garbage Collection is another new feature in C#.NET. The .NET Framework monitors
allocated resources, such as objects and variables. In addition, the .NET Framework
automatically releases memory for reuse by destroying objects that are no longer in use.
In C#.NET, the garbage collector checks for the objects that are not currently in use by
applications. When the garbage collector comes across an object that is marked for
garbage collection, it releases the memory occupied by the object.
OVERLOADING
Overloading is another feature in C#. Overloading enables us to define multiple
procedures with the same name, where each procedure has a different set of arguments.
Besides using overloading for procedures, we can use it for constructors and properties in
a class.
MULTITHREADING:
C#.NET also supports multithreading. An application that supports multithreading can
handle multiple tasks simultaneously, we can use multithreading to decrease the time
taken by an application to respond to user interaction.
STRUCTURED EXCEPTION HANDLING
C#.NET supports structured handling, which enables us to detect and
remove errors at runtime. In C#.NET, we need to use TryCatchFinally statements to
5. SYSTEM DESIGN
CONNECT PEER
SUCCESSOR AND
INDEXED PEER
Module Diagram
DATA STORING
STOP
UML Diagrams
Use case diagram
Successor Peer
ADMIN
Search data
Full Connection
Indexed Peer
Class diagram
PEER
PeerID
Filename
Succesor
Indexed
SearchFile
Filenames
Peername
search()
Peer()
Indexed Peer
index_name
suc_name
peer_list
Successor
suc_name
suc_pair
find()
refresh()
Refresh()
Object diagram
Login
Peer Collection
Search
Successor
Access File
State diagram
Search
Indexers
Collection Successor
Peer Indexer
LAN
Search
Activity diagram
Retrive
Data
Successor
Search
Connection Of
peer
Access
Login
Successor
Show Data
Sequence diagram
USER
SUCCESSOR
ACCESS COLLECTION
DATA
COMBINE
OUTPUT
NEIGHBORS
SEARCH SYSTEM
DATA
RELATED DATA
Collaboration Diagram
Component Diagram
Successor
Data
Collection
ADMIN
USER
Indexer
Search Data
User
1: Neighbors
E-R diagram
OUTPUT
Successor
DATA
4: Related Data
2: Search System
HAS
LAN
3: Data
Access
Data
Collection
Combine
PEERS
PEER
HAS
SUCCESSO
R
COLLECTI
ON DATA
INDEXER
ADMIN
CONTROL
LAN
USERNA
ME
PASSWORD
Dataflow diagram
USER
Connect Peer
Search
Peer
Collect Related
Data
Show
Output
Data
User
Connect
Network
Stop
Store Data
Result
Combination
Search Data
Collection of
Data
System Architecture
USER
PEER
COLLECTION
SUCCESSOR
INDEXER
STORE
ACESS
DATA
SEARCH
the required results. Testing has to be done using the two common steps Unit testing and
Integration testing. In the project system testing is made as follows:
The procedure level testing is made first. By giving improper inputs, the errors occurred
are noted and eliminated. This is the final step in system life cycle. Here we implement
the tested error-free system into real-life environment and make necessary changes,
which runs in an online fashion. Here system maintenance is done every months or year
based on company policies, and is checked for errors like runtime errors, long run errors
and other maintenances like table verification and reports.
6.1. UNIT TESTING
Unit testing verification efforts on the smallest unit of software design, module.
This is known as Module Testing. The modules are tested separately. This testing is
carried out during programming stage itself. In these testing steps, each module is found
to be working satisfactorily as regard to the expected output from the module.
6.2. INTEGRATION TESTING
Integration testing is a systematic technique for constructing tests to uncover error
associated within the interface. In the project, all the modules are combined and then the
entire programmer is tested as a whole. In the integration-testing step, all the error
uncovered is corrected for the next testing steps.
7. SYSTEM IMPLEMENTATION
Implementation is the stage of the project when the theoretical design is turned out
into a working system. Thus it can be considered to be the most critical stage in achieving
a successful new system and in giving the user, confidence that the new system will work
and be effective.
The implementation stage involves careful planning, investigation of the existing
system and its constraints on implementation, designing of methods to achieve
changeover and evaluation of changeover methods.
Implementation is the process of converting a new system design into operation. It is
the phase that focuses on user training, site preparation and file conversion for installing a
candidate system. The important factor that should be considered here is that the
conversion should not disrupt the functioning of the organization
Future Enhancements
This project addresses some technical challenges, i.e.,Locality Preserving Function, query
and update routing protocols, and cluster-preserving load balancing. A high level of
object clustering is achieved by using the LPF on top of the existing DHTs without
requiring much change to the DHTs. Efficient query and update routing protocols
maximize the benefit of object clustering by significantly reducing the number of DHT
lookups. The load balancing schemes well distribute loads among peer nodes while
preserving the clustering property.
In the future, want to solve the challenges and intend to adjust and test the SPATIALP2P
framework for data of higher dimensions.
Advantages
Conclusion
Research in P2P systems has recently expanded in the domain of multidimensional data.
The techniques that have been proposed until now belong to two broad categories.
Techniques in the first category are based on the idea that 1D indexes can be reused in
order to manage multidimensional data, if the dimensionality is reduced to one. This idea
was the first to be explored. Techniques in the second category are based on the idea that
centralized hierarchical indexes can be reused to manage dispersed multidimensional
data, if they are properly distributed. More elaborated solutions have been proposed in
this category. However, the reusage of existing techniques in the approaches in both
categories leads to the maintenance of some fundamental features that oppose to the
nature of either the distributedness or the multidimensionality. Our intention is to
overcome these shortcomings by creating a technique that manages disperse
multidimensional data in an inherently distributed way without altering the
dimensionality.
Literature Survey
Peer-to-Peer Spatial Queries in Sensor Networks
With the recent advancements in micro-electromechanical- systems (MEMS) related
technology, it has now become feasible to manufacture low power sensors that integrate
detection of infrared radiation, heat, sound, vibration, and magnetism together with onchip intelligence and wireless communication. Progress in this area is significant for its
applications in deploying large ad-hoc wireless sensor networks (potentially consisting of
several thousands of nodes) to retrieve spatial information about an area of interest.
Sensor networks find applications in ecology (e.g., environmental and habitat
monitoring])in precision agriculture (e.g., monitoring of temperature and humidity), in
civil engineering (e.g., monitoring stress levels of buildings under earthquake
simulations), in military and surveillance (e.g., tracking of an intruder), in aerospace
industry (e.g., fairing of cargo in a rocket).
Here, focuses on efficient execution of spatial queries in sensor networks. In particular,
we are concerned with efficient execution of nearest neighbor (NN) queries in sensor
networks: What is the location of the nearest data object to coordinates. The query can
be initiated locally, without the need of a central server. The coordinates given in the
query can be either the current location of the user or a distant location of interest.
Skip Index: Towards a Scalable Peer-to-Peer Index Service for High Dimensional
Data
game status of nearby players in a virtual world, which can be treated as multidimensional range queries. These range queries access a set of closely located players in
parallel. Meanwhile, streams of updates such as players locations and status are
intensively generated. Due to players continuous movements in the virtual world, a
sequence of successive updates is semantically close. Similar situations occur in P2P
auctions. They also intensively generate a high number of range queries and updates
which access highly related objects over multiple attributes, e.g., interest area queries.
M-LIGHT: Indexing Multi-Dimensional Data over DHTs
Distributed Hash Table (DHT) provides a scalable, load balanced, and robust substrate in
building large-scale distributed applications. Whereas simple lookup operations can be
efficiently executed over DHTs, they lack support for complex queries such as range
queries and similarity queries, which are however popular in many P2P applications (e.g.,
finding the songs that are rated above 4 and published during 2007 and 2008). The
reason is that data locality, which is crucial to processing such complex queries, is
destroyed by uniform hashing employed in DHTs.
In the literature, there are two indexing approaches to support complex queries in P2P
systems: 1) over- DHT indexing paradigm which builds an add-on index module over
generic DHTs; 2) DHT-dependent indexing paradigm which modifies the internal
structures of underlying DHTs or develops novel locality-preserved overlays (e.g., Skip
graphs. Although the over-DHT indexing approach is generally less efficient in query
performance than the DHT-dependent indexing approach, it excels in many other aspects
such as simplicity of deployment/ implementation/maintenance and inherited load
balancing. These issues could be particularly important in practice, for example, if one
wants to deploy P2P applications in the world-wide OpenDHT project.
We study the problem of how to efficiently support multi-dimensional range queries in
existing DHTbased P2P systems and thus advocate the over-DHT indexing paradigm. We
propose a novel over-DHT index called m-LIGHT (multi-dimensional Lightweight Hash
Tree over a DHT). Particularly, we investigate the following problems: 1) how to map a
tree-based index into the underlying DHT to better support distributed query processing;
and 2) how to perform index maintenance to better balance the loads of peer nodes. We
consider multi-dimensional data and employ a space-partition based kd-tree to index data.
To distribute the kd-tree over a DHT, we propose a tree-decomposition strategy that
enlarges the local view on each peer yet requires no extra maintenance overhead. We
further propose a novel multi-dimensional naming mechanism to gracefully map the
decomposed tree into the DHT. The naming mechanism possesses several nice properties
that lead to high efficiency in both index maintenance and query processing. Moreover, to
address the load balancing issue in space-partition based indexes, we propose a dataaware index splitting strategy to achieve optimal load balance among peer nodes.
References
F. Banaei-Kashani and C. Shahabi, SWAM: A Family of Access Methods for
Similarity-Search in Peer-to-Peer Data Networks, Proc. 13th ACM Intl Conf.
Information and Knowledge Management (CIKM 04), pp. 304-313, 2004.
A. Bharambe, M. Agrawal, and S. Seshan, MERCURY: Supporting Scalable
Multi-Attribute Range Queries, Proc. ACM SIGCOMM 04, pp. 353-366, 2004.
M. Cai, M. Frank, J. Chen, and P. Szekely, MAAN: A Multiattribute Addressable
Network for Grid Information Services, Proc. Fourth Intl Workshop Grid
Computing (GRID 03), pp. 184-191, 2003.
W. Cai, S. Zhou, L. Xu, W. Qian, and A. Zhou, c2: A New Overlay Network
Based on CAN and Chord, Proc. Intl Conf. Grid and Cooperative Computing
(GCC 03), pp. 42-50, 2003.
APPENDIX
SCREEN SHOTS
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace spatial
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
}
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Threading;
namespace spatial
{
public partial class conpeer : Form
{
string [] pcn = new string[100];
public int no = 0;
Label[] sen = new Label[100];
int m = 1, j = 1;
public conpeer()
{
InitializeComponent();
}
}
private void button1_Click(object sender, EventArgs e)
{
try
{
NetworkBrowser nb = new NetworkBrowser();
foreach (string pc in nb.getNetworkComputers())
{
pcn[no] = pc;
Thread.Sleep(100);
progressBar1.Value = progressBar1.Value + 2;
no++;
}
while (progressBar1.Value < 100)
{
Thread.Sleep(100);
progressBar1.Value = progressBar1.Value + 2;
}
}
catch (Exception ex)
{
MessageBox.Show("error");
Application.Exit();
}
for (int i = 0; i < no; i++)
{
sen[i] = new Label();
sen[i].Name = pcn[i];
sen[i].Size = new Size(60, 30);
sen[i].Location = new Point(j * 170, m * 70);
sen[i].BackColor = Color.Transparent;
j++;
sen[i].Font = new System.Drawing.Font("Palatino
Linotype", 9F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
sen[i].ForeColor = Color.LightGreen;
sen[i].Text = pcn[i];
panel1.Controls.Add(sen[i]);
if (i == 5 || i == 11 || i == 17 || i == 23 || i == 29
|| i == 35 || i == 41 || i == 47 || i == 53 || i == 59 || i == 65)
{
j = 1; m = m + 1;
}
}
}
private void linkLabel1_LinkClicked(object sender,
LinkLabelLinkClickedEventArgs e)
{
success su = new success();
su.no = no;
su.pcn = pcn;
su.Show();
}
}
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
System.Drawing.Drawing2D;
namespace spatial
{
public partial class success : Form
{
public int no;
public string[] pcn = new string[100];
int lx = 1100, ly = 100, lz = 1155, lw = 120;
int i = 0, j = 0;
int f2 = 0, f3 = 0;
int lbx = 140, lby = 90;
Label[] sen = new Label[200];
Label[] suc = new Label[200];
int nosuc = 0; int nosen = 0;
public success()
{
InitializeComponent();
}
private void success_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Pen p = new Pen(Color.Black, 1);
Graphics f = panel1.CreateGraphics();
150; lw = lw + 150;
lx, ly, lz, lw);
lx, ly + 80, lz, lw + 40);
lx + 125, lw, lz + 125, ly);
lx + 125, lw + 40, lz + 125, ly +
lx = lx + 300; lz = lz + 300;
if (j == 1)
{
formGraphics.DrawEllipse(myPen, j * 250, i *
panel1.Controls.Add(suc[nosuc]);
nosuc++;
}
}
else
{
formGraphics.DrawEllipse(myPen, j * 250 +
sen[nosen].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
sen[nosen].ForeColor = Color.Blue;
sen[nosen].Text = "";
panel1.Controls.Add(sen[nosen]);
nosen++;
for (int k = 0; k < 4; k++)
{
int x = lbx + 300; int y = lby+290;
if (k == 1)
y = y + 90;
if (k == 2)
x = x + 240;
if (k == 3)
{
x = x + 240; y = y + 90;
}
suc[nosuc] = new Label();
suc[nosuc].Name = "";
suc[nosuc].BackColor = Color.Transparent;
suc[nosuc].Size = new Size(60, 30);
suc[nosuc].Location = new Point(x, y);
suc[nosuc].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
suc[nosuc].ForeColor = Color.Red;
suc[nosuc].Text = "";
panel1.Controls.Add(suc[nosuc]);
nosuc++;
}
}
}
else if (i == 2)
{
if (f2 == 0)
{
ly = ly +
f2 = 1;
}
f.DrawLine(p,
f.DrawLine(p,
f.DrawLine(p,
f.DrawLine(p,
80);
150; lw = lw + 150;
lx, ly, lz, lw);
lx, ly + 80, lz, lw + 40);
lx + 125, lw, lz + 125, ly);
lx + 125, lw + 40, lz + 125, ly +
lx = lx + 300; lz = lz + 300;
if (j == 1)
{
formGraphics.DrawEllipse(myPen, j * 250, i *
sen[nosen].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
sen[nosen].ForeColor = Color.Blue;
sen[nosen].Text = "";
panel1.Controls.Add(sen[nosen]);
nosen++;
for (int k = 0; k < 4; k++)
{
int x = lbx; int y = lby + 135;
if (k == 1)
y = y + 90;
if (k == 2)
x = x + 240;
if (k == 3)
{
x = x + 240; y = y + 90;
}
suc[nosuc] = new Label();
suc[nosuc].Name = "";
suc[nosuc].BackColor = Color.Transparent;
suc[nosuc].Size = new Size(60, 30);
suc[nosuc].Location = new Point(x, y);
suc[nosuc].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
suc[nosuc].ForeColor = Color.Red;
suc[nosuc].Text = "";
panel1.Controls.Add(suc[nosuc]);
nosuc++;
}
}
else if (j == 3)
{
formGraphics.DrawEllipse(myPen, j * 250 +
100, i * 100 + 50, 80, 80);
sen[nosen] = new Label();
sen[nosen].Name = ""; sen[nosen].BackColor =
Color.Transparent;
sen[nosen].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
sen[nosen].ForeColor = Color.Blue;
sen[nosen].Text = "";
panel1.Controls.Add(sen[nosen]);
nosen++;
for (int k = 0;
{
int x = lbx
if (k == 1)
y = y +
if (k == 2)
x = x +
if (k == 3)
{
x = x +
}
k < 4; k++)
+ 600; int y = lby+135;
90;
240;
240; y = y + 90;
}
else
{
formGraphics.DrawEllipse(myPen, j * 250 +
+ 5, i * 100 + 50 + 25);
sen[nosen].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
sen[nosen].ForeColor = Color.Blue;
sen[nosen].Text = "";
panel1.Controls.Add(sen[nosen]);
nosen++;
for (int k = 0;
{
int x = lbx
if (k == 1)
y = y +
if (k == 2)
x = x +
if (k == 3)
{
x = x +
}
k < 4; k++)
+ 300; int y = lby+135;
90;
240;
240; y = y + 90;
else if (i == 1)
{
lw);
sen[nosen].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
sen[nosen].ForeColor = Color.Blue;
sen[nosen].Text = "";
panel1.Controls.Add(sen[nosen]);
nosen++;
for (int k = 0; k < 4; k++)
{
int x = lbx; int y = lby;
if (k == 1)
y = y + 90;
if (k == 2)
x = x + 240;
if (k == 3)
{
x = x + 240; y = y + 90;
}
suc[nosuc] = new Label();
suc[nosuc].Name = "";
suc[nosuc].BackColor = Color.Transparent;
suc[nosuc].Size = new Size(60, 30);
suc[nosuc].Location = new Point(x, y);
suc[nosuc].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
suc[nosuc].ForeColor = Color.Red;
suc[nosuc].Text = "";
panel1.Controls.Add(suc[nosuc]);
nosuc++;
}
}
else if (j == 3)
{
formGraphics.DrawEllipse(myPen, j * 250 +
Color.Transparent;
sen[nosen].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
sen[nosen].ForeColor = Color.Blue;
sen[nosen].Text = "";
panel1.Controls.Add(sen[nosen]);
nosen++;
for (int k = 0; k < 4; k++)
{
int x = lbx+600; int y = lby;
if (k == 1)
y = y + 90;
if (k == 2)
x = x + 240;
if (k == 3)
{
x = x + 240; y = y + 90;
}
suc[nosuc] = new Label();
suc[nosuc].Name = "";
suc[nosuc].BackColor = Color.Transparent;
suc[nosuc].Size = new Size(60, 30);
suc[nosuc].Location = new Point(x, y);
suc[nosuc].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
suc[nosuc].ForeColor = Color.Red;
suc[nosuc].Text = "";
panel1.Controls.Add(suc[nosuc]);
nosuc++;
}
}
else
{
50, i * 100, 80, 80);
Color.Transparent;
formGraphics.DrawEllipse(myPen, j * 250 +
sen[nosen] = new Label();
sen[nosen].Name = ""; sen[nosen].BackColor =
sen[nosen].Size = new Size(60, 30);
+ 5, i * 100
+ 25);
sen[nosen].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
sen[nosen].ForeColor = Color.Blue;
sen[nosen].Text = "";
panel1.Controls.Add(sen[nosen]);
nosen++;
for (int k = 0; k < 4; k++)
{
int x = lbx+300; int y = lby;
if (k == 1)
y = y + 90;
if (k == 2)
x = x + 240;
if (k == 3)
{
x = x + 240; y = y + 90;
}
suc[nosuc] = new Label();
suc[nosuc].Name = "";
suc[nosuc].BackColor = Color.Transparent;
suc[nosuc].Size = new Size(60, 30);
suc[nosuc].Location = new Point(x, y);
suc[nosuc].Font = new
System.Drawing.Font("Palatino Linotype", 9F,
System.Drawing.FontStyle.Bold);
suc[nosuc].ForeColor = Color.Red;
suc[nosuc].Text = "";
panel1.Controls.Add(suc[nosuc]);
nosuc++;
}
}
}
}
}
for (i = no; i < 45; i++)
pcn[i] = "FREE";
int k1=0,k2=0;
for (i = 0; i < 45; i++)
{
if (i == 2 || i == 7 || i == 12 || i == 17 || i == 22 ||
i == 27 || i == 32 || i == 37 || i == 42)
{
sen[k1].Text = pcn[i].ToString();
k1++;
}
else
{
}
suc[k2].Text = pcn[i].ToString();
k2++;
}
}
}
using
using
using
using
using
System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
using
using
using
using
using
using
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class web_main : System.Web.UI.Page
{
SqlConnection cn = new SqlConnection("Server=.;uid=sa;Initial
Catalog=spatial");
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Visible = false;
cn.Open();
cmd = new SqlCommand("select * from login where uname = '" +
txt_uname.Text + "' and pass = '" + txt_pass.Text + "'", cn);
SqlDataReader dr = cmd.ExecuteReader();
+ "");
if (dr.HasRows)
{
Session["uname"] = txt_uname.Text;
Response.Redirect("web_welcome.aspx?pname=" + txt_uname.Text
}
else
{
}
}
Label1.Visible = true;
}
cn.Close();
using
using
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
System.Text;
string p;
p= Request.QueryString["pname"];
name = Session["uname"].ToString();
StringBuilder sb = new StringBuilder(4096);
sb.Append("<table>");
sb.Append("<tr>");
sb.Append(" <td>");
sb.Append(" <marquee style= font-size:x-large;fontweight:bold;width:500px;color:#5C8CD5>");
sb.Append("Welcome '" + name + "'");
sb.Append("</marquee>");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
Label1.Text = sb.ToString();
}
using
using
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
System.Data.SqlClient;
result.Visible = false;
sid = 101;
data.DBReader("select max(sid)from office");
data.dr.Read();
if (data.dr.HasRows)
{
if (data.dr[0].ToString() != "")
{
sid = Convert.ToInt32(data.dr[0]);
sid = sid + 1;
}
else
sid = 101;
}
data.DBOpen();
using
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
using
using
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
System.Data.SqlClient;
if (Radio1.SelectedItem.Value == "2")
{
data.DBOpen();
data.cmd = new SqlCommand("Exec sem_sp 1," +
Convert.ToInt32(txt_sid.Text) + ",'" + txt_fname.Text + "','" +
txt_sname.Text + "','" + txt_stopic.Text + "','" + txt_dom.Text + "','"
+ txt_ven.Text + "','" + txt_ach.Text + "','" + txt_mem.Text + "'",
data.cn);
data.cmd.ExecuteNonQuery();
data.DBClose();
result.Visible = true;
}
if (Radio1.SelectedItem.Value == "1")
{
data.DBOpen();
data.cmd = new System.Data.SqlClient.SqlCommand("Exec sem_sp
1," + Convert.ToInt32(txt_sid.Text) + ",'" + txt_fname.Text + "','" +
txt_sname.Text + "','" + txt_stopic.Text + "','" + txt_dom.Text + "','"
+ txt_ven.Text + "','" + txt_ach.Text + "','NoMember'", data.cn);
data.cmd.ExecuteNonQuery();
data.DBClose();
result.Visible = true;
}
e)
}
protected void Radio1_SelectedIndexChanged(object sender, EventArgs
{
if (Radio1.SelectedItem.Value == "2")
{
txt_mem.Visible = true;
Label3.Visible = true;
;
}
if (Radio1.SelectedItem.Value == "1")
{
txt_mem.Visible = false;
Label3.Visible = false;
}
using System;
using System.Collections;
using
using
using
using
using
using
using
using
using
using
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
e)
}
protected void Radio1_SelectedIndexChanged(object sender, EventArgs
{
}
protected void RadioButtonList1_SelectedIndexChanged(object sender,
EventArgs e)
{
if (RadioButtonList1.SelectedItem.Value == "1")
{
txt_pnl.Visible = true;
Label3.Visible = true;
}
if (RadioButtonList1.SelectedItem.Value == "2")
{
txt_pnl.Visible = false;
Label3.Visible = false;
}
}
protected void STORE_Click(object sender, EventArgs e)
{
result.Visible = false;
try
{
if (RadioButtonList1.SelectedItem.Value == "1")
{
data.DBOpen();
data.cmd = new System.Data.SqlClient.SqlCommand("Exec
lib_sp 1,'" + Convert.ToInt32(txt_sid.Text) + "','" + txt_fname.Text +
"','" + txt_sname.Text + "'," + Convert.ToInt32(txt_bktot.Text) + "," +
Convert.ToInt32(txt_bkret.Text) + "," +
Convert.ToInt32(txt_bkinhnd.Text) + "," + Convert.ToInt32(txt_pnl.Text)
+ "", data.cn);
data.cmd.ExecuteNonQuery();
data.DBClose();
result.Visible = true;
}
if (RadioButtonList1.SelectedItem.Value == "2")
{
data.DBOpen();
data.cmd = new System.Data.SqlClient.SqlCommand("Exec
lib_sp 1," + Convert.ToInt32(txt_sid.Text) + ",'" + txt_fname.Text +
"','" + txt_sname.Text + "'," + Convert.ToInt32(txt_bktot.Text) + "," +
Convert.ToInt32(txt_bkret.Text) + "," +
Convert.ToInt32(txt_bkinhnd.Text) + ",0", data.cn);
data.cmd.ExecuteNonQuery();
data.DBClose();
result.Visible = true;
}
}
catch
{
}
}
using
using
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
System.Data.SqlClient;
{
try
{
}
{
}
}
}
}
cn.Close();
Size
20
20
Data Type
int
nvarchar
nvarchar
nvarchar
nvarchar
nvarchar
nvarchar
nvarchar
nvarchar
nvarchar
bigint
Size
4
50
50
50
50
50
50
50
50
50
8
Data Type
int
nvarchar
nvarchar
int
int
int
int
Size
4
50
50
4
4
4
4
Data Type
Size
Name
sid
fname
sname
height
weight
game
award
int
nvarchar
nvarchar
int
int
nvarchar
nvarchar
4
50
50
4
4
50
50
Column Name
sid
fname
sname
semtop
semdom
semven
semach
semmemb
Data Type
int
nvarchar
nvarchar
nvarchar
nvarchar
nvarchar
nvarchar
nvarchar
Size
4
50
50
50
50
50
50
50