Volleyball Scoring Program

Source: Internet
Author: User

First, the plan

Second, the program interface design

Iii. Results of operation

Iv. part of the code

public class Match
{
public int id;
public int h1f;
public int h2f;
public int h3f;
public int l1f;
public int l2f;
public int l3f;
}

public class Dal
{
Public Match Select (int id)
{
String Strcon = "server=.; Database=pqmatch;integrated Security=true ";
SqlConnection con = new SqlConnection (Strcon);
String sql = "SELECT * from Match where id=" +ID;
SqlCommand comm = new SqlCommand (sql, con);
Con. Open ();
Match MC = null;
SqlDataReader reader = Comm. ExecuteReader ();
if (reader. HasRows)
{
while (reader. Read ())
{
MC = new Match ();
Mc.id = 1;
mc.h1j = (int) reader["h1f"];
MC.H2J = (int) reader["h2f"];
mc.h3j = (int) reader["h3f"];
mc.l1j = (int) reader["l1f"];
MC.L2J = (int) reader["L2F"];
mc.l3j = (int) reader["l3f"];
}
}
Reader. Close ();
Con. Close ();
return MC;
}
}

public class BLL
{
Private dal dl = new Dal ();
Public Match Select (int id)
{
return DL. Select (ID);
}
}

Private BLL BL1 = new BLL ();
protected void Page_Load (object sender, EventArgs e)
{

}

protected void Button1_Click (object sender, EventArgs e)
{
if (! IsPostBack)
{
txt1h. Text = "";
TXT2H. Text = "";
txt3h. Text = "";
txt1l. Text = "";
txt2l. Text = "";
txt3l. Text = "";
}
Else
{
String id = Label1.Text.Trim ();
Match mc = bl1. Select (Convert.ToInt32 (id));
txt1h. Text = Mc.h1F.ToString ();
TXT2H. Text = Mc.h2F.ToString ();
txt3h. Text = Mc.h3F.ToString ();
txt1l. Text = Mc.l1F.ToString ();
txt2l. Text = Mc.l2F.ToString ();
txt3l. Text = Mc.l3F.ToString ();
}
int Ah=convert.toint32 (txt1h. Text);
int BH = Convert.ToInt32 (txt2h. Text);
int ch = Convert.ToInt32 (txt3h. Text);
int al = Convert.ToInt32 (txt1l. Text);
int bl = Convert.ToInt32 (txt2l. Text);
int cl = Convert.ToInt32 (txt3l. Text);
int ZFH = 0;
int ZFL = 0;
if (Ah > Al)
{
zfh++;
}
Else
{
zfl++;
}
if (bh > BL)
{
zfh++;
}
Else
{
zfl++;
}
if (Ch > Cl)
{
zfh++;
}
Else
{
zfl++;
}
if (dh > DL)
{
zfh++;
}
Else
{
zfl++;
}
if (Eh > el)
{
zfh++;
}
Else
{
zfl++;
}

Volleyball Scoring Program

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.