Vb. NET computer room toll System project summary
From May 3, 2013-August 20, 2013 lasted three months. NET computer room charge system finally completed. The project was done, and there was a feeling of relief.
I'll summarize the three aspects of the document, the UML diagram and the code, focusing on the first two things. A, document 1.1 Feasibility Analysis report and project development plan
These two documents mainly determine whether the software system is worth developing, understand the nature of the problem, determine the target and scale of the system, and analyze and demonstrate the feasibility of the project from the technical, economic and social aspects. There is also a general plan for the development of the project, which includes the background of the project, the outline of the project, the plan, the Division of Staff and the Organization, and the delivery time. Detailed planning for the development of the software. The Feasibility analysis report and the project development Plan are for the development Unit to see. 1.2 Requirements analysis.
Is the user's expectation to the project software system in the function, the behavior, the performance design restraint aspect. Software and hardware requirements. The demand analysis is the user, the analyst and the system design personnel participates in the discussion preparation, is proposes "does what" for the system design. A very useful design document, is the soul of system development. 1.3 Overview Design and detailed design 1.3.1 Overview Design
The outline design divides the system into modular structure, determines the functions to be performed by each module, and invokes the relationship between each module. The outline design mainly includes: The function, the processing flow, the data structure, the operation and so on designs. The profile design is written by senior designers and experienced developers. 1.3.2 Detailed Design
Describes the module implementation process, local data organization, control flow and each step of specific household requirements and implementation design. Provide programmers with data entry, output, design method, process logic, interface, storage allocation, annotation design, and test plan for each function. This document is written by every program person involved.
Writing through the document found that the entire system has been developed one-third. two, UML diagram 1, use case diagram
Definition: Using the participants and use cases as the basic elements to show the functional requirements of the system in different perspectives. Draw a use case diagram when you need to analyze.
2. Class Diagram
Definitions describe the conceptual understanding of problems in the real world, and relationships between classes are dependent, correlated, inherited, polymorphic. Each class has methods and properties, and the method writes parameters and return values.
3. Package Drawing
Package diagrams is a combination of model elements in UML that are represented by symbols similar to folders. Each element in the system can be owned by only one package, and one package can be nested in another package. Use a package diagram to classify related elements into a system.
4. Sequence diagram.
This shows the logical relationship between the various layers of each class.
5, deployment diagram.
Shows the deployment after the system code is packaged and delivered to the user.
6, State diagram.
Describes the dynamic behavior of an entity based on an event response, showing how the entity responds to different events based on the current state.
7, Behavior map.
And the state diagram is almost basically the same, here do not do redundant details. 8, Component diagram.
Component diagrams describe the main functions of a system from the perspective of software architecture, such as how the system is divided into subsystems, what classes, packages, and artifacts each subsystem includes, the relationships between them, and which nodes they are assigned to. The structure and function of the system can be clearly seen by using the component diagram. Facilitate project team members to set goals and understand the work, at the same time, the most important thing is to facilitate the software reuse.
third, the code
began to write code is very confused, read a lot of people's blog but still do not know how to write, login instance also realized, but a real knock on how the system is particularly arduous. I have been repeatedly studying the example of this login, is very puzzled. Finally, in the Green Peak Shige under the guidance of my ren du two veins, a language awakened dream people. When the problem is solved, the process of actually writing the code begins. The most difficult to write is the DAL layer, BLL layer UI layer is very simple to get the parameters to the BLL layer, the BLL layer in a number of logical judgments, the want to check the data assigned to the entity class and then passed to the DAL layer to the DAL layer for the operation of the database. I'll write down the following. NET computer room fee system development to learn some simple knowledge. 1, connect the database.
To do the operation of the database is connected to the database, the following is a write in the D layer of the connection to the database code:
' Connection character
privatestr_sqlconnection as String = ' datasource=192.168.24.196;initial catalog=charge_sys; Userid=sa; password=123456 "
' declares an entity public
Functionbasicd (ByVal Enmoney as Basicdatae) asentity.basicdatae
' Select the connected database
DimstrSqlstring2 as String
strSqlstring2 = "select* from Basicdata_info"
' SqlConnection represents a to SQL An open connection to the Server database.
dimseting as String
seting = str_sqlconnection
dimmyconn as SqlConnection
myconn = New SqlConnection ( seting)
' SqlCommand represents a Transact-SQL statement or stored procedure that is to be executed on the database of the Server
dimmycmd as SqlCommand
mycmd = New SqlCommand (strsqlstring2,myconn)
' Open read ()
MyConn.Open ()
Dimmyreader as SqlDataReader
myreader = Mycmd.executereader
Speaking of the D layer also uses an abstract class SqlHelper, the concrete content sees the blog.
Then call in each of the DAL classes.
2, add, delete, change.
Previous blog has written above three content, the form of implementation is the same, but the specific code is different, the following simple paste code it.
Add Records:
' Add online record ' </summary> ' <param name= ' onlineinfo ' ></param> ' <returns></returns>
; ' <remarks></remarks> Function addonlineinfo (ByVal onlineinfo asentity.oncomputerinfo) as ENTITY.O Ncomputerinfo Dim strSQL as String = INSERT INTO oncomputer_info values (@StudentCardNumber, @StudentNumber, @StudentN Ame, @StudentMajor, @StudentSex, @OnLineDate, @OnLineTime, @OperatorUseComputer) "Dim cmd as SqlCommand = New SqlCommand ( strSQL, conn) ' Pass parameter cmd. Parameters.Add (New SqlParameter ("@StudentCardNumber", Onlineinfo.studentcardnumber)) cmd. Parameters.Add (New SqlParameter ("@StudentNumber", Onlineinfo.studentnumber)) cmd. Parameters.Add (New SqlParameter ("@StudentName", Onlineinfo.studentname)) cmd. Parameters.Add (Newsqlparameter ("@StudentMajor", onlineinfo.studentmajor)) cmd. Parameters.Add (New SqlParameter ("@StudentSex", Onlineinfo.studentsex)) cmd. Parameters.Add (New SqlParameter ("@OnLineDatE ", onlineinfo.onlinedate)) cmd. Parameters.Add (New SqlParameter ("@OnLineTime", Onlineinfo.onlinetime)) cmd. Parameters.Add (New SqlParameter ("@OperatorUseComputer", Onlineinfo.operatorusercomputer)) Try Conn. Open () If (cmd). ExecuteNonQuery > 0) Then onlineinfo.success = True Else onlineinfo.success = F
Alse End If return onlineinfo Catch ex as Exception onlineinfo.success = False return onlineinfo Finally cmd. Dispose () Conn.
Close () End Try-end Function
To delete a record:
Change Record:
' <summary> ' update work record ' </summary> ' ' <param name= ' workloginfo ' ></param> ' <returns></returns> ' <remarks></remarks> Function updateworkloginfo (ByVal Workloginfo as Entity.workloginfo) asentity.workloginfo Dim strSQL as String = "Update worklog_info set Logoutdate = @LogoutDate, Logouttime = @LogoutTime, Operatorstatus = @OperatorStatus Whereoperatorid = @OperatorID "Dim cmd as SQLC Ommand = New SqlCommand (strSQL, conn) cmd. Parameters.Add (New SqlParameter ("@OperatorID", Workloginfo.operatorid)) cmd. Parameters.Add (New SqlParameter ("@LogoutDate", workloginfo.logoutdate)) cmd. Parameters.Add (New SqlParameter ("@LogoutTime", Workloginfo.logouttime)) cmd. Parameters.Add (New SqlParameter ("@OperatorStatus", Workloginfo.operatorstatus)) Try Conn. Open () If (cmd). ExecuteNonQuery > 0) Then workloginfo.success = True
Else workloginfo.success =false End If return workloginfo Catch ex as Exception return WORKLOGINFO Finally Conn. Close () End Try. Endfunction
3. SQL statements for queries used
① A simple SQL statement
Update table name set the condition of the field where query to update
Insert into table name values (The fields you want to add (sorted by SQL table))
SELECT * FROM table name where condition
② Content Extension
Select Operatoridas Teacher, operatorlevel as user level, logondate as logon date, Logontime as logon time, operatorusecomputer as machine name Fromworklog_i NFO where operatorstatus= @OperatorStatus
Such a record will allow the English name section to show the Chinese name.
③select Count (*) as count from table name where record condition
Identify the number of records that match the criteria.
④select SUM (required and field) as required and the field from table name where condition
Query for records that match the criteria and the required sum of the fields.
⑤select top 1 * FROM table name order By field name fields
Identify the row of records that recently met the field criteria.
4. DataSet DataTable DataReader DataGridView
DataSet DataTable Datareaderdatagridview Some knowledge, the previous blog has introduced, here not to be introduced, specific content to build blog. 5. Error handling
Try.. Catch.. Finally...end try
try
< code to test >
Catch ex as Exception
< Execute this statement if an exception occurs >
Finally
< last-executed code > end
Try
Four, other blog links analysis vb.net method creation: http://blog.csdn.net/xjc1278003262/article/details/90560 85
Run Program VS2012 pop up the question of nondescript: http://blog.csdn.net/xjc1278003262/article/details/9395843
Differences and relationships between DataTable and DataRow in. Net: http://blog.csdn.net/xjc1278003262/article/details/9817249
Use of DataGridView Controls and export of Excel tables: http://blog.csdn.net/xjc1278003262/article/details/9934221
The whole process of making the report of the computer room fee system: http://blog.csdn.net/xjc1278003262/article/details/10077633
v. Summary
vb.net computer room fee system project development completed, the individual whether in the technology or in the mind are the benefits are quite abundant. The completion of this project not only opened a new window to himself, began to dispel, but also opened a new world to himself, later learning will be farsighted, unstoppable.