/// <summary> /// 根据权限设置功能列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void contextMenuStrip_DataGridViewRow_Opening(object sender, CancelEventArgs e) { this.toolStripMenuItem_DataGridViewRowAdd.Enabled = Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("考试权限"), Enum_zwjKindofUpdate.Add); this.toolStripMenuItem_DataGridViewRowModify.Enabled = Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("考试权限"), Enum_zwjKindofUpdate.Modify); this.toolStripMenuItem_DataGridViewRowDelete.Enabled = Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("考试权限"), Enum_zwjKindofUpdate.Delete); //this.toolStripMenuItem_DataGridViewRowExportToExcel.Enabled = Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("考试权限"), Enum_zwjKindofUpdate.Print); this.toolStripMenuItem_RowLockOut.Enabled = Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("考试权限"), Enum_zwjKindofUpdate.LockOut); if (this.myEventArgs_ShipClassification.bool_GXTheory) { if (Class_GXTheoryIssue.CheckFinished(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString())) { this.toolStripMenuItem_DataGridViewRowModify.Enabled = false; this.toolStripMenuItem_DataGridViewRowDelete.Enabled = false; } } else { if (Class_Issue.CheckFinished(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString())) { this.toolStripMenuItem_DataGridViewRowModify.Enabled = false; this.toolStripMenuItem_DataGridViewRowDelete.Enabled = false; } } }
/// <summary> /// 初始化数据 /// </summary> /// <param name="myClass_GXTheoryStudent"></param> /// <param name="bool_Add"></param> public void InitControl(Class_GXTheoryStudent myClass_GXTheoryStudent, bool bool_Add) { Class_Public.InitializeComboBox(this.ComboBox_KindofExam, Enum_DataTable.KindofExam.ToString(), "KindofExam", "KindofExam"); Class_Public.InitializeComboBox(this.ComboBox_ExamStatus, Enum_DataTable.ExamStatus.ToString(), "ExamStatus", "ExamStatus"); this.ComboBox_ExamStatus.SelectedValue = "顺利考试"; this.TextBox_IssueNo.Text = myClass_GXTheoryStudent.IssueNo; this.myClass_GXTheoryStudent = myClass_GXTheoryStudent; if (bool_Add) { Class_GXTheoryIssue myClass_GXTheoryIssue = new Class_GXTheoryIssue(myClass_GXTheoryStudent.IssueNo); this.textBox_WeldingProcessAb.Text = myClass_GXTheoryIssue.WeldingProcessAb; this.ComboBox_KindofExam.SelectedValue = myClass_GXTheoryIssue.KindofExam; Class_Ship myClass_Ship = new Class_Ship(myClass_GXTheoryIssue.ShipboardNo); this.MaskedTextBox_ExaminingNo.Text = myClass_Ship.NextTheoryExaminingNo; if (myClass_GXTheoryStudentDefault != null) { this.InitControlWeldingSubject(new Class_WeldingSubject(myClass_GXTheoryStudentDefault.SubjectID)); } } else { this.TextBox_StudentRemark.Text = myClass_GXTheoryStudent.StudentRemark; this.MaskedTextBox_ExaminingNo.Text = this.myClass_GXTheoryStudent.ExaminingNo; this.ComboBox_ExamStatus.SelectedValue = this.myClass_GXTheoryStudent.ExamStatus; this.NumericUpDown_TheoryResult.Value = this.myClass_GXTheoryStudent.TheoryResult; this.NumericUpDown_TheoryMakeupResult.Value = this.myClass_GXTheoryStudent.TheoryMakeupResult; this.InitControlWelder(new Class_Welder(this.myClass_GXTheoryStudent.IdentificationCard)); this.InitControlWeldingSubject(new Class_WeldingSubject(this.myClass_GXTheoryStudent.SubjectID)); } }
private void Button_WelderUpdate_Click(object sender, EventArgs e) { Form_Welder_Query myForm = new Form_Welder_Query(); myForm.myClass_Welder = new Class_Welder(); if (this.myClass_GXTheoryStudent.IdentificationCard != null) { myForm.myClass_Welder.IdentificationCard = this.myClass_GXTheoryStudent.IdentificationCard; myForm.myClass_Welder.FillData(); } if (myForm.ShowDialog() == DialogResult.OK) { Class_GXTheoryIssue myClass_GXTheoryIssue = new Class_GXTheoryIssue(this.myClass_GXTheoryStudent.IssueNo); string str_ReturnMessage = Class_Welder.CanSignUp(myForm.myClass_Welder.IdentificationCard, myClass_GXTheoryIssue.WeldingProcessAb, null, myClass_GXTheoryIssue.ShipClassificationAb, myClass_GXTheoryIssue.ShipboardNo, null, null, null, null, true); if (string.IsNullOrEmpty(str_ReturnMessage)) { this.myClass_GXTheoryStudent.IdentificationCard = myForm.myClass_Welder.IdentificationCard; this.InitControlWelder(myForm.myClass_Welder); } else { MessageBox.Show(str_ReturnMessage); } } }
/// <summary> /// 删除数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowDelete_Click(object sender, EventArgs e) { if (this.myEventArgs_ShipClassification.bool_GXTheory) { if (Class_GXTheoryIssue.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), Enum_zwjKindofUpdate.CanDelete)) { if (MessageBox.Show("确认删除吗?", "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK) { Class_GXTheoryIssue.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), Enum_zwjKindofUpdate.Delete); this.RefreshData(false); } } else { MessageBox.Show("不能删除!"); } } else { if (Class_Issue.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), Enum_zwjKindofUpdate.CanDelete)) { if (MessageBox.Show("确认删除吗?", "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK) { Class_Issue.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), Enum_zwjKindofUpdate.Delete); this.RefreshData(false); } } else { MessageBox.Show("不能删除!"); } } }
private void toolStripMenuItem_UpdateIssueStatus_Click(object sender, EventArgs e) { return; Class_Issue.UpdateIssueStatus(null); Class_GXTheoryIssue.UpdateIssueStatus(null); this.RefreshData(true); }
private void toolStripMenuItem_RowTransferToGXTheoryIssue_Click(object sender, EventArgs e) { Form_GXTheoryIssue_Query myForm = new Form_GXTheoryIssue_Query(); myForm.myClass_GXTheoryIssue = new Class_GXTheoryIssue(); if (!string.IsNullOrEmpty(this.str_IssueNo)) { myForm.myClass_GXTheoryIssue.IssueNo = this.str_IssueNo; myForm.myClass_GXTheoryIssue.FillData(); } if (myForm.ShowDialog() == DialogResult.OK) { this.str_IssueNo = myForm.myClass_GXTheoryIssue.IssueNo; } else { return; } if (Class_GXTheoryIssue.ExistAndCanDeleteAndDelete(this.str_IssueNo, Enum_zwjKindofUpdate.Exist)) { Class_KindofEmployerStudent myClass_KindofEmployerStudent = new Class_KindofEmployerStudent((int)this.dataGridView_Data.CurrentRow.Cells["KindofEmployerStudentID"].Value); Class_KindofEmployerWelder myClass_KindofEmployerWelder = new Class_KindofEmployerWelder(myClass_KindofEmployerStudent.KindofEmployerWelderID); Class_GXTheoryStudent myClass_GXTheoryStudent = new Class_GXTheoryStudent(); myClass_GXTheoryStudent.IssueNo = this.str_IssueNo; myClass_GXTheoryStudent.IdentificationCard = myClass_KindofEmployerWelder.IdentificationCard; myClass_GXTheoryStudent.SubjectID = myClass_KindofEmployerStudent.ExamSubjectID; Class_GXTheoryIssue myClass_GXTheoryIssue = new Class_GXTheoryIssue(myClass_GXTheoryStudent.IssueNo); myClass_GXTheoryStudent.KindofExam = myClass_GXTheoryIssue.KindofExam; string str_ReturnMessage; str_ReturnMessage = myClass_GXTheoryStudent.CheckField(); if (string.IsNullOrEmpty(str_ReturnMessage)) { Class_KindofEmployerWelder.TransferWelder(myClass_KindofEmployerStudent.KindofEmployerWelderID); myClass_GXTheoryStudent.AddAndModify(Enum_zwjKindofUpdate.Add); if (string.IsNullOrEmpty(myClass_GXTheoryStudent.ExaminingNo)) { MessageBox.Show("编入理论班级失败,可能是下一个理论考编号设置错误!"); } else { Class_KindofEmployerStudent.ExistAndCanDeleteAndDelete(myClass_KindofEmployerStudent.KindofEmployerStudentID, Enum_zwjKindofUpdate.Delete); this.myEventArgs_KindofEmployerIssue.bool_JustFill = false; Publisher_KindofEmployerIssue.OnEventName(this.myEventArgs_KindofEmployerIssue); MessageBox.Show(string.Format("编入班级成功,理论班级编号为 {0},理论考编号为 {1}", this.str_IssueNo, myClass_GXTheoryStudent.ExaminingNo)); } } else { MessageBox.Show(string.Format("编入理论班级失败,{0}!", str_ReturnMessage)); } } else { MessageBox.Show(string.Format("不存在理论班级编号为 {0} 的班级!", this.str_IssueNo)); } }
private void button_OnOK_Click(object sender, EventArgs e) { if (this.myDataTable == null) { this.DialogResult = DialogResult.None; this.label_ErrMessage.Text = "没有添加焊工!"; return; } string str_ErrMessage; Class_GXTheoryStudent myClass_GXTheoryStudent; Class_GXTheoryIssue myClass_GXTheoryIssue = new Class_GXTheoryIssue(this.str_IssueNo); foreach (DataRow myDataRow in this.myDataTable.Rows) { myDataRow["WelderRemark"] = ""; myClass_GXTheoryStudent = new Class_GXTheoryStudent(); myClass_GXTheoryStudent.IssueNo = this.str_IssueNo; myClass_GXTheoryStudent.IdentificationCard = myDataRow["IdentificationCard"].ToString(); myClass_GXTheoryStudent.ExamStatus = "顺利考试"; myClass_GXTheoryStudent.KindofExam = myClass_GXTheoryIssue.KindofExam; if (Class_GXTheoryStudent.ExistSecond(myClass_GXTheoryStudent.IssueNo, myClass_GXTheoryStudent.IdentificationCard, null, Enum_zwjKindofUpdate.Add)) { myDataRow["WelderRemark"] = "身份证号码不能重复!"; } else { str_ErrMessage = myClass_GXTheoryStudent.CheckField(); if (string.IsNullOrEmpty(str_ErrMessage)) { if (!myClass_GXTheoryStudent.AddAndModify(Enum_zwjKindofUpdate.Add)) { myDataRow["WelderRemark"] = "添加不成功,可能是考编号重复!"; } else { this.bool_Updated = true; } } else { myDataRow["WelderRemark"] = str_ErrMessage; } } } DataRow[] myDataRowRange = this.myDataTable.Select("WelderRemark = '' or WelderRemark is null"); if (myDataRowRange.Length < this.myDataTable.Rows.Count) { this.label_ErrMessage.Text = "有数据不合法!请查看备注信息"; this.DialogResult = DialogResult.None; } foreach (DataRow myDataRow in myDataRowRange) { myDataRow.Delete(); } this.myDataTable.AcceptChanges(); }
/// <summary> /// 更新数据到对象中 /// </summary> public void FillClass() { myClass_GXTheoryIssue.IssueNo = this.MaskedTextBox_IssueNo.Text; myClass_GXTheoryIssue.IssueRemark = this.TextBox_IssueRemark.Text; myClass_GXTheoryIssue.WeldingProcessAb = this.ComboBox_WeldingProcess.SelectedValue.ToString(); myClass_GXTheoryIssue.KindofExam = this.ComboBox_KindofExam.SelectedValue.ToString(); if (!string.IsNullOrEmpty(this.textBox_TheoryTeacherID.Text)) { this.myClass_GXTheoryIssue.TheoryTeacherID = new Guid((this.textBox_TheoryTeacherID.Text.Split(':'))[1]); } if (!string.IsNullOrEmpty(this.textBox_ArchiveTeacherID.Text)) { this.myClass_GXTheoryIssue.ArchiveTeacherID = new Guid((this.textBox_ArchiveTeacherID.Text.Split(':'))[1]); } myClass_GXTheoryIssue.SignUpDate = this.DateTimePicker_SignUpDate.Value; DateTime.TryParse(this.MaskedTextBox_TheoryExamDate.Text, out myClass_GXTheoryIssue.TheoryExamDate); DateTime.TryParse(this.MaskedTextBox_TheoryMakeupDate.Text, out myClass_GXTheoryIssue.TheoryMakeupDate); DateTime.TryParse(this.MaskedTextBox_DateBeginningofTrain.Text, out myClass_GXTheoryIssue.DateBeginningofTrain); DateTime.TryParse(this.MaskedTextBox_DateEndingofTrain.Text, out myClass_GXTheoryIssue.DateEndingofTrain); myClass_GXTheoryIssue.PlaceofTest = this.TextBox_PlaceofTest.Text; myClass_GXTheoryIssue.IssueStatus = 0; if (this.CheckBox_TheoryTrained.Checked) { myClass_GXTheoryIssue.IssueStatus = (uint)(myClass_GXTheoryIssue.IssueStatus + 1); } if (this.CheckBox_TheoryExam.Checked) { myClass_GXTheoryIssue.IssueStatus = (uint)(myClass_GXTheoryIssue.IssueStatus + 2); } if (this.CheckBox_TheoryExamMakeup.Checked) { myClass_GXTheoryIssue.IssueStatus = (uint)(myClass_GXTheoryIssue.IssueStatus + 16); } if (this.CheckBox_Finished.Checked) { myClass_GXTheoryIssue.IssueStatus = (uint)(myClass_GXTheoryIssue.IssueStatus + 2147483648); } if (myClass_GXTheoryIssueDefault == null) { myClass_GXTheoryIssueDefault = new Class_GXTheoryIssue(); } myClass_GXTheoryIssueDefault.WeldingProcessAb = myClass_GXTheoryIssue.WeldingProcessAb; myClass_GXTheoryIssueDefault.KindofExam = myClass_GXTheoryIssue.KindofExam; myClass_GXTheoryIssueDefault.PlaceofTest = myClass_GXTheoryIssue.PlaceofTest; myClass_GXTheoryIssueDefault.KindofEmployer = myClass_GXTheoryIssue.KindofEmployer; myClass_GXTheoryIssueDefault.EmployerHPID = myClass_GXTheoryIssue.EmployerHPID; }
private void Form_GXTheoryStudent_AddBatch_Load(object sender, EventArgs e) { Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.Welder.ToString(), false); this.TextBox_IssueNo.Text = this.str_IssueNo; Class_GXTheoryIssue myClass_GXTheoryIssue = new Class_GXTheoryIssue(this.str_IssueNo); Class_ShipClassification myClass_ShipClassification = new Class_ShipClassification(myClass_GXTheoryIssue.ShipClassificationAb); if (myClass_ShipClassification.ShipRestrict) { Class_Ship myClass_Ship = new Class_Ship(myClass_GXTheoryIssue.ShipboardNo); this.MaskedTextBox_ExaminingNo.Text = myClass_Ship.NextTheoryExaminingNo; } else { this.MaskedTextBox_ExaminingNo.Text = myClass_ShipClassification.NextExaminingNo; } }
/// <summary> /// 根据权限设置功能列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void contextMenuStrip_DataGridView_Opening(object sender, CancelEventArgs e) { if (this.myEventArgs_Issue == null) { return; } bool bool_Finished; if (this.myEventArgs_Issue.bool_GXTheory) { bool_Finished = Class_GXTheoryIssue.CheckFinished(this.myEventArgs_Issue.str_IssueNo); } else { bool_Finished = Class_Issue.CheckFinished(this.myEventArgs_Issue.str_IssueNo); } this.toolStripMenuItem_DataGridViewAdd.Enabled = Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("考试权限"), Enum_zwjKindofUpdate.Add) && !bool_Finished; this.toolStripMenuItem_DataGridViewAddBatch.Enabled = Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("考试权限"), Enum_zwjKindofUpdate.Add) && !bool_Finished; }
private void Button_SubjectQuery_Click(object sender, EventArgs e) { Class_GXTheoryIssue myClass_Issue = new Class_GXTheoryIssue(this.myClass_GXTheoryStudent.IssueNo); Class_ShipClassification myClass_ShipClassification = new Class_ShipClassification(myClass_Issue.ShipClassificationAb); Form_WeldingSubject_Query myForm = new Form_WeldingSubject_Query(); if (myClass_ShipClassification.WeldingStandardRestrict) { myForm.str_FilterRestrict = string.Format("WeldingStandard='{0}'", myClass_ShipClassification.WeldingStandard);; } myForm.myClass_WeldingSubject = new Class_WeldingSubject(); if (this.myClass_GXTheoryStudent.SubjectID != null) { myForm.myClass_WeldingSubject.SubjectID = this.myClass_GXTheoryStudent.SubjectID; myForm.myClass_WeldingSubject.FillData(); } if (myForm.ShowDialog() == DialogResult.OK) { this.myClass_GXTheoryStudent.SubjectID = myForm.myClass_WeldingSubject.SubjectID; this.InitControlWeldingSubject(myForm.myClass_WeldingSubject); } }
private void toolStripMenuItem_RowLockOut_Click(object sender, EventArgs e) { if (this.toolStripMenuItem_RowLockOut.Text == "解锁") { if (this.myEventArgs_ShipClassification != null) { if (this.myEventArgs_ShipClassification.bool_GXTheory) { Class_GXTheoryIssue.LockOut(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), false); this.RefreshData(true); } else { Class_Issue.LockOut(this.dataGridView_Data.CurrentRow.Cells["IssueNo"].Value.ToString(), false); this.RefreshData(true); } } } else { } }
private void Button_SubjectQuery_Click(object sender, EventArgs e) { Class_ShipClassification myClass_ShipClassification; if (this.bool_GXTheory) { Class_GXTheoryIssue myClass_GXTheoryIssue = new Class_GXTheoryIssue(this.str_IssueNo); myClass_ShipClassification = new Class_ShipClassification(myClass_GXTheoryIssue.ShipClassificationAb); } else { Class_Issue myClass_Issue = new Class_Issue(this.str_IssueNo); myClass_ShipClassification = new Class_ShipClassification(myClass_Issue.ShipClassificationAb); } Form_WeldingSubject_Query myForm = new Form_WeldingSubject_Query(); if (myClass_ShipClassification.WeldingStandardRestrict) { myForm.str_FilterRestrict = string.Format("WeldingStandard='{0}'", myClass_ShipClassification.WeldingStandard);; } myForm.myClass_WeldingSubject = new Class_WeldingSubject(); if (!string.IsNullOrEmpty(this.TextBox_SubjectID.Text)) { myForm.myClass_WeldingSubject.SubjectID = this.TextBox_SubjectID.Text; myForm.myClass_WeldingSubject.FillData(); } if (myForm.ShowDialog() == DialogResult.OK) { this.TextBox_SubjectID.Text = myForm.myClass_WeldingSubject.SubjectID; this.TextBox_WeldingStandard.Text = myForm.myClass_WeldingSubject.WeldingStandard; this.TextBox_WeldingProject.Text = myForm.myClass_WeldingSubject.WeldingProject; this.TextBox_WeldingClass.Text = myForm.myClass_WeldingSubject.WeldingClass; this.TextBox_WorkPieceType.Text = myForm.myClass_WeldingSubject.WorkPieceType; this.TextBox_JointType.Text = myForm.myClass_WeldingSubject.JointType; this.TextBox_Subject.Text = myForm.myClass_WeldingSubject.Subject; } }
public void InitDataGridView(string str_IssueNo, bool bool_GXTheory) { this.str_IssueNo = str_IssueNo; this.bool_GXTheory = bool_GXTheory; this.Text = string.Format("批量输入成绩 - {0}", this.str_IssueNo); if (this.bool_GXTheory) { Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.GXTheoryWelderStudent.ToString(), false); Class_DataControlBind.InitializeDataGridView(this.dataGridView_SubjectPositionResult, Enum_DataTable.SubjectPositionResult.ToString(), false); this.myDataTable_WelderStudentQC = Class_GXTheoryIssue.GetDataTable_WelderStudent(str_IssueNo, null, "ExaminingNo"); this.dataGridView_Data.DataSource = new DataView(this.myDataTable_WelderStudentQC); } else { Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.WelderStudentQC.ToString(), false); Class_DataControlBind.InitializeDataGridView(this.dataGridView_SubjectPositionResult, Enum_DataTable.SubjectPositionResult.ToString(), false); this.myDataTable_WelderStudentQC = Class_Issue.GetDataTable_WelderStudentQC(str_IssueNo, null, "ExaminingNo"); this.myDataTable_SubjectPositionResult = Class_Issue.GetDataTable_SubjectPositionResult(str_IssueNo, null, "ExaminingNo, WeldingPosition"); this.dataGridView_SubjectPositionResult.DataSource = new DataView(this.myDataTable_SubjectPositionResult); this.dataGridView_Data.DataSource = new DataView(this.myDataTable_WelderStudentQC); this.dataGridView_Data.Columns["SkillResult"].ReadOnly = false; this.dataGridView_Data.Columns["SkillMakeupResult"].ReadOnly = false; this.dataGridView_Data.Columns["StudentMarked"].ReadOnly = false; this.dataGridView_Data.Columns["StudentAssemblage"].ReadOnly = false; this.dataGridView_Data.Columns["StudentMaterial"].ReadOnly = false; this.dataGridView_Data.Columns["StudentDimensionofMaterial"].ReadOnly = false; this.dataGridView_Data.Columns["StudentWeldingConsumable"].ReadOnly = false; this.dataGridView_Data.Columns["StudentThickness"].ReadOnly = false; this.dataGridView_Data.Columns["StudentExternalDiameter"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["isPassed"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["isMakeup"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["FaceDT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["RT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["BendDT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["UT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["DisjunctionDT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["Impact"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MacroExamination"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["OtherDT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["Flaw"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MakeupFaceDT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MakeupRT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MakeupBendDT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MakeupUT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MakeupDisjunctionDT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MakeupImpact"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MakeupMacroExamination"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MakeupOtherDT"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["MakeupFlaw"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["WeldingPositionResultAssemblage"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["WeldingPositionResultThickness"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["WeldingPositionResultExternalDiameter"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["WeldingPositionResultRenderWeldingRodDiameter"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["WeldingPositionResultWeldingRodDiameter"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["WeldingPositionResultCoverWeldingRodDiameter"].ReadOnly = false; this.dataGridView_SubjectPositionResult.Columns["WeldingPositionResultRemark"].ReadOnly = false; } this.dataGridView_Data.Columns["StudentKindofExam"].ReadOnly = false; this.dataGridView_Data.Columns["ExamStatus"].ReadOnly = false; this.dataGridView_Data.Columns["TheoryResult"].ReadOnly = false; this.dataGridView_Data.Columns["TheoryMakeupResult"].ReadOnly = false; this.dataGridView_Data.Columns["StudentRemark"].ReadOnly = false; this.label_Data.Text = string.Format("学员,({0}):", this.dataGridView_Data.RowCount); this.label_SubjectPositionResult.Text = string.Format("考试项目,({0}):", this.dataGridView_SubjectPositionResult.RowCount); }
/// <summary> /// 初始化数据 /// </summary> /// <param name="myClass_GXTheoryIssue"></param> /// <param name="bool_Add"></param> public void InitControl(Class_GXTheoryIssue myClass_GXTheoryIssue, bool bool_Add) { this.myClass_GXTheoryIssue = myClass_GXTheoryIssue; Class_Public.InitializeComboBox(this.ComboBox_KindofExam, Enum_DataTable.KindofExam.ToString(), "KindofExam", "KindofExam"); Class_Public.InitializeComboBox(this.ComboBox_WeldingProcess, Enum_DataTable.WeldingProcess.ToString(), "WeldingProcessAb", "WeldingProcessAb"); this.textBox_ShipClassificationAb.Text = this.myClass_GXTheoryIssue.ShipClassificationAb; this.TextBox_ShipboardNo.Text = this.myClass_GXTheoryIssue.ShipboardNo; if (bool_Add) { Class_Ship myClass_Ship = new Class_Ship(this.myClass_GXTheoryIssue.ShipboardNo); this.MaskedTextBox_IssueNo.Text = myClass_Ship.NextTheoryIssueNo; if (myClass_GXTheoryIssueDefault != null) { this.ComboBox_WeldingProcess.SelectedValue = myClass_GXTheoryIssueDefault.WeldingProcessAb; this.ComboBox_KindofExam.SelectedValue = myClass_GXTheoryIssueDefault.KindofExam; this.TextBox_PlaceofTest.Text = myClass_GXTheoryIssueDefault.PlaceofTest; this.textBox_KindofEmployer.Text = myClass_GXTheoryIssueDefault.KindofEmployer; Class_Employer myClass_Employer = new Class_Employer(myClass_GXTheoryIssueDefault.EmployerHPID); this.textBox_Employer.Text = string.Format("{0}:{1}", myClass_Employer.EmployerHPID, myClass_Employer.Employer); this.myClass_GXTheoryIssue.KindofEmployer = myClass_GXTheoryIssueDefault.KindofEmployer; this.myClass_GXTheoryIssue.EmployerHPID = myClass_GXTheoryIssueDefault.EmployerHPID; } Class_CustomUser myClass_CustomUser = new Class_CustomUser(); if (!string.IsNullOrEmpty(Properties.Settings.Default.TheoryTeacherID)) { myClass_CustomUser.UserGUID = new Guid(Properties.Settings.Default.TheoryTeacherID); if (myClass_CustomUser.FillData()) { this.textBox_TheoryTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString()); } } if (!string.IsNullOrEmpty(Properties.Settings.Default.ArchiveTeacherID)) { myClass_CustomUser.UserGUID = new Guid(Properties.Settings.Default.ArchiveTeacherID); if (myClass_CustomUser.FillData()) { this.textBox_ArchiveTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString()); } } } else { this.MaskedTextBox_IssueNo.Text = myClass_GXTheoryIssue.IssueNo; this.TextBox_IssueRemark.Text = myClass_GXTheoryIssue.IssueRemark; this.DateTimePicker_SignUpDate.Value = myClass_GXTheoryIssue.SignUpDate; this.textBox_KindofEmployer.Text = myClass_GXTheoryIssue.KindofEmployer; Class_Employer myClass_Employer = new Class_Employer(myClass_GXTheoryIssue.EmployerHPID); this.textBox_Employer.Text = string.Format("{0}:{1}", myClass_Employer.EmployerHPID, myClass_Employer.Employer); this.ComboBox_WeldingProcess.SelectedValue = myClass_GXTheoryIssue.WeldingProcessAb; this.ComboBox_KindofExam.SelectedValue = myClass_GXTheoryIssue.KindofExam; Class_CustomUser myClass_CustomUser = new Class_CustomUser(); myClass_CustomUser.UserGUID = myClass_GXTheoryIssue.TheoryTeacherID; if (myClass_CustomUser.FillData()) { this.textBox_TheoryTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString()); } myClass_CustomUser.UserGUID = myClass_GXTheoryIssue.ArchiveTeacherID; if (myClass_CustomUser.FillData()) { this.textBox_ArchiveTeacherID.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString()); } this.TextBox_PlaceofTest.Text = myClass_GXTheoryIssue.PlaceofTest; if (myClass_GXTheoryIssue.TheoryExamDate != DateTime.MinValue) { this.MaskedTextBox_TheoryExamDate.Text = myClass_GXTheoryIssue.TheoryExamDate.ToString("yyyy-MM-dd"); } if (myClass_GXTheoryIssue.TheoryMakeupDate != DateTime.MinValue) { this.MaskedTextBox_TheoryMakeupDate.Text = myClass_GXTheoryIssue.TheoryMakeupDate.ToString("yyyy-MM-dd"); } if (myClass_GXTheoryIssue.DateBeginningofTrain != DateTime.MinValue) { this.MaskedTextBox_DateBeginningofTrain.Text = myClass_GXTheoryIssue.DateBeginningofTrain.ToString("yyyy-MM-dd"); } if (myClass_GXTheoryIssue.DateEndingofTrain != DateTime.MinValue) { this.MaskedTextBox_DateEndingofTrain.Text = myClass_GXTheoryIssue.DateEndingofTrain.ToString("yyyy-MM-dd"); } this.CheckBox_TheoryTrained.Checked = Class_DataValidateTool.CheckUintBit(this.myClass_GXTheoryIssue.IssueStatus, 0); this.CheckBox_TheoryExam.Checked = Class_DataValidateTool.CheckUintBit(this.myClass_GXTheoryIssue.IssueStatus, 1); this.CheckBox_TheoryExamMakeup.Checked = Class_DataValidateTool.CheckUintBit(this.myClass_GXTheoryIssue.IssueStatus, 4); this.CheckBox_Finished.Checked = Class_DataValidateTool.CheckUintBit(this.myClass_GXTheoryIssue.IssueStatus, 31); } }