In the process of system knock, it is a bit difficult to get on and off the machine and check out the account. When the relationship is unclear and there is no clue, let's draw a picture first and clarify the logic. The idea will naturally be available and we will not go into it again. Today, let's analyze the so-called on-premise and On-premise scenarios.
I. Computer
On-board flowchart:
Explanation:
(1) check whether the content of the text box is empty, whether it is a number, and "no". A prompt box is displayed;
(2) If the text box is a number, check whether the card number is registered. If it is "no", a prompt box is displayed;
(3) If the card number has been registered, check whether the card number is on the machine. If yes, a prompt box is displayed;
(4) If the card number is not on the machine, check whether the card number has sufficient balance (compared with the minimum amount in the database_info table). If not, a prompt box is displayed;
(5) If the balance is sufficient, a prompt is displayed, indicating that the machine is successfully executed. In student_info, some basic information about the student is taken out and added to the text box, and the text box information is added to online_info.
Ii. drop-down
1. Offline flowchart:
Explanation:
(1) Same as on the machine, it is used to determine whether the content of the text box is blank, whether it is a number, whether the card number is registered, and "no". A prompt box is displayed;
(2) If the card number has been registered, check whether the card number is on the machine. If not, a prompt box is displayed;
(3) If the card number is on the machine, the system prompts that the machine is successful. Add the text box information to the line_info table, and change the status in the online_info table to "offline ".
2. Computer Cost Calculation
Take a fixed user as an example.
It is known that the hourly cost of a fixed user is 2 RMB, the computer time is t, and the multiples are n. The following is the charging standard for each stage.
Explanation:
(1) No fees are charged if the time is less than 2 minutes.
(2) If the machine time is greater than or equal to the machine time, but less than the incremental time is 30 minutes, it is billed as RMB 1 for 30 minutes.
(3) When the host time is an integer multiple of 30 minutes (n times), the cost of the host is N yuan.
(4) When the computer time is not an integer multiple of 30 minutes, the first integer is an integer multiple. the excess part is also calculated by 30 minutes. The cost of the computer is (n + 1) RMB.
Summary:
After such an analysis, the logic is clarified, and the subsequent code is easily typed. So when we encounter a problem, don't be afraid. analyze the problem first, then solve the problem, and finally there will be no problem!
Data room Charging System (VB) (4) -- On/Off