示例#1
0
 public void Results(NumericUpDown hometeam, NumericUpDown visitors, int ho, int vo, Team t1, Team t2)
 {
     sc1 = hometeam.Value;
     sc2 = visitors.Value;
     t1.ScoreMissedGoal(sc1, sc2);
     t2.ScoreMissedGoal(sc2, sc1);
     if (sc1 == sc2)
     {
         ho += 1;
         vo += 1;
         t1.Draws(1);
         t2.Draws(1);
     }
     else if (sc1 > sc2)
     {
         ho += 3;
         vo += 0;
         t1.Wins(1);
         t2.Loses(1);
     }
     else if (sc1 < sc2)
     {
         ho += 0;
         vo += 3;
         t1.Loses(1);
         t2.Wins(1);
     }
     t1.Points(ho);
     t2.Points(vo);
 }
示例#2
0
文件: Form1.cs 项目: ruudkok/MoCS
        private void button2_Click(object sender, EventArgs e)
        {
            string textToSubmit = this.richTextBox2.Text;

            ClientFacade facade = new ClientFacade();

            Team team = new Team() {Id=1, Name="Team01", Password="******"};

            team = facade.AuthenticateTeam(team);

            Submit submit = new Submit();
            submit.Team = team;
            submit.Data = new UTF8Encoding().GetBytes(textToSubmit);
            submit.AssignmentEnrollment = new AssignmentEnrollment() {Id=1, Team = team};
            submit.TournamentAssignment = new TournamentAssignment() { Id = 1 };
            submit.SubmitDate = DateTime.Now;
            submit.FileName = "HelloWorld.cs";

            facade.SaveSubmit(submit);
        }
示例#3
0
文件: Program.cs 项目: MetraDZ/andriy
 public void Results(NumericUpDown hometeam, NumericUpDown visitors, int ho, int vo, Team t1, Team t2)
 {
     sc1 = hometeam.Value;
     sc2 = visitors.Value;
     t1.ScoreMissedGoal(sc1, sc2);
     t2.ScoreMissedGoal(sc2, sc1);
     if (sc1 == sc2)
     {
         ho += 1;
         vo += 1;
         t1.Draws(1);
         t2.Draws(1);
     }
     else if (sc1 > sc2)
     {
         ho += 3;
         vo += 0;
         t1.Wins(1);
         t2.Loses(1);
     }
     else if (sc1 < sc2)
     {
         ho += 0;
         vo += 3;
         t1.Loses(1);
         t2.Wins(1);
     }
     t1.Points(ho);
     t2.Points(vo);
 }
示例#4
0
文件: Program.cs 项目: MetraDZ/andriy
        public void Sortuv(Team t1, Team t2, Team t3, Team t4)
        {
            arr[0] = t1.GetPoints();
            arr[1] = t2.GetPoints();
            arr[2] = t3.GetPoints();
            arr[3] = t4.GetPoints();

            for (int i = 0; i < 3; i++)
            {
                for (int j = i + 1; j < 4; j++)
                {
                    if (arr[i] < arr[j])
                    {
                        int tmp = arr[i];
                        arr[i] = arr[j];
                        arr[j] = tmp;
                    }
                }
            }

            for (int i = 0; i < 4; i++)
            {
                if (arr[i] == t1.GetPoints())
                {
                    k1 = i;
                    t1.Position(i);
                    arr[i] = -1;
                    break;
                }
            }
            for (int i = 0; i < 4; i++)
            {
                if (arr[i] == t2.GetPoints())
                {
                    k2 = i;
                    t2.Position(i);
                    arr[i] = -1;
                    break;
                }
            }
            for (int i = 0; i < 4; i++)
            {
                if (arr[i] == t3.GetPoints())
                {
                    k3 = i;
                    t3.Position(i);
                    arr[i] = -1;
                    break;
                }
            }
            for (int i = 0; i < 4; i++)
            {
                if (arr[i] == t4.GetPoints())
                {
                    k4 = i;
                    t4.Position(i);
                    arr[i] = -1;
                    break;
                }
            }
        }
示例#5
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Team Porto = new Team();
            Porto.Name(label1);
            Team DynamoZ = new Team();
            DynamoZ.Name(label2);
            Team DynamoK = new Team();
            DynamoK.Name(label3);
            Team PSG = new Team();
            PSG.Name(label4);

            PointsT t = new PointsT();
            int[] p = new int[4];
            t.Results(numericUpDown2, numericUpDown1, p[0], p[1],DynamoZ,Porto);
            t.Results(numericUpDown4, numericUpDown3, p[2], p[3], PSG, DynamoK);
            t.Results(numericUpDown6, numericUpDown5, p[3], p[0], DynamoK, DynamoZ);
            t.Results(numericUpDown8, numericUpDown7, p[1], p[2], Porto, PSG);
            t.Results(numericUpDown10, numericUpDown9, p[1], p[3], Porto, DynamoK);
            t.Results(numericUpDown12, numericUpDown11, p[0], p[2], DynamoZ, PSG);
            t.Results(numericUpDown14, numericUpDown13, p[3], p[1], DynamoK, Porto);
            t.Results(numericUpDown16, numericUpDown15, p[2], p[0], PSG, DynamoZ);
            t.Results(numericUpDown18, numericUpDown17, p[3], p[2], DynamoK, PSG);
            t.Results(numericUpDown20, numericUpDown19, p[1], p[0], Porto, DynamoZ);
            t.Results(numericUpDown22, numericUpDown21, p[0], p[3], DynamoZ, DynamoK);
            t.Results(numericUpDown24, numericUpDown23, p[2], p[1], PSG, Porto);

            Table a = new Table();
            //public decimal[] mas = new decimal[24];

            if (label1.Text == "Порту")
            {

                a.Sortuv(Porto, DynamoZ, DynamoK, PSG);
                a.WriteTable(dataGridView1, Porto, Porto.GetPosition());
                a.WriteTable(dataGridView1, DynamoZ, DynamoZ.GetPosition());
                a.WriteTable(dataGridView1, DynamoK, DynamoK.GetPosition());
                a.WriteTable(dataGridView1, PSG, PSG.GetPosition());
                a.Save(mas1, numericUpDown1, numericUpDown2, numericUpDown3, numericUpDown4, numericUpDown5, numericUpDown6, numericUpDown7, numericUpDown8, numericUpDown9, numericUpDown10, numericUpDown11, numericUpDown12, numericUpDown13, numericUpDown14, numericUpDown15, numericUpDown16, numericUpDown17, numericUpDown18, numericUpDown19, numericUpDown20, numericUpDown21, numericUpDown22, numericUpDown23, numericUpDown24);
            }
            else if (label1.Text == "Монпельє")
            {
                a.Sortuv(Porto, DynamoZ, DynamoK, PSG);
                a.WriteTable(dataGridView2, Porto, Porto.GetPosition());
                a.WriteTable(dataGridView2, DynamoZ, DynamoZ.GetPosition());
                a.WriteTable(dataGridView2, DynamoK, DynamoK.GetPosition());
                a.WriteTable(dataGridView2, PSG, PSG.GetPosition());
                a.Save(mas2, numericUpDown1, numericUpDown2, numericUpDown3, numericUpDown4, numericUpDown5, numericUpDown6, numericUpDown7, numericUpDown8, numericUpDown9, numericUpDown10, numericUpDown11, numericUpDown12, numericUpDown13, numericUpDown14, numericUpDown15, numericUpDown16, numericUpDown17, numericUpDown18, numericUpDown19, numericUpDown20, numericUpDown21, numericUpDown22, numericUpDown23, numericUpDown24);
            }
            else if (label1.Text == "Зеніт")
            {
                a.Sortuv(Porto, DynamoZ, DynamoK, PSG);
                a.WriteTable(dataGridView3, Porto, Porto.GetPosition());
                a.WriteTable(dataGridView3, DynamoZ, DynamoZ.GetPosition());
                a.WriteTable(dataGridView3, DynamoK, DynamoK.GetPosition());
                a.WriteTable(dataGridView3, PSG, PSG.GetPosition());
                a.Save(mas3, numericUpDown1, numericUpDown2, numericUpDown3, numericUpDown4, numericUpDown5, numericUpDown6, numericUpDown7, numericUpDown8, numericUpDown9, numericUpDown10, numericUpDown11, numericUpDown12, numericUpDown13, numericUpDown14, numericUpDown15, numericUpDown16, numericUpDown17, numericUpDown18, numericUpDown19, numericUpDown20, numericUpDown21, numericUpDown22, numericUpDown23, numericUpDown24);
            }
            else if (label1.Text == "Аякс")
            {
                a.Sortuv(Porto, DynamoZ, DynamoK, PSG);
                a.WriteTable(dataGridView4, Porto, Porto.GetPosition());
                a.WriteTable(dataGridView4, DynamoZ, DynamoZ.GetPosition());
                a.WriteTable(dataGridView4, DynamoK, DynamoK.GetPosition());
                a.WriteTable(dataGridView4, PSG, PSG.GetPosition());
                a.Save(mas4, numericUpDown1, numericUpDown2, numericUpDown3, numericUpDown4, numericUpDown5, numericUpDown6, numericUpDown7, numericUpDown8, numericUpDown9, numericUpDown10, numericUpDown11, numericUpDown12, numericUpDown13, numericUpDown14, numericUpDown15, numericUpDown16, numericUpDown17, numericUpDown18, numericUpDown19, numericUpDown20, numericUpDown21, numericUpDown22, numericUpDown23, numericUpDown24);
            }
            else if (label1.Text == "Нордшелланд")
            {
                a.Sortuv(Porto, DynamoZ, DynamoK, PSG);
                a.WriteTable(dataGridView5, Porto, Porto.GetPosition());
                a.WriteTable(dataGridView5, DynamoZ, DynamoZ.GetPosition());
                a.WriteTable(dataGridView5, DynamoK, DynamoK.GetPosition());
                a.WriteTable(dataGridView5, PSG, PSG.GetPosition());
                a.Save(mas5, numericUpDown1, numericUpDown2, numericUpDown3, numericUpDown4, numericUpDown5, numericUpDown6, numericUpDown7, numericUpDown8, numericUpDown9, numericUpDown10, numericUpDown11, numericUpDown12, numericUpDown13, numericUpDown14, numericUpDown15, numericUpDown16, numericUpDown17, numericUpDown18, numericUpDown19, numericUpDown20, numericUpDown21, numericUpDown22, numericUpDown23, numericUpDown24);
            }
            else if (label1.Text == "БАТЕ")
            {
                a.Sortuv(Porto, DynamoZ, DynamoK, PSG);
                a.WriteTable(dataGridView6, Porto, Porto.GetPosition());
                a.WriteTable(dataGridView6, DynamoZ, DynamoZ.GetPosition());
                a.WriteTable(dataGridView6, DynamoK, DynamoK.GetPosition());
                a.WriteTable(dataGridView6, PSG, PSG.GetPosition());
                a.Save(mas6, numericUpDown1, numericUpDown2, numericUpDown3, numericUpDown4, numericUpDown5, numericUpDown6, numericUpDown7, numericUpDown8, numericUpDown9, numericUpDown10, numericUpDown11, numericUpDown12, numericUpDown13, numericUpDown14, numericUpDown15, numericUpDown16, numericUpDown17, numericUpDown18, numericUpDown19, numericUpDown20, numericUpDown21, numericUpDown22, numericUpDown23, numericUpDown24);
            }
            else if (label1.Text == "Спартак М.")
            {
                a.Sortuv(Porto, DynamoZ, DynamoK, PSG);
                a.WriteTable(dataGridView7, Porto, Porto.GetPosition());
                a.WriteTable(dataGridView7, DynamoZ, DynamoZ.GetPosition());
                a.WriteTable(dataGridView7, DynamoK, DynamoK.GetPosition());
                a.WriteTable(dataGridView7, PSG, PSG.GetPosition());
                a.Save(mas7, numericUpDown1, numericUpDown2, numericUpDown3, numericUpDown4, numericUpDown5, numericUpDown6, numericUpDown7, numericUpDown8, numericUpDown9, numericUpDown10, numericUpDown11, numericUpDown12, numericUpDown13, numericUpDown14, numericUpDown15, numericUpDown16, numericUpDown17, numericUpDown18, numericUpDown19, numericUpDown20, numericUpDown21, numericUpDown22, numericUpDown23, numericUpDown24);
            }
            else if (label1.Text == "Галатасарай")
            {
                a.Sortuv(Porto, DynamoZ, DynamoK, PSG);
                a.WriteTable(dataGridView8, Porto, Porto.GetPosition());
                a.WriteTable(dataGridView8, DynamoZ, DynamoZ.GetPosition());
                a.WriteTable(dataGridView8, DynamoK, DynamoK.GetPosition());
                a.WriteTable(dataGridView8, PSG, PSG.GetPosition());
                a.Save(mas8, numericUpDown1, numericUpDown2, numericUpDown3, numericUpDown4, numericUpDown5, numericUpDown6, numericUpDown7, numericUpDown8, numericUpDown9, numericUpDown10, numericUpDown11, numericUpDown12, numericUpDown13, numericUpDown14, numericUpDown15, numericUpDown16, numericUpDown17, numericUpDown18, numericUpDown19, numericUpDown20, numericUpDown21, numericUpDown22, numericUpDown23, numericUpDown24);
            }
        }
示例#6
0
 public void WriteTable(DataGridView d, Team t, int i)
 {
     d.Rows[i].Cells[0].Value = t.GetName();
     d.Rows[i].Cells[1].Value = t.GetW();
     d.Rows[i].Cells[2].Value = t.GetDraws();
     d.Rows[i].Cells[3].Value = t.GetLoses();
     d.Rows[i].Cells[4].Value = t.GetGoals();
     d.Rows[i].Cells[5].Value = t.GetPoints();
 }
示例#7
0
        public void Sortuv(Team t1, Team t2, Team t3, Team t4)
        {
            arr[0] = t1.GetPoints();
            arr[1] = t2.GetPoints();
            arr[2] = t3.GetPoints();
            arr[3] = t4.GetPoints();

            for (int i = 0; i < 3; i++)
            {
                for (int j = i + 1; j < 4; j++)
                {
                    if (arr[i] < arr[j])
                    {
                        int tmp = arr[i];
                        arr[i] = arr[j];
                        arr[j] = tmp;
                    }
                }
            }

            for (int i = 0; i < 4; i++)
            {
                if (arr[i] == t1.GetPoints())
                {
                    k1 = i;
                    t1.Position(i);
                    arr[i] = -1;
                    break;
                }
            }
            for (int i = 0; i < 4; i++)
            {
                if (arr[i] == t2.GetPoints())
                {
                    k2 = i;
                    t2.Position(i);
                    arr[i] = -1;
                    break;
                }
            }
            for (int i = 0; i < 4; i++)
            {
                if (arr[i] == t3.GetPoints())
                {
                    k3 = i;
                    t3.Position(i);
                    arr[i] = -1;
                    break;
                }
            }
            for (int i = 0; i < 4; i++)
            {
                if (arr[i] == t4.GetPoints())
                {
                    k4 = i;
                    t4.Position(i);
                    arr[i] = -1;
                    break;
                }
            }
        }