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