Using Delphi to develop tourist attractions microcomputer ticket system

xiaoxiao2021-03-06  23

I. Introduction

With the emergence of computer local area network and wide area network, the quality of network products (including soft, hardware) is constantly improving; varieties, rapid growth and development; and database technology maturation and software engineering methods, various computer network management systems are increasing perfect. The tourist attraction microcomputer ticket system is a product combined with computer technology and network technology. Convenient and fast inquiry statistics enable managers to accurately grasp the business conditions of the attractions and supervise, manage, and provide accurate and credit for ticket salesters. Its successful implementation improves the ticketing efficiency and management level of tourist attractions, so that it has been planned by the situation of the artificial ticket sales, so that the new stage of the intelligent ticket sales.

This article introduces Delphi 4.0 as a development language, Microsoft SQL Server 6.5 is a background, running in the development method of the Tourist attraction microcomputer ticketing system for Windows NT 4.0. The system is suitable for automated management of major, medium and small tourist attractions, with strong practical promotion and application value.

Second, the overall plan design

The microcomputer ticket system uses a star topology, which is composed of a server, hub, computer, and printer, see Figure 1. Running databases and system management procedures on the server, implement query, statistics, report printing, system maintenance. Self-selling microcomputers are placed in the ticket window, run ticketing procedures, complete interface input, ticket printing, and ticket staff, personal information query statistics.

For ticketing systems, the speed and data of the printer are very critical through the transmission speed of the network. For example, Qinhuangdao Wildlife Park is in the peak period, and about 20,000 people in the park will be used to use three microcomputers for ticket sales, and most of the guests enrolled in the park will focus on the same time. As in the morning, I just opened the garden at 10:00 pm. Between ~ 3 o'clock, it is necessary to reduce tourists waiting in line, and speed up the ticket speed is the problem that the microcomputer ticket system must solve. There are two factors that affect the ticket speed, one is the printing speed of the hardware printer, and the second is the speed of the print program launched the print and transfer data. Test, EPSON Stylus Color 850 color inkjet printer, its printing speed is 8 pages / minute, which can meet the requirements.

In order to meet the requirements of printing speed, it is determined to use Delphi 4.0 as programming language with Delphi 4.0. Delphi combines powerful object PASCAL languages ​​and fast-convenient RADs, is a universal graphical user interface (GUI) development tool, which is designed based on visualization and component concept, and can be very convenient to manipulate databases and implementation Various reports make programming quickly and is one of the fastest programming languages ​​currently debugging. Ticket printing directly calls the various processes and functions in the class Printers of Delphi, such as printers.canvas.textout (x: integer; y: integer; const text: string) to quickly print again , Solve the problem of program printing speed.

The system selects SQL Sever as a database, SQL Sever is a client / server relational data management system (RDBMS), using Transact-SQL to send requests between clients and SQL Sever to meet the network transmission requirements of the system. Database access can be performed via BDE (database engine) and ODBC in Delphi, or database access is performed directly via ADO.

In addition, in the total program design, considering the use of the operator's quality of the system is uneven, the computer operation level is relatively low, the operation involved is as simple as possible, as little as possible, try to use the drop box and selection box, Avoid mistakes. This system operator needs to enter only visitors (adults and children or students) and number of vehicles. Other information, such as fare, automatically call out from the database when the program starts, and the time is taken from the system time, the total price is automatically generated by the computer, the interface is simple, easy to operate, easy to use. Third, the overall design of system software

Database table design

There are common retail ticket information tables, password tables, operator information tables, fare information tables, and views built for statistical queries. Take the structure of the table as an example of the retail ticket information table. Its field is defined as shown in Table 1.

Serial number: Composition consists of ticket programs, random number, and tickets starting with the microcomputer ticket. Such as GK006662, a ticket seller identified by identification number G, random number is K, 6662 ticket.

No ticket: This field is used to identify if the ticket is valid. If it is valid, it is 1, which is 0.

2. Software structure design

System software design follows the idea of ​​modular programming, from top, step by step. The system program consists of a system management module and a ticket module. The ticket module runs on the ticket cell, and the system management module is running on the server.

Fourth, system main function characteristics and implementation methods

System main module: login and password input module; system main interface input module; statistics, query, report, print module; ticket printing module. The functions of each module and the implementation of the key part are described below.

1. Login and password input module

The login and password input module is used to limit the operator's permissions. The function is completed: remove the password from the interface, query the database password table, have the same password operator to enter the next interface, three input failures, the program is automatically exited. In addition, in the ticket module, the corresponding operator's name is taken according to the password to associate the ticket information is associated with the operator. From the database, according to the input password, the corresponding operator function is taken as follows, where handletbl is the password table name, ID, handlename, handlecode, represents number, operator name, operator password.

Function TFORMPswd.getHandlename (Code: string): String;

VAR name: string;

Begin

Name: = '';

Query2.close;

Query2.sql.clear;

Query2.disableControls;

Query2.sql.add ('Select ID, HandlenaMe, Handlecode from Handletbl');

Query2.open;

IF query2.locate ('Handlecode', Code, []) THEN

Begin

Name: = query2.fieldbyName ('handlename'). asstring;

END;

Query2.close;

Result: = Name;

END;

2. System main interface input module

The main interface input module of the system is used to input and display ticket information, automatically calculate the total number of visitors and fares according to their information and fares. In this module, the operator is required to enter only the number of tourists. According to "OK", you can automatically calculate and display the total price, press "Print" to print tickets. In order to prevent operator erroneous input other characters other than integer data, such as A, B, etc., resulting in a program error, and the program is required in the TEDIT position that requires the data input, and the integer data is allowed.

3. Statistics and queries, report print modules

Statistics and queries, the report print module is used to implement statistics and queries of ticket information, and information such as start date can be set and reported. Statistics and query use embedded SQL query language implementation, reports using Delphi's Quick Report Components QREPORT part of the controls. 4. Ticket printing module

Ticket printing module implements ticket printout function. In the ticket print, you need to determine the output location according to the style of the ticket, in order to achieve fast printing, the pro processs and functions are called directly when printing.

The process of printing is as follows:

Procedure Printmsg (Theesyqo, Totalpeople, Adultnum, Childnum, Totalcar, Bigcar, Middlecar, MiniCar, TotalMoney, prtdate: string)

Begin

Printer.canvas.font.charset: = GB2312_Charset;

Printer.begindoc;

Printer.pageheight;

Printer.pagewidth;

Printer.canvas.font.size: = 14; // Font Settings

... // According to the user needs to print the content to print

Printer.canvas.textout (x 2370, y, there "; // Print content

Printer.Enddoc;

END;

5. Refill Management Module

In the actual ticket sales process, the ticket and related information sold by various reasons have been deposited in the database. When there is a refund case, there is inevitable that the operator ticket amount is inconsistent with the database query results. Phenomenon, in order to solve this phenomenon, increase the refund management module.

Turn http://tech.sina.com.cn 2001/02/13 Software World Ma Shuhua Shu Dongmei Zhao Yuta

转载请注明原文地址:https://www.9cbs.com/read-40047.html

New Post(0)