private void btnCourse_Click(object sender, EventArgs e) { if (cmbYearValue.Text.Trim().Length == 0) { MessageDialog.ShowPromptMessage("请选择【培训年份】"); return; } FormDataTableCheck frm = new FormDataTableCheck(_ServiceCollect.GetCourseInfo(Convert.ToInt32(cmbYearValue.Text))); frm._BlDateTimeControlShow = false; frm._BlIsCheckBox = false; if (frm.ShowDialog() == DialogResult.OK) { int courseID = Convert.ToInt32(frm._DtResult.Rows[0]["课程ID"]); View_HR_Train_Course courseInfo = _ServiceBasic.GetSingleCourseInfo(courseID); if (courseInfo != null) { chbIsOutSide.Checked = (bool)courseInfo.外训; txtClassHour.Text = courseInfo.预计课时.ToString(); txtLecturer.Text = courseInfo.推荐讲师; numFund.Value = (decimal)courseInfo.预计经费; txtCourse.Text = courseInfo.课程名; txtCourse.Tag = courseInfo.课程ID; btnCourse.Tag = frm._DtResult.Rows[0]["ID"].ToString(); } } }
private void txtCourse_OnCompleteSearch() { txtCourse.Text = txtCourse.DataResult["课程名"].ToString(); txtCourse.Tag = Convert.ToInt32(txtCourse.DataResult["课程ID"]); View_HR_Train_Course tempInfo = _ServiceBasicInfo.GetSingleCourseInfo(Convert.ToInt32(txtCourse.Tag)); txtLecturer.Text = tempInfo.推荐讲师; txtType.Text = tempInfo.课程类型; txtAssess.Text = tempInfo.评估方式; numClassHour.Value = (decimal)tempInfo.预计经费; numFund.Value = (decimal)tempInfo.预计课时; chbIsOutSide.Checked = (bool)tempInfo.外训; DataTable tempTable = _ServiceBasicInfo.GetPostInfo(Convert.ToInt32(txtCourse.Tag)); List <string> lstName = DataSetHelper.ColumnsToList(tempTable, "岗位名称"); txtPost.Text = ""; foreach (string item in lstName) { txtPost.Text += item + ","; } }