private void btnOK_Click(object sender, EventArgs e) { var name = this.tbName.Text; var teamName = this.tbTeamName.Text; var teamShortName = this.tbTeamShortName.Text; var athlete = new AthleteModel(); athlete.Id = Guid.NewGuid().ToString(); athlete.GroupName = GroupName; athlete.MatchId = MatchId; athlete.Name = name; athlete.Sex = Sex; athlete.TeamName = teamName; athlete.TeamShortName = teamShortName; athlete.BarIndividualGamesStatus = this.cbBarIndividualStatus.Text.Trim(); athlete.BarGroupGamesStatus = this.cbBarGroupStatus.Text.Trim(); AthletesDAL.Insert(athlete); MessageBox.Show("添加成功"); this.DialogResult = DialogResult.OK; this.Close(); }