void team_checkSupport(object sender, EventArgs e)
{
int idPlayerUC = (e as MyEventArgs).IDPlayerUC;
foreach (Team TeamCS in flp_Team.Controls)
{
if (TeamCS.IdPlayerUC == idPlayerUC)
{
timer1.Stop();
audience.timer1.Stop();
DialogResult dr = MessageBox.Show("Are you sure to use supported choice?", "Game Choice", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.Yes)
{
//record
Record Restore = new Record();
Restore.Support_I = 0;
Restore.IDPlayer = records.ElementAt(team).IDPlayer;
Restore.IDContest = iDContest;
RecordBL.UpdateSupport(Restore);
records.ElementAt(team).Support = false;
//hide support choice on controller screen
TeamCS.chk_Support.Visible = false;
//show time on controller screen
lbl_Time.Text = (Convert.ToInt32(lbl_Time.Text)+(TimeSupport)).ToString();
timer1.Start();
//show time on audience screen
audience.lbl_TimeShowQuestion.Text = (Convert.ToInt32(audience.lbl_TimeShowQuestion.Text) + (TimeSupport)).ToString();
audience.progressBarControl1.Max = (int)audience.progressBarControl1.Value + (TimeSupport * 900);
audience.progressBarControl1.Value += (TimeSupport*900);
audience.timer1.Start();
try
{
axWindowsMediaPlayer1.URL = (Directory.GetCurrentDirectory()) + "\\Sound\\CapNhatDiem.wav";
axWindowsMediaPlayer1.Ctlcontrols.play();
}
catch (Exception)
{
}
//hint support choice on controller screen after it has been used
foreach (Team_AudienceScreeen teamAdienceScreen in audience.flp_Team.Controls)
{
if (Convert.ToInt32(teamAdienceScreen.lbl_ID.Text) == records.ElementAt(team).IDPlayer)
{
teamAdienceScreen.btn_SupportChoice.BackgroundImage = Properties.Resources.End_Support;
}
}
}
else
{
timer1.Start();
audience.timer1.Start();
TeamCS.chk_Support.Checked = false;
}
}
}
}