private void btnSave_Click(object sender, EventArgs e) { Participant participantinfo = new Participant(); ParticipantBLL pbll = new ParticipantBLL(); string Name = txtName.Text.Trim(); string RolePlay = cbRolePlay.Text; if (!string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(RolePlay)) { participantinfo.Name = Name; participantinfo.Majary = txtMajary.Text.Trim(); participantinfo.Postion = txtPostion.Text.Trim(); participantinfo.Company = txtCompany.Text.Trim(); participantinfo.Department = txtDepartment.Text.Trim(); participantinfo.RolePlay = RolePlay; participantinfo.ProName = HAZOP分析系统.ProName; if (pbll.Add_Participant(participantinfo)) { MessageBox.Show("添加成功!"); MyParticipantInfoDataBindEvents(); this.Close(); } else { MessageBox.Show("失败成功!"); } } else { MessageBox.Show("人员名和项目角色不能为空!"); } }