Event Management System

Share Embed Donate


Short Description

Download Event Management System...

Description

Event

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

The Problem of the work can be defined as “Designing an Event Management System for appropriate Event scheduling and handling”.

2.2

Existing System

Event management System deals with a lot of consultancy and sub-contracting services. It includes proper maintenance of such data in standard ERP model. Standard software like SAP doesn’t provide us with any Event management standard module. Hence it is not yet been scientifically standardized. Therefore there was a need of implementing such a system using software tools.

2.3

Proposed System

The proposed system is a compact Event Management System built to provide Event Management Companies and the consultancies with the facility to manage and plan the Events. It will be provided with a comparative platform of planned accounts and actual accounts. This will further more be working as an Event Management Index. It will store and manage the response of an Event as well as challenges in the event.

Department of Computer Science, 1

Event

Management System 2.4

Feasibility Analysis

It is proposed to establish a proper and secure channel of communication between the company persons via the Internet channel domain. Feasibility of proposed system is evaluated in three dimensions i.e., operational feasibility, economical feasibility and technical feasibility.

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.

Department of Computer Science, 2

Event

Management System

2.5 Use Case Diagram

Department of Computer Science, 3

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.

.

Framework: NET Framework Version (1.1 only). Platform: Windows XP/NT Server or Windows2000Server. Components: Windows Components needs to be updated by Service Packs (XP/NT/S2K service pack depending upon the system). Web Server: IIS (present in windows 2000 only) or Web Matrix Server. The project is tested on Web Matrix Server. Technology: ASP.Net Server Side Coding Tool: C#. Net Library: MSIL Assembly: System.dll Browser: Internet Explorer6.0

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.

Department of Computer Science, 4

Event

Management System

3.3 Block Diagram Event Manager Arrangers

Planning

Advertisement

expenditure

media (print)

Income electronic media resources

Actual event Response planning v/s result comparision

Department of Computer Science, 5

Event

Management System

3.4 Data-Flow Diagram (DFD)

3.5 Entity Relationship Diagram (ERD)

Department of Computer Science, 6

Event

Management System 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

Department of Computer Science, 7

Crowd

Event

Management System

3.6 Table Designs

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

Department of Computer Science, 8

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

Department of Computer Science, 9

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

Department of Computer Science, 10

Event

Management System

3.7 Form Designs 4. System Implementation About Programming Language Used

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 Microsoft’s ‘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

Department of Computer Science, 11

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.

C# is Microsoft’s latest object oriented programming language developed for .NET platform & .NET is Microsoft’s latest platform technology for creating web services. C# is a C++ based language & was developed to provide portability for distributed applications over network & Internet. Application development in .NET platform can be done in multiple languages including C#, C++ & visual basic. Programmers developed in all these languages are complied to Microsoft’s intermediate language (IL) & executed within common language run time (CLR) .We explain the core elements of .NET & how web applications are

Department of Computer Science, 12

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

Department of Computer Science, 13

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 Microsoft’s 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; }

Department of Computer Science, 14

Event

Management System C#: Public int size { Get {return size; } Set {size = value; } }

Particularly for read/write properties, C# provides a cleaner way of handling this concept .the relationship between a get & set method is inherent in C#, while has to be maintained in Java or C++. There are many benefits of this approach. It encourages programmers to think in terms of properties, whether that property is more natural as read/write Vs read only, or whether it really a shouldn’t be a property at all. If you wish to change the name of your property, you only have one place to look (I’ve seen getters & setters several lines away from each other). Comments only have to be made once, & won’t get out of sync with each other .it is feasible that an IDE could help out here (& in fact I suggest they do), but one should remember an essential principle in programming is to try to make abstractions model our problem well space well. A language, which supports properties, will reap the benefits of that better abstraction.

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]; }

Department of Computer Science, 15

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 today’s mainstream frameworks handle events. We’ve got examples like Delphi’s function pointers (called closures), Java’s inner class adapters & of course, the windows API’s message system. C# uses delegates along with the

Department of Computer Science, 16

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.

Department of Computer Science, 17

Event

Management System

A sample C# program: Hello world File Hello .Cs Using system; Class Hello { Static void Main (){ Console. Write Line (“Hello world “); } } •

Uses the namespace System



Entry point must be called Main



O/p goes to the console



File name & class name need not be identical

Compilation (in the console window) Csc Hellow .cs Execution Hello

C# Advantages: •

XML documentation generated from source code comments.(This is coming in VB.NET with Whidbey (the code name for the next version

Department of Computer Science, 18

Event

Management System

of Visual Studio & . NET), and there are tools which will do it with existing VB.NET code already.) •

Operator overloading = again, coming to VB.NET in Whidbey.



Language support for unsigned types (you can use them from VB.NET, but they aren’t in the language itself).



Again support for these is coming to VB.NET in Whidbey.



The using statement, which makes unmanaged resource disposal simple



Explicit interface in a base class can be re implemented separately in a derived class. Arguably this makes the class harder to understand in the same way that member hiding normally does.



Unsafe code this allows pointer arithmetic etc &can improve performance in some situations. However, it is not to be used lightly, as a lot of the normal safety of C# is lost (as the name implies). Note that unsafe code is still managed code, i.e. it is complied to IL, JITted & run with CLR. •

Boxing & unboxing add performance overhead since they involve dynamic memory allocation & runtime check.



Generics can make C# more efficient, type safe & maintainable.



Iterators help to create smaller & more efficient code.



Using attribute features to express how fields should be sear liased into XML that means you con easily turn a class into XML & than easily reconstruct it again.



Eliminates costly programming errors.



Reduces ongoing development costs with built in support for versioning.



C# can be programmable only in .NET framework as .NET framework has not been designed for any other operating system than windows. It is not a platform independent language.

Department of Computer Science, 19

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.



The use of pointers is restricted in C#.

C# Applications: •

Builder design pattern:

The builder pattern allows a client object to

construct a complex object by specifying only its type & content. The client is shielded from the details of the objects construction. •

Remoting in C#.



C# component based development.



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.

Department of Computer Science, 20

Event

Management System •

DB access component: C# is said to be a component oriented language to create a simple database access component.



Run time code generation.



Creating on line documents.

5. Testing

B. V-model:

Software Development Life Cycle

Software Test Life Cycle TEST PLAN

REQUIREMENT GATHERING PHASE DESIGN

FINAL TEST PLAN

CODING

TEST CASES

TESTING PHASE MAINTAINANCE PHASE

Department of Computer Science, 21

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.

What is Software testing? -

Process of executing a program with the intent of finding errors.

-

Confirming that a system performs its intended functions correctly.

-

Establishing confidence that a system does what it is supposed to do.

Why Software testing? To get adequate trust and confidence on the product. To meet the organizational goals like meeting requirements satisfied customers, improved market share, zero defects, etc. Since the software can perform 100,000 correct operations per second, it has the same ability to perform 100,000 wrong operations per second, if not tested properly.

Approach to Software testing: Of varying impact (severity), of varying priority, etc. At different stages of the development cycle. Using different types of testing.

Department of Computer Science, 22

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

 Static Testing: Code is examined without being executed. E.g.: Code inspections, Reviews, Walk-through.  Dynamic Testing: Code is executed and tested without, necessarily, being examined. E.g.: Black Box testing.  Manual Testing: Testing activities performed by people without the help of software testing tools. E.g.: Review, unit testing.  Automated Testing: Testing activities carried out with the help of software testing tools. E.g.: Regression Testing, Performance Testing

Department of Computer Science, 23

Event

Management System Verification and validation:

Verification: Is a set of activities carried out to see whether we are we ‘building the system right’? E.g.: Set of white box testing activities Validation: Is a set activities carried out to check whether we are ‘building the right system’. E.g.: Set of black box testing activities.

Testing Through Life Cycle: 1. Requirement Analysis Testing 2. Design testing 3. Unit testing 4. Integration testing 5. System testing. A. Requirement Analysis Testing: Objective: The objective of requirement analysis testing is to ensure software quality by eradicating errors as earlier as possible in the development process, as the errors noticed at the end of the software life cycle are more costly compared to that of early ones, and there by validating each of the outputs. Three basic issues can achieve the objective: •

Correctness



Completeness

Department of Computer Science, 24

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

Department of Computer Science, 25

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.

Different Types of Testing: -

Reviews and walk-through

-

Unit Testing

-

Integration testing

-

Functional testing

-

System testing

-

Acceptance testing

-

Regression testing

Department of Computer Science, 26

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.

 Walk-through: Similar to review and will be informal usually conducted by the members of the group which will include the author. For E.g.: Improving programming logic, Design approach etc.  Unit testing: Testing a single program, module, or unit of code. Validates that the system performs as designed. Also called module testing or elements testing.  Integration testing: Testing of related programs, modules, or units of code. Validates that multiple parts of the system interact according to the system design.  Functional testing: Functions are tested by feeding the input and examining the output to the expected outputs. Functional tests are a type of black box testing.  System Testing: Testing of entire system can include functional and nonfunctional testing such as stress testing, validates the system as a whole.

Department of Computer Science, 27

Event

Management System

 Acceptance Testing: Testing the system behavior against customer’s requirements. Customers undertake typical tasks to check their requirements, done at the customer’s premises on the user environment.  Regression testing: Selective retesting to detect faults introduced during modification of a system or system component to verify that modifications have not caused unintended adverse effects. To verify that a modified system or system component still meets its specific requirements.”  Usability Testing: Evaluates the ease of using and learning the system and system user documents by the end users. Evaluates the effectiveness of system functioning in supporting user tasks and ability to recover from user’s errors. 

Performance Testing: Specifically aimed at verifying that the system meets the specified performance requirements like response time, transactional throughput-depends on the target values specified in the contract. E.g.: 100 typical searches/min, 50 quotes/hour, 5 MB of files downloaded/sec etc, number of concurrent users.

 Security Testing: Verify how easily a system is subject to security violations under different conditions and environments.  Some types of testing: -

Configuration Testing

-

Installation Testing

-

Load Testing

Department of Computer Science, 28

Event

Management System Software Testing Process/Steps: 1.

Collect the documents from the project or from the leaders.

2.

Writing the scripts.

3.

Running the test.

4.

Bug tracking mechanism.

5.

Test reports.

a. Collect the documents from project leader: Documents about the company include, Design requirements 1. Its specification 2. Functional requirements 3. Functional specification b. Write The Scripts: The definition of scripts is to create the environment to run or execute the test cases. c. Running the Test: After these two processes step is to run the type of application tested d. Bug tracking mechanism: Bug tracking mechanism is one in which the bug /errors are traced. e. Test Reports:

Department of Computer Science, 29

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

Department of Computer Science, 30

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 doesn’t get submitted.

ii)

User trying inserting ambigues values in the foreign keys: the system is meant to help the users to link the primary and the secondary data. Hence if the user inserts wrong key value he will not be permitted to submit the form.

iii)

No date field in any of the forms is in user’s control: Because an user can manipulate with the date and thus it may cause a huge manipulation on overall accounts, all the transactions are made with respect to the current date.

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.

Department of Computer Science, 31

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.

Department of Computer Science, 32

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.

Department of Computer Science, 33

Event

Management System

9. Bibliography

• C# and .Net platform By Andrew Troelsen. • Inside C# By Tom Archer. • Fundamentals of database Systems By Ramez Elmasri ans S. B. Navathe

Department of Computer Science, 34

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 description for PhysicalExpenditure. /// 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; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public PhysicalExpenditure() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // }

Department of Computer Science, 35

Event

Management System /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); }

#region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.txtstatement = new System.Windows.Forms.TextBox(); this.txteventno = new System.Windows.Forms.TextBox(); this.txtcharges = new System.Windows.Forms.TextBox(); this.btnsubmit = new System.Windows.Forms.Button(); this.btnviewall = new System.Windows.Forms.Button(); this.btnview = new System.Windows.Forms.Button(); this.btnupdate = new System.Windows.Forms.Button(); this.btndelete = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.dtdatetime = new System.Windows.Forms.DateTimePicker(); this.dataGrid1 = new System.Windows.Forms.DataGrid(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize) (this.dataGrid1)).BeginInit(); this.SuspendLayout(); // // label1 // this.label1.Location = new System.Drawing.Point(96, 108); this.label1.Name = "label1"; this.label1.TabIndex = 0; this.label1.Text = "Date"; //

Department of Computer Science, 36

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";

Department of Computer Science, 37

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);

Department of Computer Science, 38

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();

Department of Computer Science, 39

Event

Management System this.ResumeLayout(false); } #endregion #region // Insert page code here //

int MyInsertMethod(int eventno, System.DateTime date, int charges, string statement) { string connectionString = "server=\'(local)\'; trusted_connection=true; database=\'user1\'"; System.Data.IDbConnection dbConnection = new System.Data.SqlClient.SqlConnection(connectionString); string queryString = "INSERT INTO [physicalexpenditure] ([eventno], [date], [charges], [statement]) VAL" + "UES (@eventno, @date, @charges, @statement)"; 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.IDataParameter dbParam_date = new System.Data.SqlClient.SqlParameter(); dbParam_date.ParameterName = "@date"; dbParam_date.Value = date; dbParam_date.DbType = System.Data.DbType.DateTime; dbCommand.Parameters.Add(dbParam_date); System.Data.IDataParameter dbParam_charges = new System.Data.SqlClient.SqlParameter(); dbParam_charges.ParameterName = "@charges"; dbParam_charges.Value = charges; dbParam_charges.DbType = System.Data.DbType.Int32; dbCommand.Parameters.Add(dbParam_charges); System.Data.IDataParameter dbParam_statement = new System.Data.SqlClient.SqlParameter(); dbParam_statement.ParameterName = "@statement"; dbParam_statement.Value = statement; dbParam_statement.DbType = System.Data.DbType.String; dbCommand.Parameters.Add(dbParam_statement);

Department of Computer Science, 40

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;

Department of Computer Science, 41

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

Department of Computer Science, 42

Event

Management System

int MyUpdateMethod(int eventno, System.DateTime date, int charges, string statement) { string connectionString = "server=\'(local)\'; trusted_connection=true; database=\'user1\'"; System.Data.IDbConnection dbConnection = new System.Data.SqlClient.SqlConnection(connectionString); string queryString = "UPDATE [physicalexpenditure] SET [date]=@date, [charges]=@charges, [statement]=@s" + "tatement WHERE ([physicalexpenditure].[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.IDataParameter dbParam_date = new System.Data.SqlClient.SqlParameter(); dbParam_date.ParameterName = "@date"; dbParam_date.Value = date; dbParam_date.DbType = System.Data.DbType.DateTime; dbCommand.Parameters.Add(dbParam_date); System.Data.IDataParameter dbParam_charges = new System.Data.SqlClient.SqlParameter(); dbParam_charges.ParameterName = "@charges"; dbParam_charges.Value = charges; dbParam_charges.DbType = System.Data.DbType.Int32; dbCommand.Parameters.Add(dbParam_charges); System.Data.IDataParameter dbParam_statement = new System.Data.SqlClient.SqlParameter(); dbParam_statement.ParameterName = "@statement"; dbParam_statement.Value = statement; dbParam_statement.DbType = System.Data.DbType.String; dbCommand.Parameters.Add(dbParam_statement); int rowsAffected = 0; dbConnection.Open(); try { rowsAffected = dbCommand.ExecuteNonQuery();

Department of Computer Science, 43

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();

Department of Computer Science, 44

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"); } } }

Department of Computer Science, 45

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF