Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Management System
1. Introduction
Event management System is a management science for planning and executing
various events. The event includes any concert, function, occasion, etc. it deals with sub
contracting various aspects of the event for e.g. Arrangement of Chairs etc. for
commercial events advertisement is another important aspect. It includes all the kinds of
media including print, television etc. The Event Management System also deals with
Accounts planning for the events for maximum profits.
2. System Analysis
2.1
Problem Definition
2.2
Existing System
2.3
Proposed System
Event
Management System
2.4
Feasibility Analysis
Operational feasibility
Since the user presumed to use this system are qualified so it is believed that they
have proper knowledge of computers and Internet and hence they will be able to operate
it in a fair manner.
Economical feasibility
Since we assume that the network on which our system will operate will be support
TCP/IP protocol, hence the software needed are mainly C#. NET webserver1.1 and the
Internet Explorer, which can be got very easily
Technical feasibility
As mentioned before the organization is assumed to have well equipped technical
persons who are capable of operating the system also have necessary hardware and can
download the software from the internet. Hence proposed solution is technical feasible.
Event
Management System
2.5
Event
Management System
3. SYSTEM DESIGN
3.2 Hardware and Software Requirements
Software requirements:
Database: MS SQL Server2000 with Microsoft SQL Desktop Engine (MSDE) installed.
Hardware Requirements:
1. Pentium or AMD processors with speed minimum 1GHz.
2. Minimum256MB RAM.
3. Accelerated Graphics Card.
4. Minimum 2GB Hard Disk.
5. Better performance with 82KB and above Cache Memory.
Event
Management System
Planning
Advertisement
expenditure
media (print)
Income
electronic media
resources
Actual event
Response
planning v/s
result comparision
Event
Management System
Event
Management System
3.5 Entity Relationship Diagram (ERD)
Event No
Nam
e
Date
Area
Venue
Event
Event No
Type
Addres
s
Others
Responsibility
Deadlin
ess
Charge
s
Expenditur
e
Role
Arrangers
Employee
Event No
Statemen
t
Ph
Physical
Expenditure
Role
Sl
No
Charges
Consultants
Statemen
t
Event
no
Respons
e
Date
Phone#
Name
Event no
Event
No
Advertising
Media
Date
Event
occurred
Date
Detail
s
Address
Amount
Event
No
Duratio
n
Type
Payment
Crowd
Event
Management System
Event
Event No
Event Name
Date
Event Type
Data type
Int
Varchar
Datetime
Varchar
Key attribute
PRIMARY
Data type
Int
Int
Varchar
Key attribute
FOREIGN
Data type
Int
Date time
Int
Varchar
Key attribute
FOREIGN
Data type
Int
Varchar
Varchar
Varchar
Key attribute
FOREIGN
Expenditure
Event no
Direct charges
Statement
Physical expenditure
Event no
Date
Charges
Statement
Venue
Event no
Area
Address
Others
Event
Management System
Arrangers
Event no
Name
Responsibility
Deadlines
Data type
Int
Varchar
Varchar
Date time
Key attribute
FOREIGN
Data type
Int
Varchar
Varchar
Varchar
Key attribute
Data type
Int
Varchar
Varchar
Varchar
Varchar
Key attribute
Employee
SL.No
Name
Role
Phone no
Consultants
SL.No
Name
Role
Address
Phone no
Event
Management System
Event occurred
Data type
Int
Varchar
Varchar
Varchar
Event no
Crowd
Response
Duration
Key attribute
FOREIGN
Payment
Event no
Date
Amount
Type
Data type
Int
Date time
Varchar
Varchar
Key attribute
FOREIGN
Data type
Int
Date time
Varchar
Varchar
Key attribute
FOREIGN
Advertising
Event no
Date
Media
Details
Event
Management System
Introduction to .Net
. NET (dot-net) is the name Microsoft gives to its general vision of the future of
computing, the view being of a world in which many applications
run in a distributed manner across the Internet. We can identify a
number of different motivations driving this vision.
Firstly, distributed computing is rather like object oriented programming, in
that it encourages specialized code to be collected in one place, rather than
copied redundantly in lots of places. There are thus potential efficiency gains to
be made in moving to the distributed model.
Secondly, by collecting specialized code in one place and opening up a
generally accessible interface to it, different types of machines (phones,
handheld, desktops, etc) can all be supported with the same code. Hence
Microsofts run any where aspiration.
Thirdly, by controlling real-time access to some of the distributed nodes
(especially those concerning authentication), companies like Microsoft can
control more easily the running of its applications. It moves applications further in
the area of services provided rather than object owned.
Interestingly, in taking on the .NET vision, Microsoft seems to have given
up some of this proprietary tendencies (whereby all the technology it touched
Event
Management System
was warped towards its Windows operating system). Because it sees its future
as providing software services in distributed applications, the .NET framework
has been written so that applications on other platforms will be able to access
these services.
At the development end of the .NET vision is the .NET framework. This
contains the common language runtime; the common language runtime (CLR)
manages the execution of code compiled for the .NET platform. The CLR has two
interesting features. Firstly, its specification has been opened up so that it can be
ported to non-windows platforms. Secondly, any number of different languages
can be used to manipulate the .NET framework classes, and the CLR will support
them. This has led one commentator to claim that under. NET the language one
uses is a lifestyle choice.
Not all of the supported languages fit entirely neatly into the .NET
framework, however (in some cases the fit has been somewhat procrustean). But
the one language that is guaranteed to fit in perfectly is C#. This new language, a
successor to C++, has been released in conjunction with the .NET framework,
and is likely to be the language of choice for many developers working on .NET
applications.
Event
Management System
developed & run with this technology. NET is not a programming language it is a
virtual machine technology (similar to Java virtual machine technology) with a
framework that provides capability to run a verity of web applications. The .NET
framework class library provides set of classes that provides essential
functionality for applications build within the .NET environment. Web functionality,
XML support, database support, threading & distributed computing support is
provided by the .NET framework class library. All .NET code is translated to
Microsoft intermediate language & run with CLR .CLR is similar to Java virtual
machine (JVM) .The IL code is language independent & similar to Java byte code
.A single .NET application may consist of several different languages .Two very
important
features
of
CLR
are
language
interoperability
&
language
independence.
Introduction to C#
C# is a modern, object oriented language that enables programmers to quickly
build a wide range of applications for the new Microsoft .NET platform, which
provides tools & services that fully exploit both computing & communication.
Because of its elegant object oriented design .C# is a great choice for
architecting a wide range of components from high level business objects to
system level applications using simple C# language constructs, these component
can be converted into XML web services, allowing them to be invoked across the
internet, from any language running on any operating system. More than any
thing else, C# is designed to bring rapid development to the C++ programmer
without sacrificing the power & control that have been a hallmark of C & C++.
Because of this heritage C# has a high degree of fidelity with C & C++.
Developers familiar with these languages can quickly become productive in C#
3.2.2 C# Features
C# is the new language with the power of C++ & the slickness of visual basic. It
cleans up many of the syntactic peculiarities of C++ without diluting much of its
Event
Management System
flavor (thereby enabling C++ developers to transition to it with little difficulty). And
its superiority over VB6 in facilitating powerful OO implementation is without
question. C# with clean OO syntax & large class library (in conjunction with .NET
& the base class libraries) could be the most productive mainstream language &
it is an ECMA standard language that offers the potential of being available
across many platform .For the serious developer wanting Microsofts most
productive & mainstream .NET language, C# is the choice.
Properties:
Properties will be a familiar concept to Delphi & Visual basic users. The
motivation is for the language to formalize the concept of getter/ setter methods,
which is an extensively used pattern, particularly in RAD (Rapid Application
developments) tools.
This is a typical code you must write in Java or C++:
Outsize (get size () +1);
Label.getfont (). Set bold (true);
The same code you would rite like this in C#:
Outsize;
Label.font.bold=true;
The code is immediately more readable by those who are using foot & label.
There is similar simplicity when implementing properties:
Java/C++:
Public int get size (){
Return size;
}
Public void set size (int value){
Size=value;
}
Event
Management System
C#:
Public int size {
Get {return size;
}
Set {size = value;
}
}
Indexers:
C# provides indexers allow objects to be treated like array, except that like
properties, each element is exposed with a get and/ or set method.
Public class Skyscraper
{
Story [] stories;
Public story this [int index] {
Get {
Return stories [index];
}
Event
Management System
Set {
if (value !=null ) {
Stories [index]=value;
}
}
}
Skyscraper empire State = new Skyscraper ();
Empire State [102] = new story (The top one);
Delegates:
A delegate can be thought of as a type- safe object oriented function pointer,
which is able to hold multiple methods rather than just one. Delegates handle
problems, which would be solved with function pointers in C++. And interfaces in
Java. It improves on the function pointer approach by being type safe & being
able to hold multiple methods. It improves on the interface approach by allowing
the invocation of a method without the need for inner-class adapters or extra
code to handle multiple method invocations. The most important use of delegates
is for event handling.
Events:
C# provides direct support for events Although event handling has been a
fundamental part of programming since programming began, there has been
surprisingly little efforts made by most languages to formalize this concept, If you
look at how todays mainstream frameworks handle events. Weve got examples
like Delphis function pointers (called closures), Javas inner class adapters & of
course, the windows APIs message system. C# uses delegates along with the
Event
Management System
event keyword to provide a very clean solution to event handling .I thought the
best way to illustrate this was to give an example showing the whole process of
declaring, firing & handling an event.
Pointer arithmetic:
Pointer arithmetic can be performed in C# within methods marked with the
unsafe modifier. When pointer point to garbage collected objects, the
complier
enforces the use of fixed word to pin the object. This is because garbage
collectors relay on moving objects around to reclaim memory, but if this happens
when you are dealing with raw pointers you will be pointing to garbage. The
choice of the word unsafe will be chosen since it discourages developers from
using pointers unless they really need to.
Rectangular Arrays:
C# allows both jagged & rectangular arrays to be created. Jagged arrays are
pretty much the same as Java arrays. Rectangular arrays allow a more efficient
and accurate representation for certain problems .An example of such an array
would be:
Int [,] array = new int [3,4,5];
Int [1,1,1]=5;
Using jagged arrays;
Int [][][] array=new int [3][4][5];
Int [1][1][1];
In combination with struts, C# can provide a level of efficiency making it a good
choice for areas such as graphics & mathematics.
Event
Management System
A sample C# program:
Hello world
File Hello .Cs
Using system;
Class Hello {
Static void Main (){
Console. Write Line (Hello world );
}
}
C# Advantages:
Event
Management System
of Visual Studio & . NET), and there are tools which will do it with
existing VB.NET code already.)
Language support for unsigned types (you can use them from VB.NET,
but they arent in the language itself).
Event
Management System
Even though the programming type resembles to that of C++ many no. of
classes & their objects are required to be remembered.
Huge sets of over loaded functions are available which demand the user
to no each type for the application level.
C# Applications:
construct a complex object by specifying only its type & content. The client
is shielded from the details of the objects construction.
Remoting in C#.
Reflection in C#: The ability to find out information about objects at run
time is called reflection. In reflection we can find out the objects class,
details of an objects method, & even create one dynamically at run time.
Creating web based code components: There are times when you need
to explain the core structure & logic of your program, having an intention
to make it encapsulated & hidden at the same time.
Event
Management System
5. Testing
B. V-model:
Software Development
Life Cycle
REQUIREMENT
GATHERING
PHASE
DESIGN
FINAL TEST
PLAN
CODING
TEST
CASES
TESTING
PHASE
MAINTAINANCE
PHASE
Event
Management System
It is same as waterfall model but difference is that testing and development are
done simultaneously. It is the modified form of the Waterfall model.
SOFTWARE TESTING
What is testing?
The process of detecting & identifying defects, where a defect is any
variance between actual and expected results.
Event
Management System
3.1. Different categories of testing:
1. White Box and Black box testing
2. Dynamic and Static testing
3. Manual and Automated Testing
4. Verification and Validation Techniques.
White Box Testing: The software tester has SQL Server 2000 to the
program/code and examines it for errors. Also called clear box testing or
structural testing. E.g.: Unit Testing
Black Box Testing: The software tester only knows what the system is
supposed to do; he does not know how it works internally. He has to test on
the basis of expected outputs. E.g.: System Testing
Event
Management System
Verification and validation:
Correctness
Completeness
Event
Management System
Consistency
B. Design Testing
Objective: The objective of the design phase testing is to generate complete
specifications for implementing a system using a set of tools and languages.
Design objective is fulfilled by five issues:
a) Consistency
b) Completeness
c) Correctness
d) Feasibility
e) Trace ability
C. Unit Testing
Objective: The main objective of unit testing is to ensure that the individual units
of a system work correctly in isolation, before they are eventually integrated.
The following issues can achieve the objective:
a) Correctness
b) Completeness
c) Early testing
d) Debugging
D. Integration testing
Event
Management System
Objective: Minimizing the errors, which include internal and external interface
errors.
E. Software Testing
Objective: Software once validated for meeting functional requirements must be
verified for proper interface with other system elements like hardware, databases
and people.
System testing verifies that all these system elements mesh properly and
the software achieves overall function/performance.
We carry out functionality testing, performance testing and other black box
testing to requirement as part of system testing.
Unit Testing
Integration testing
Functional testing
System testing
Acceptance testing
Regression testing
Event
Management System
-
Usability testing
Performance testing
Security testing
Reviews: A group of persons (author need not be one among them) look for
errors, mistaken assumptions, lack of clarity and deviation from standard
practice. E.g.: Review of specifications, Project plans etc.
Event
Management System
Configuration Testing
Installation Testing
Event
Management System
-
Load Testing
2.
3.
4.
5.
Test reports.
Event
Management System
The test reports are the documents, which are used for reporting the bugs
or errors to the developer.
MANUAL TESTING
Manual testing is a testing activity performed by a test engineer without
the help of software testing tools.
E.g.: reviews, unit testing.
Writing the test cases does manual testing. Here, test case is defined as
writing the sequence of messages. Manual tester writes the test cases. After a
test case has been written for particular application then these test cases are
executed. It consists of actual result, expected result and the respected status of
the application. If that application is bug free then status is said to be passed.
Else if any application then it should be understood that it should be tested again.
Manual is done by the black box testing.
Testing
Event
Management System
All the projects are subjected to vigorous testing before they are actually
approved or accepted. The test cases that were considered for the project
were
i)
User leaving a blank field: In all the forms validation rules are used
to ensure that no \form is submitted without filling all the respective
fields. Whenever the user leaves a field blank the form doesnt get
submitted.
ii)
iii)
iv)
All the pages are secured: all the pages were needed to provide
security. Hence all the pages are protected by sessions, which is
generated at the time of log in. Hence a user cannot access it
without log in.
Event
Management System
6. Future Enhancement
Future Scope of the Project:
The event management system is a means of appropriately handling and managing the
events and all the related and the associated data. The system can be made online in
future to maintain all the global events. No cost estimation is included in the current
module. In future cost estimation module can be integrated along with the fuzzy based
technique through which the costs of an new event can be judged from the existing events
from the database.
Event
Management System
7. Conclusion
The event management system used over here is implemented in .Net platform, which is
a next generation solution for all the Microsoft related products. Therefore the solution is
futuristic. It is been tested manually for all the possible test cases. Hence the system is a
reliable and stable system. The reports are easier to use and import and the solution can
easily be integrated with the Internet. The project is an attempt to provide a prototype for
what an event management system can be! Therefore more commercial aspects are
needed to be validated for the system to be a commercially viable one.
Event
Management System
9. Bibliography
Event
Management System
Source Code
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Event_Management_System
{
/// <summary>
/// Summary description for PhysicalExpenditure.
/// </summary>
public class PhysicalExpenditure : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Button btnsubmit;
private System.Windows.Forms.Button btnviewall;
private System.Windows.Forms.Button btnview;
private System.Windows.Forms.Button btnupdate;
private System.Windows.Forms.Button btndelete;
private System.Windows.Forms.DateTimePicker dtdatetime;
private System.Windows.Forms.TextBox txtstatement;
private System.Windows.Forms.TextBox txteventno;
private System.Windows.Forms.TextBox txtcharges;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public PhysicalExpenditure()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
Event
Management System
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
Event
Management System
// label2
//
this.label2.Location = new System.Drawing.Point(96, 56);
this.label2.Name = "label2";
this.label2.TabIndex = 1;
this.label2.Text = "EventNo";
//
// label3
//
this.label3.Location = new System.Drawing.Point(96, 160);
this.label3.Name = "label3";
this.label3.TabIndex = 2;
this.label3.Text = "Charges";
//
// label4
//
this.label4.Location = new System.Drawing.Point(96, 212);
this.label4.Name = "label4";
this.label4.TabIndex = 3;
this.label4.Text = "Statement";
//
// txtstatement
//
this.txtstatement.Location = new System.Drawing.Point(280, 216);
this.txtstatement.Name = "txtstatement";
this.txtstatement.Size = new System.Drawing.Size(152, 20);
this.txtstatement.TabIndex = 5;
this.txtstatement.Text = "";
//
// txteventno
//
this.txteventno.Location = new System.Drawing.Point(280, 48);
this.txteventno.Name = "txteventno";
this.txteventno.Size = new System.Drawing.Size(152, 20);
this.txteventno.TabIndex = 6;
this.txteventno.Text = "";
//
// txtcharges
//
this.txtcharges.Location = new System.Drawing.Point(280, 160);
this.txtcharges.Name = "txtcharges";
this.txtcharges.Size = new System.Drawing.Size(152, 20);
this.txtcharges.TabIndex = 7;
this.txtcharges.Text = "";
//
// btnsubmit
//
this.btnsubmit.Location = new System.Drawing.Point(31, 312);
this.btnsubmit.Name = "btnsubmit";
Event
Management System
this.btnsubmit.TabIndex = 8;
this.btnsubmit.Text = "Submit";
this.btnsubmit.Click += new
System.EventHandler(this.button1_Click);
//
// btnviewall
//
this.btnviewall.Location = new System.Drawing.Point(129, 312);
this.btnviewall.Name = "btnviewall";
this.btnviewall.TabIndex = 9;
this.btnviewall.Text = "ViewAll";
this.btnviewall.Click += new
System.EventHandler(this.btnviewall_Click);
//
// btnview
//
this.btnview.Location = new System.Drawing.Point(227, 312);
this.btnview.Name = "btnview";
this.btnview.TabIndex = 10;
this.btnview.Text = "View";
this.btnview.Click += new
System.EventHandler(this.btnview_Click);
//
// btnupdate
//
this.btnupdate.Location = new System.Drawing.Point(325, 312);
this.btnupdate.Name = "btnupdate";
this.btnupdate.TabIndex = 11;
this.btnupdate.Text = "Update";
this.btnupdate.Click += new
System.EventHandler(this.btnupdate_Click);
//
// btndelete
//
this.btndelete.Location = new System.Drawing.Point(423, 312);
this.btndelete.Name = "btndelete";
this.btndelete.TabIndex = 12;
this.btndelete.Text = "Delete";
this.btndelete.Click += new
System.EventHandler(this.btndelete_Click);
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.Color.PowderBlue;
this.groupBox1.Controls.Add(this.dtdatetime);
this.groupBox1.Controls.Add(this.btnupdate);
this.groupBox1.Controls.Add(this.btndelete);
this.groupBox1.Controls.Add(this.btnview);
this.groupBox1.Controls.Add(this.btnviewall);
Event
Management System
this.groupBox1.Controls.Add(this.btnsubmit);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.txtcharges);
this.groupBox1.Controls.Add(this.txteventno);
this.groupBox1.Controls.Add(this.txtstatement);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans
Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
((System.Byte)(0)));
this.groupBox1.Location = new System.Drawing.Point(56, 24);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(528, 392);
this.groupBox1.TabIndex = 13;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "PhysicalExpenditure";
//
// dtdatetime
//
this.dtdatetime.Location = new System.Drawing.Point(280, 104);
this.dtdatetime.Name = "dtdatetime";
this.dtdatetime.Size = new System.Drawing.Size(184, 20);
this.dtdatetime.TabIndex = 13;
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(48, 440);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(536, 160);
this.dataGrid1.TabIndex = 14;
//
// PhysicalExpenditure
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.Color.CornflowerBlue;
this.ClientSize = new System.Drawing.Size(632, 622);
this.Controls.Add(this.dataGrid1);
this.Controls.Add(this.groupBox1);
this.Name = "PhysicalExpenditure";
this.Text = "PhysicalExpenditure";
this.WindowState =
System.Windows.Forms.FormWindowState.Maximized;
this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)
(this.dataGrid1)).EndInit();
Event
Management System
this.ResumeLayout(false);
}
#endregion
#region
// Insert page code here
//
Event
Management System
int rowsAffected = 0;
dbConnection.Open();
try
{
rowsAffected = dbCommand.ExecuteNonQuery();
}
finally
{
dbConnection.Close();
}
return rowsAffected;
}
#endregion
private void button1_Click(object sender, System.EventArgs e)
{
int
i=MyInsertMethod(int.Parse(txteventno.Text),DateTime.Parse(dtdatetime.Text),int.Parse(
txtcharges.Text),txtstatement.Text);
if(i>0)
MessageBox.Show("Submitted successfully");
else
MessageBox.Show("Failed to Submit");
}
#region
System.Data.DataSet MyQueryMethod()
{
string connectionString = "server=\'(local)\';
trusted_connection=true; database=\'user1\'";
System.Data.IDbConnection dbConnection = new
System.Data.SqlClient.SqlConnection(connectionString);
string queryString = "SELECT [physicalexpenditure].* FROM
[physicalexpenditure]";
System.Data.IDbCommand dbCommand = new
System.Data.SqlClient.SqlCommand();
dbCommand.CommandText = queryString;
dbCommand.Connection = dbConnection;
System.Data.IDbDataAdapter dataAdapter = new
System.Data.SqlClient.SqlDataAdapter();
dataAdapter.SelectCommand = dbCommand;
System.Data.DataSet dataSet = new System.Data.DataSet();
dataAdapter.Fill(dataSet);
return dataSet;
Event
Management System
}
#endregion
private void btnviewall_Click(object sender, System.EventArgs e)
{
dataGrid1.DataSource=MyQueryMethod();
dataGrid1.Expand(-1);
}
#region
System.Data.DataSet MyQueryMethod(int eventNo)
{
string connectionString = "server=\'(local)\';
trusted_connection=true; database=\'user1\'";
System.Data.IDbConnection dbConnection = new
System.Data.SqlClient.SqlConnection(connectionString);
string queryString = "SELECT [physicalexpenditure].* FROM
[physicalexpenditure] WHERE ([physicalexpendi" +
"ture].[EventNo] = @EventNo)";
System.Data.IDbCommand dbCommand = new
System.Data.SqlClient.SqlCommand();
dbCommand.CommandText = queryString;
dbCommand.Connection = dbConnection;
System.Data.IDataParameter dbParam_eventNo = new
System.Data.SqlClient.SqlParameter();
dbParam_eventNo.ParameterName = "@EventNo";
dbParam_eventNo.Value = eventNo;
dbParam_eventNo.DbType = System.Data.DbType.Int32;
dbCommand.Parameters.Add(dbParam_eventNo);
System.Data.IDbDataAdapter dataAdapter = new
System.Data.SqlClient.SqlDataAdapter();
dataAdapter.SelectCommand = dbCommand;
System.Data.DataSet dataSet = new System.Data.DataSet();
dataAdapter.Fill(dataSet);
return dataSet;
}
#endregion
private void btnview_Click(object sender, System.EventArgs e)
{
dataGrid1.DataSource=MyQueryMethod(int.Parse(txteventno.Text));
}
#region
Event
Management System
Event
Management System
}
finally
{
dbConnection.Close();
}
return rowsAffected;
}
#endregion
private void btnupdate_Click(object sender, System.EventArgs e)
{
int
i=MyUpdateMethod(int.Parse(txteventno.Text),DateTime.Parse(dtdatetime.Text),int.Pars
e(txtcharges.Text),txtstatement.Text);
if(i>0)
MessageBox.Show("Updated Successfully");
else
MessageBox.Show("Failed to Update");
}
#region
int MyDeleteMethod(int eventno)
{
string connectionString = "server=\'(local)\';
trusted_connection=true; database=\'user1\'";
System.Data.IDbConnection dbConnection = new
System.Data.SqlClient.SqlConnection(connectionString);
string queryString = "DELETE FROM [physicalexpenditure]
WHERE ([physicalexpenditure].[eventno] = @event" +
"no)";
System.Data.IDbCommand dbCommand = new
System.Data.SqlClient.SqlCommand();
dbCommand.CommandText = queryString;
dbCommand.Connection = dbConnection;
System.Data.IDataParameter dbParam_eventno = new
System.Data.SqlClient.SqlParameter();
dbParam_eventno.ParameterName = "@eventno";
dbParam_eventno.Value = eventno;
dbParam_eventno.DbType = System.Data.DbType.Int32;
dbCommand.Parameters.Add(dbParam_eventno);
int rowsAffected = 0;
dbConnection.Open();
try
{
rowsAffected = dbCommand.ExecuteNonQuery();
Event
Management System
}
finally
{
dbConnection.Close();
}
return rowsAffected;
}
#endregion
private void btndelete_Click(object sender, System.EventArgs e)
{
int i=MyDeleteMethod(int.Parse(txteventno.Text));
if(i>0)
MessageBox.Show("Deleted Successfully");
else
MessageBox.Show("Failed to Delete");
}
}
}