Just finished the three-tier architecture, using three layers to do a simple hotel management system!
Let's start with a few pictures:
Landing:
Main interface:
The main functional modules of the system are as follows:
Room type management: Room type name, room type price mainly includes adding and deleting to change the operation
Room Information Management: room number, number of beds, room status, room type, room description mainly includes adding and removing changes to check the operation
Food and beverage Management: Food and beverage name, units, unit price mainly includes adding and removing changes to check operation
Income statistics: annual monthly Income (room, catering) annual gross income (room, catering)
Check-In: Guest basic information, check-in date, room occupancy
Customer Enquiry: Non-checkout customer (query by time period--Check out-print invoice), Checkout customer Enquiry
System maintenance: Lock, exit, change password
The database uses SQL
Admin: Save user's login account number and password
Roomtype: Room type ID, room type name, Price/day
Rooms: Room ID, Room type (foreign key), Room status ID (foreign key), description, number of beds
Guestrecord: Customer ID, Customer name, gender, social security number, contact phone, room ID (foreign key), check-in status ID (foreign key), check-in date, deposit, room, dining consumption, check out date, transaction number
Roomstate: Room status ID, room status (check-in, idle, repair)
Residestate: Room status ID, check-in status (No checkout, checkout)
Dishlist: Dining ID, name, unit, price
The system uses three layers to build the UI layer, the data access layer, the model layer, the business logic layer, the public layer
UI layer: Responsible for the display of the interface
Business Logic Layer: responsible for the processing of business logic
Data Access layer: Database additions and deletions change operation
Model Layer: Entity class
Common layer: Common function (this system contains MD5 encryption method, enumeration (Operation state), public field)
Problem: The system used to irisskin skin beautification, but in the page switch when there is a flicker phenomenon, do not know the plugin itself is the problem or how! Eventually there is no solution, if there is a good solution please leave a message below ...
Summary: Benefits of tiered development:
1, code reuse: If the Meteorological Bureau produced a service layer language to provide weather forecast information. So Sina, Sohu These websites can use this service layer decent service, make weather preview page.
2, the separation of the developer's concern: Because each layer only calls the next layer of services provided by the adjacent, so long as the Apihe next layer of the API definition complete, developers in the development of a layer can focus on this layer of ideas, patterns and technology, this equates to the division of labor to bring about productivity improvement.
3, non-destructive replacement: When the business process needs to be adjusted, such as the need to convert the WinForm program to a console program at this time there is no need to change the data access layer, just to adjust the UI layer
4, reduce the dependence between the system: as in the program, the presentation layer just call the next layer of services, as for the following how many layers? How are all the data coming? How to save it? Do not need to know, this greatly reduces the system of responsibility between the dependencies.
In fact, it is necessary to design according to the needs of the system, do not have to fully use the three layer of development, such as some systems do not need the business logic layer, some systems need to add additional layers.
The following is the source code and database script for learning communication use ... What suggestions are welcome to leave a message below!
Http://pan.baidu.com/s/1kTJz5yR
WinForm Hotel Management System