private void button_OnOK_Click(object sender, EventArgs e) { this.userControl_WeldingSubjectBase1.FillClass(); String str_ErrMessage; str_ErrMessage = this.myClass_WeldingSubject.CheckField(); if (str_ErrMessage != null) { this.DialogResult = DialogResult.None; this.label_ErrMessage.Text = str_ErrMessage; return; } if (this.bool_Add) { if (!Class_WeldingSubject.ExistAndCanDeleteAndDelete(this.myClass_WeldingSubject.SubjectID, Enum_zwjKindofUpdate.Exist)) { this.myClass_WeldingSubject.AddAndModify(Enum_zwjKindofUpdate.Add); } else { this.label_ErrMessage.Text = "该科目编号已添加!"; this.DialogResult = DialogResult.None; return; } } else { this.myClass_WeldingSubject.AddAndModify(Enum_zwjKindofUpdate.Modify); } }
private void InitControlWeldingSubject(Class_WeldingSubject myClass_Subject, bool bool_Applicable) { if (bool_Applicable) { this.TextBox_WeldingStandardApplicable.Text = myClass_Subject.WeldingStandard; this.TextBox_WeldingProjectApplicable.Text = myClass_Subject.WeldingProject; this.TextBox_WeldingClassApplicable.Text = myClass_Subject.WeldingClass; this.TextBox_WorkPieceTypeApplicable.Text = myClass_Subject.WorkPieceType; this.TextBox_JointTypeApplicable.Text = myClass_Subject.JointType; this.TextBox_SubjectApplicable.Text = myClass_Subject.Subject; this.TextBox_SubjectIDApplicable.Text = myClass_Subject.SubjectID; this.TextBox_SubjectRemarkApplicable.Text = myClass_Subject.SubjectRemark; } else { this.TextBox_WeldingStandard.Text = myClass_Subject.WeldingStandard; this.TextBox_WeldingProject.Text = myClass_Subject.WeldingProject; this.TextBox_WeldingClass.Text = myClass_Subject.WeldingClass; this.TextBox_WorkPieceType.Text = myClass_Subject.WorkPieceType; this.TextBox_JointType.Text = myClass_Subject.JointType; this.TextBox_Subject.Text = myClass_Subject.Subject; this.TextBox_SubjectID.Text = myClass_Subject.SubjectID; this.TextBox_SubjectRemark.Text = myClass_Subject.SubjectRemark; } }
public void InitControlWeldingSubject(Class_WeldingSubject myClass_Subject) { this.TextBox_SubjectID.Text = myClass_Subject.SubjectID; this.TextBox_WeldingStandard.Text = myClass_Subject.WeldingStandard; this.TextBox_WeldingProject.Text = myClass_Subject.WeldingProject; this.TextBox_WeldingClass.Text = myClass_Subject.WeldingClass; this.TextBox_WorkPieceType.Text = myClass_Subject.WorkPieceType; this.TextBox_JointType.Text = myClass_Subject.JointType; this.TextBox_Subject.Text = myClass_Subject.Subject; }
public void InitControlStudent(Class_Student myClass_Student) { Class_Welder myClass_Welder = new Class_Welder(myClass_Student.IdentificationCard); this.TextBox_Welder.Text = string.Format("{0},{1},{2},{3}", myClass_Welder.WelderName, myClass_Welder.IdentificationCard, myClass_Welder.Sex, myClass_Welder.WelderEnglishName); Class_Employer myClass_Employer = new Class_Employer(myClass_Welder.myClass_BelongUnit.EmployerHPID); Class_Department myClass_Department = new Class_Department(myClass_Welder.myClass_BelongUnit.DepartmentHPID); Class_WorkPlace myClass_WorkPlace = new Class_WorkPlace(myClass_Welder.myClass_BelongUnit.WorkPlaceHPID); Class_LaborServiceTeam myClass_LaborServiceTeam = new Class_LaborServiceTeam(myClass_Welder.myClass_BelongUnit.LaborServiceTeamHPID); this.TextBox_Employer.Text = string.Format("{0}->{1}->{2},{3}", myClass_Employer.Employer, myClass_Department.Department, myClass_WorkPlace.WorkPlace, myClass_LaborServiceTeam.LaborServiceTeam); this.TextBox_WorkerID.Text = myClass_Welder.myClass_BelongUnit.WorkerID; this.TextBox_Schooling.Text = myClass_Welder.Schooling; this.textBox_WeldingBeginning.Text = myClass_Welder.WeldingBeginning.ToShortDateString(); Class_Issue myClass_Issue = new Class_Issue(myClass_Student.IssueNo); Class_WeldingSubject myClass_WeldingSubject = new Class_WeldingSubject(myClass_Student.SubjectID); this.textBox_ExaminingNo.Text = myClass_Student.ExaminingNo; this.textBox_IssueNo.Text = myClass_Student.IssueNo; this.textBox_TheoryResult.Text = string.Format("{0}/{1}", myClass_Student.TheoryResult, myClass_Student.TheoryMakeupResult); this.textBox_SkillResult.Text = string.Format("{0}/{1}", myClass_Student.SkillResult ? "√" : "×", myClass_Student.SkillMakeupResult ? "√" : "×"); this.textBox_WeldingProcess.Text = string.Format("{0}({1},{2},{3})", myClass_Issue.WeldingProcessAb, myClass_Student.myClass_WeldingParameter.Material, myClass_Student.myClass_WeldingParameter.WeldingConsumable, myClass_Student.myClass_WeldingParameter.Assemblage); this.TextBox_Subject.Text = string.Format("{0},{1},{2},{3},{4}({5})", myClass_WeldingSubject.Subject, myClass_WeldingSubject.WeldingClass, myClass_WeldingSubject.JointType, myClass_WeldingSubject.WorkPieceType, myClass_WeldingSubject.WeldingProject, myClass_WeldingSubject.SubjectID); this.TextBox_Thickness.Text = myClass_Student.myClass_WeldingParameter.Thickness.ToString(); this.TextBox_ExternalDiameter.Text = myClass_Student.myClass_WeldingParameter.ExternalDiameter.ToString(); this.TextBox_StudentRemark.Text = myClass_Student.StudentRemark; this.myClass_QC = new Class_QC(myClass_Student.ExaminingNo); this.textBox_CertificateNo.Text = myClass_QC.CertificateNo; this.textBox_IssuedOn.Text = myClass_QC.IssuedOn.ToShortDateString(); if ((int)this.NumericUpDown_OriginalPeriod.Minimum <= myClass_QC.OriginalPeriod && (int)this.NumericUpDown_OriginalPeriod.Maximum >= myClass_QC.OriginalPeriod) { this.NumericUpDown_OriginalPeriod.Value = myClass_QC.OriginalPeriod; } if ((int)this.numericUpDown_PeriodofProlongation.Minimum <= myClass_QC.PeriodofProlongation && (int)this.numericUpDown_PeriodofProlongation.Maximum >= myClass_QC.PeriodofProlongation) { this.numericUpDown_PeriodofProlongation.Value = myClass_QC.PeriodofProlongation; } if ((int)this.numericUpDown_SupervisionCycle.Minimum <= myClass_QC.SupervisionCycle && (int)this.numericUpDown_SupervisionCycle.Maximum >= myClass_QC.SupervisionCycle) { this.numericUpDown_SupervisionCycle.Value = myClass_QC.SupervisionCycle; } this.TextBox_QCRemark.Text = myClass_QC.QCRemark; this.checkBox_isQCValid.Checked = myClass_QC.isQCValid; this.checkBox_SupervisionFirst.Checked = myClass_QC.SupervisionFirst; this.checkBox_SupervisionSecond.Checked = myClass_QC.SupervisionSecond; this.checkBox_SupervisionThird.Checked = myClass_QC.SupervisionThird; this.checkBox_SupervisionFourth.Checked = myClass_QC.SupervisionFourth; this.checkBox_SupervisionFifth.Checked = myClass_QC.SupervisionFifth; this.checkBox_SupervisionSixth.Checked = myClass_QC.SupervisionSixth; this.checkBox_SupervisionSeventh.Checked = myClass_QC.SupervisionSeventh; this.checkBox_SupervisionEighth.Checked = myClass_QC.SupervisionEighth; }
/// <summary> /// 删除数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowDelete_Click(object sender, EventArgs e) { if (Class_WeldingSubject.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["SubjectID"].Value.ToString(), Enum_zwjKindofUpdate.CanDelete)) { if (MessageBox.Show("确认删除吗?", "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK) { Class_WeldingSubject.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["SubjectID"].Value.ToString(), Enum_zwjKindofUpdate.Delete); this.RefreshData(false); } } else { MessageBox.Show("不能删除!"); } }
private void Form_WeldingSubjectUpdate_Load(object sender, EventArgs e) { if (!(this.bool_Add || Class_WeldingSubject.ExistAndCanDeleteAndDelete(myClass_WeldingSubject.SubjectID, Enum_zwjKindofUpdate.Exist))) { MessageBox.Show("不存在该项,可能已删除!"); this.DialogResult = DialogResult.Cancel; this.Close(); return; } this.label_ErrMessage.Text = ""; if (!Class_zwjPublic.myBackColor.IsEmpty) { this.BackColor = Class_zwjPublic.myBackColor; } this.userControl_WeldingSubjectBase1.InitControl(this.myClass_WeldingSubject, this.bool_Add); }
/// <summary> /// 更新数据到对象中 /// </summary> public void FillClass() { this.myClass_WeldingSubject.SubjectID = this.MaskedTextBox_SubjectID.Text; this.myClass_WeldingSubject.NeedPreSubject = this.checkBox_NeedPreSubject.Checked; this.myClass_WeldingSubject.WeldingStandard = this.ComboBox_WeldingStandard.SelectedValue.ToString(); this.myClass_WeldingSubject.JointType = this.ComboBox_JointType.SelectedValue.ToString(); this.myClass_WeldingSubject.WorkPieceType = this.ComboBox_WorkPieceType.SelectedValue.ToString(); this.myClass_WeldingSubject.WeldingProject = this.TextBox_WeldingProject.Text; this.myClass_WeldingSubject.WeldingProjectAb = this.TextBox_WeldingProjectAb.Text; this.myClass_WeldingSubject.ScopeofWeldingProject = this.TextBox_ScopeofWeldingProject.Text; this.myClass_WeldingSubject.WeldingClass = this.TextBox_WeldingClass.Text; this.myClass_WeldingSubject.WeldingClassAb = this.TextBox_WeldingClassAb.Text; this.myClass_WeldingSubject.ScopeofWeldingClass = this.TextBox_ScopeofWeldingClass.Text; int.TryParse(this.ComboBox_SubjectClass.Text, out this.myClass_WeldingSubject.SubjectClass); this.myClass_WeldingSubject.Subject = this.TextBox_Subject.Text; this.myClass_WeldingSubject.ScopeofSubject = this.TextBox_ScopeofSubject.Text; this.myClass_WeldingSubject.SubjectThickness = this.TextBox_SubjectThickness.Text; this.myClass_WeldingSubject.SubjectExternalDiameter = this.TextBox_SubjectExternalDiameter.Text; this.myClass_WeldingSubject.SubjectRemark = this.TextBox_SubjectRemark.Text; this.myClass_WeldingSubject.CCSSubject = this.textBox_CCSSubject.Text; this.myClass_WeldingSubject.CCSSubjectTestNo = this.textBox_CCSSubjectTestNo.Text; this.myClass_WeldingSubject.HardestWeldingPosition = this.textBox_HardestWeldingPosition.Text; if (myClass_WeldingSubjectDefault == null) { myClass_WeldingSubjectDefault = new Class_WeldingSubject(); } myClass_WeldingSubjectDefault.SubjectID = myClass_WeldingSubject.SubjectID; myClass_WeldingSubjectDefault.WeldingStandard = myClass_WeldingSubject.WeldingStandard; myClass_WeldingSubjectDefault.JointType = myClass_WeldingSubject.JointType; myClass_WeldingSubjectDefault.WorkPieceType = myClass_WeldingSubject.WorkPieceType; myClass_WeldingSubjectDefault.WeldingProject = myClass_WeldingSubject.WeldingProject; myClass_WeldingSubjectDefault.WeldingProjectAb = myClass_WeldingSubject.WeldingProjectAb; myClass_WeldingSubjectDefault.ScopeofWeldingProject = myClass_WeldingSubject.ScopeofWeldingProject; myClass_WeldingSubjectDefault.WeldingClass = myClass_WeldingSubject.WeldingClass; myClass_WeldingSubjectDefault.WeldingClassAb = myClass_WeldingSubject.WeldingClassAb; myClass_WeldingSubjectDefault.ScopeofWeldingClass = myClass_WeldingSubject.ScopeofWeldingClass; myClass_WeldingSubjectDefault.SubjectClass = myClass_WeldingSubject.SubjectClass; myClass_WeldingSubjectDefault.Subject = myClass_WeldingSubject.Subject; myClass_WeldingSubjectDefault.ScopeofSubject = myClass_WeldingSubject.ScopeofSubject; myClass_WeldingSubjectDefault.SubjectThickness = myClass_WeldingSubject.SubjectThickness; myClass_WeldingSubjectDefault.SubjectExternalDiameter = myClass_WeldingSubject.SubjectExternalDiameter; myClass_WeldingSubjectDefault.SubjectRemark = myClass_WeldingSubject.SubjectRemark; myClass_WeldingSubjectDefault.HardestWeldingPosition = myClass_WeldingSubject.HardestWeldingPosition; }
/// <summary> /// 初始化数据 /// </summary> /// <param name="myClass_WeldingSubject"></param> /// <param name="bool_Add"></param> public void InitControl(Class_WeldingSubject myClass_WeldingSubject, bool bool_Add) { DataView myDataView_WeldingStandard = new DataView(((Class_Data)Class_Public.myHashtable[Enum_DataTable.WeldingStandardAndGroup.ToString()]).myDataTable); myDataView_WeldingStandard.RowFilter = "WeldingStandardGroup='焊工考试标准'"; Class_DataControlBind.InitializeComboBox(this.ComboBox_WeldingStandard, myDataView_WeldingStandard, "WeldingStandard", "WeldingStandard"); Class_Public.InitializeComboBox(this.ComboBox_JointType, Enum_DataTable.JointType.ToString(), "JointType", "JointType"); Class_Public.InitializeComboBox(this.ComboBox_WorkPieceType, Enum_DataTable.WorkPieceType.ToString(), "WorkPieceType", "WorkPieceType"); this.ComboBox_SubjectClass.Text = "0"; this.myClass_WeldingSubject = myClass_WeldingSubject; if (bool_Add) { if (myClass_WeldingSubjectDefault != null) { this.MaskedTextBox_SubjectID.Text = myClass_WeldingSubjectDefault.SubjectID; this.ComboBox_WeldingStandard.SelectedValue = myClass_WeldingSubjectDefault.WeldingStandard; this.ComboBox_JointType.SelectedValue = myClass_WeldingSubjectDefault.JointType; this.ComboBox_WorkPieceType.SelectedValue = myClass_WeldingSubjectDefault.WorkPieceType; this.TextBox_WeldingProject.Text = myClass_WeldingSubjectDefault.WeldingProject; this.TextBox_WeldingProjectAb.Text = myClass_WeldingSubjectDefault.WeldingProjectAb; this.TextBox_ScopeofWeldingProject.Text = myClass_WeldingSubjectDefault.ScopeofWeldingProject; this.TextBox_WeldingClass.Text = myClass_WeldingSubjectDefault.WeldingClass; this.TextBox_WeldingClassAb.Text = myClass_WeldingSubjectDefault.WeldingClassAb; this.TextBox_ScopeofWeldingClass.Text = myClass_WeldingSubjectDefault.ScopeofWeldingClass; this.ComboBox_SubjectClass.Text = myClass_WeldingSubjectDefault.SubjectClass.ToString(); this.TextBox_Subject.Text = myClass_WeldingSubjectDefault.Subject; this.TextBox_ScopeofSubject.Text = myClass_WeldingSubjectDefault.ScopeofSubject; this.TextBox_SubjectThickness.Text = myClass_WeldingSubjectDefault.SubjectThickness; this.TextBox_SubjectExternalDiameter.Text = myClass_WeldingSubjectDefault.SubjectExternalDiameter; this.textBox_HardestWeldingPosition.Text = myClass_WeldingSubjectDefault.HardestWeldingPosition; } if (!string.IsNullOrEmpty(myClass_WeldingSubject.WeldingStandard)) { this.ComboBox_WeldingStandard.SelectedValue = myClass_WeldingSubject.WeldingStandard; } } else { this.MaskedTextBox_SubjectID.ReadOnly = true; this.MaskedTextBox_SubjectID.Text = this.myClass_WeldingSubject.SubjectID; this.checkBox_NeedPreSubject.Checked = this.myClass_WeldingSubject.NeedPreSubject; this.ComboBox_WeldingStandard.SelectedValue = this.myClass_WeldingSubject.WeldingStandard; this.ComboBox_JointType.SelectedValue = this.myClass_WeldingSubject.JointType; this.ComboBox_WorkPieceType.SelectedValue = this.myClass_WeldingSubject.WorkPieceType; this.TextBox_WeldingProject.Text = this.myClass_WeldingSubject.WeldingProject; this.TextBox_WeldingProjectAb.Text = this.myClass_WeldingSubject.WeldingProjectAb; this.TextBox_ScopeofWeldingProject.Text = this.myClass_WeldingSubject.ScopeofWeldingProject; this.TextBox_WeldingClass.Text = this.myClass_WeldingSubject.WeldingClass; this.TextBox_WeldingClassAb.Text = this.myClass_WeldingSubject.WeldingClassAb; this.TextBox_ScopeofWeldingClass.Text = this.myClass_WeldingSubject.ScopeofWeldingClass; this.ComboBox_SubjectClass.Text = this.myClass_WeldingSubject.SubjectClass.ToString(); this.TextBox_Subject.Text = this.myClass_WeldingSubject.Subject; this.TextBox_ScopeofSubject.Text = this.myClass_WeldingSubject.ScopeofSubject; this.TextBox_SubjectThickness.Text = this.myClass_WeldingSubject.SubjectThickness; this.TextBox_SubjectExternalDiameter.Text = this.myClass_WeldingSubject.SubjectExternalDiameter; this.TextBox_SubjectRemark.Text = this.myClass_WeldingSubject.SubjectRemark; this.textBox_CCSSubject.Text = this.myClass_WeldingSubject.CCSSubject; this.textBox_CCSSubjectTestNo.Text = this.myClass_WeldingSubject.CCSSubjectTestNo; this.textBox_HardestWeldingPosition.Text = this.myClass_WeldingSubject.HardestWeldingPosition; } }