private void btnSubmit_Click(object sender, EventArgs e) { BeautyAndLongGown semi = new BeautyAndLongGown(); Compute_LongGownOnly(); Compute_OverAll(); for (int i = 0; i < dgvPreElim.Rows.Count; i++) { semi.Can_no = dgvPreElim.Rows[i].Cells[1].Value.ToString(); semi.B1 = dgvPreElim.Rows[i].Cells[2].Value.ToString(); semi.G1 = dgvPreElim.Rows[i].Cells[3].Value.ToString(); semi.B2 = dgvPreElim.Rows[i].Cells[4].Value.ToString(); semi.G2 = dgvPreElim.Rows[i].Cells[5].Value.ToString(); semi.B3 = dgvPreElim.Rows[i].Cells[6].Value.ToString(); semi.G3 = dgvPreElim.Rows[i].Cells[7].Value.ToString(); semi.B4 = dgvPreElim.Rows[i].Cells[8].Value.ToString(); semi.G4 = dgvPreElim.Rows[i].Cells[9].Value.ToString(); semi.B5 = dgvPreElim.Rows[i].Cells[10].Value.ToString(); semi.G5 = dgvPreElim.Rows[i].Cells[11].Value.ToString(); semi.B6 = dgvPreElim.Rows[i].Cells[12].Value.ToString(); semi.G6 = dgvPreElim.Rows[i].Cells[13].Value.ToString(); semi.B7 = dgvPreElim.Rows[i].Cells[14].Value.ToString(); semi.G7 = dgvPreElim.Rows[i].Cells[15].Value.ToString(); semi.B8 = dgvPreElim.Rows[i].Cells[16].Value.ToString(); semi.G8 = dgvPreElim.Rows[i].Cells[17].Value.ToString(); semi.B9 = dgvPreElim.Rows[i].Cells[18].Value.ToString(); semi.G9 = dgvPreElim.Rows[i].Cells[19].Value.ToString(); semi.Total = dgvPreElim.Rows[i].Cells[20].Value.ToString(); semi.Total_overall = dgvPreElim.Rows[i].Cells[21].Value.ToString(); // MessageBox.Show("NO # " + dgvPreElim.Rows[i].Cells[1].Value.ToString() + " SCORE: " + dgvPreElim.Rows[i].Cells[20].Value.ToString()); semi.Update(); } Submit_LongGown(); // Save to prelim table Column LongGown Submit_Over_All(); // Save to prelim table Column Overall //Load Elim util.LoadDataTable(dgvSemiFinal, "pre_elim"); Desgin_Elimination(); btnSubmitSemi.PerformClick(); }
private void btnSave_Click(object sender, EventArgs e) { util.NoZeroScore(dgvAllEvent); if (util.toSave == true) { string message = "Please double check the scores before submitting ?"; string title = "Tabulation System"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result = MessageBox.Show(message, title, buttons, MessageBoxIcon.Information); if (result == DialogResult.Yes) { string message2 = "Submit score now?"; string title2 = "Tabulation System"; MessageBoxButtons buttons2 = MessageBoxButtons.YesNo; DialogResult result2 = MessageBox.Show(message2, title2, buttons2, MessageBoxIcon.Information); if (result == DialogResult.Yes) { if (EventName.Equals("Long Gown Only")) { #region LongGownOnly LongGownOnly score = new LongGownOnly(); for (int i = 0; i < dgvAllEvent.Rows.Count; i++) { score.Judge = lblJudgeNo.Text; //Judge No score.Can_no = dgvAllEvent.Rows[i].Cells[0].Value.ToString(); //Candidate Number [0] score.Score = dgvAllEvent.Rows[i].Cells[1].Value.ToString(); //Score per candidate [1] score.Save(); } MessageBox.Show("Record Submitted!", "Tabulation System", MessageBoxButtons.OK, MessageBoxIcon.Information); #endregion } else if (EventName.Equals("Semi Final - Q and A")) { #region SemiFinal SemiFinal score = new SemiFinal(); for (int i = 0; i < dgvAllEvent.Rows.Count; i++) { score.Judge = lblJudgeNo.Text; //Judge No score.Can_no = dgvAllEvent.Rows[i].Cells[0].Value.ToString(); //Candidate Number [0] score.Score_beauty = dgvAllEvent.Rows[i].Cells[1].Value.ToString(); //Score per candidate [1 score.Score_wit = dgvAllEvent.Rows[i].Cells[2].Value.ToString(); //Score per candidate [1] score.Save(); } MessageBox.Show("Record Submitted!", "Tabulation System", MessageBoxButtons.OK, MessageBoxIcon.Information); #endregion } else if (EventName.Equals("Final - Q and A")) { #region Final - Q and A Final score = new Final(); for (int i = 0; i < dgvAllEvent.Rows.Count; i++) { score.Judge = lblJudgeNo.Text; //Judge No score.Can_no = dgvAllEvent.Rows[i].Cells[0].Value.ToString(); //Candidate Number [0] score.Score_beauty = dgvAllEvent.Rows[i].Cells[1].Value.ToString(); //Score per candidate [1 score.Score_wit = dgvAllEvent.Rows[i].Cells[2].Value.ToString(); //Score per candidate [1] score.Save(); } MessageBox.Show("Record Submitted!", "Tabulation System", MessageBoxButtons.OK, MessageBoxIcon.Information); #endregion } else if (EventName.Equals("Long Gown Competition")) { #region Long Gown with Beauty Face BeautyAndLongGown score = new BeautyAndLongGown(); for (int i = 0; i < dgvAllEvent.Rows.Count; i++) { score.Judge = lblJudgeNo.Text; //Judge No score.Can_no = dgvAllEvent.Rows[i].Cells[0].Value.ToString(); //Candidate Number [0] score.Score_beauty = dgvAllEvent.Rows[i].Cells[1].Value.ToString(); //Score per candidate [1 score.Score_wit = dgvAllEvent.Rows[i].Cells[2].Value.ToString(); //Score per candidate [1] score.Save(); } MessageBox.Show("Record Submitted!", "Tabulation System", MessageBoxButtons.OK, MessageBoxIcon.Information); #endregion } this.Dispose(); frmMainClient main = new frmMainClient(); main.ShowDialog(); } else { return; } } } else { return; } }