18th Week personal Assignments

Source: Internet
Author: User

• Project plan

Time required to complete this project: 5-7 days

• Project development

• Demand Analysis:

• As a volleyball event manager, I would like to be able to count the scores of each team, to better rank the teams, so that each team can master their position.

• Design Documentation

• The demand analysis of user stories from volleyball matches shows that this program is used to count the scores and points of each team and rank according to the points.

• Plan review

• Further discussions are underway.

• Code Specification

• Write according to the visual Studio 2010 specification.

• Specific Design

· The URL activity diagram is as follows:

· The URL class diagram is as follows:

Part of the code:

Namespacewindowsformsapplication1{PublicStaticClassSqlHelper {PrivateStaticReadOnlyString constr ="Server=.; Database=itcast;integrated Security=true";//Delete and changePublicStaticint ExecuteNonQuery (String sql,ParamsSqlparameter[] pams) {using (SqlConnection conn =NewSqlConnection (Constr)) {using (SqlCommand comm =NewSqlCommand (SQL, conn)) {if (pams! =Null) {Comm. Parameters.addrange (PAMS); } conn. Open ();ReturnComm. ExecuteNonQuery (); } } }//Back to SqlDataReaderPublicStatic SqlDataReader ExecuteReader (String sql,ParamsSqlparameter[] pams) {SqlConnection conn =NewSqlConnection (CONSTR);using (SqlCommand comm =NewSqlCommand (SQL, conn)) {if (pams! =Null) {Comm. Parameters.addrange (PAMS); } conn. Open ();ReturnComm. ExecuteReader (commandbehavior.closeconnection); } }PublicStaticObject ExecuteScalar (String sql,ParamsSqlparameter[] pams) {using (SqlConnection conn =NewSqlConnection (Constr)) {using (SqlCommand comm =NewSqlCommand (SQL, conn)) {if (pams! =Null) {Comm. Parameters.addrange (PAMS); } conn. Open ();Return Comm. ExecuteScalar (); }}} public static DataTable executedatatable (String sql, params sqlparameter[] pams) {DataTable dt = new DataTable (); using (SqlDataAdapter adapter = new SqlDataAdapter (SQL, constr)) { if (pams! = null) {ADAPTE R.selectcommand.parameters.addrange (PAMS); } adapter. Fill (DT); } return dt;}}}

< Span style= "COLOR: #0000ff" > < Span style= "COLOR: #000000" > < Span style= "COLOR: #000000" > < Span style= "COLOR: #0000ff" >&NBSP;         

18th Week of personal work

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.