public void ScanRefereeScore() { foreach (DataGridViewRow row in dataGridView3.Rows) { if (row.Cells[0].Value == null) { break; } RefereeScore refereeScore = new RefereeScore { Id = row.Cells[0].Value.ToString(), GameInfoId = row.Cells[1].Value.ToString(), RefereeId = row.Cells[2].Value.ToString(), ChiefReferee = Convert.ToBoolean(row.Cells[3].Value.ToString()), Score = 0, P = 0, D = 0 }; if (service.SearchRefereeScoreById(refereeScore.Id).Count == 0) { service.AddRefereeScore(refereeScore); } else { service.UpdateRefereeScore(refereeScore); } } }
public void ScanRefereeScore() { foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells[0].Value == null) { break; } if (!(Convert.ToBoolean(row.Cells[3].Value)) && (Convert.ToBoolean(row.Cells[7].Value))) { flag = false; OrdinaryRefereeForm ordinaryRefereeForm = new OrdinaryRefereeForm( service.SearchRefereeScoreById(row.Cells[0].Value.ToString())[0]); ordinaryRefereeForm.Show(); MessageBox.Show("已返回给相应裁判进行重新评分!"); } if ((Convert.ToBoolean(row.Cells[3].Value)) && (row.Cells[5].Value != null) && (row.Cells[6].Value != null)) { try { RefereeScore refereeScore = service.SearchRefereeScoreById(row.Cells[0].Value.ToString())[0]; refereeScore.P = Convert.ToDouble(row.Cells[5].Value); refereeScore.D = Convert.ToDouble(row.Cells[6].Value); service.UpdateRefereeScore(refereeScore); }catch (Exception ex) { MessageBox.Show("error: " + ex.Message); } } } }
public OrdinaryRefereeForm(RefereeScore refereeScore) : this() { this.refereeScore = refereeScore; label5.Text = service.SearchAthleteByAthleteNum( service.SearchGameInfoById(refereeScore.GameInfoId)[0].AthleteNum)[0].Name; label6.Text = service.SearchGameInfoById(refereeScore.GameInfoId)[0].AthleteNum; textBox1.Text = refereeScore.Score.ToString(); }
public GroupTotalScoreForm(RefereeScore chiefRefereeScore) : this() { this.chiefRefereeScore = chiefRefereeScore; object[][] TABLE = service.GetGroupTotalScore(chiefRefereeScore); foreach (object[] row in TABLE) { int index = this.dataGridView1.Rows.Add(); for (int i = 0; i < 5; i++) { this.dataGridView1.Rows[index].Cells[i].Value = row[i]; } } }
public ChiefRefereeForm(RefereeScore refereeScore) : this() { this.refereeScore = refereeScore; refereeScoreBindingSource.DataSource = service.SearchRefereeScoreByGameInfoId(refereeScore.GameInfoId); }