/// <summary> /// 初始化数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void InitDataGridView(object sender, EventArgs_Unit e) { this.str_Filter = null; this.myEventArgs_Unit = e; Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.WelderBelong.ToString(), false); Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.WelderBelong.ToString()]; if (string.IsNullOrEmpty(this.myEventArgs_Unit.WorkPlaceHPID)) { if (string.IsNullOrEmpty(this.myEventArgs_Unit.DepartmentHPID)) { if (string.IsNullOrEmpty(this.myEventArgs_Unit.EmployerHPID)) { if (string.IsNullOrEmpty(this.myEventArgs_Unit.EmployerGroup)) { str_Filter = string.Format("1=1"); } else { str_Filter = string.Format("WelderBelongEmployerGroup='{0}'", this.myEventArgs_Unit.EmployerGroup); } } else { str_Filter = string.Format("WelderBelongEmployerHPID='{0}'", this.myEventArgs_Unit.EmployerHPID); } } else { str_Filter = string.Format("WelderBelongDepartmentHPID='{0}'", this.myEventArgs_Unit.DepartmentHPID); } } else { str_Filter = string.Format("WelderBelongWorkPlaceHPID='{0}'", this.myEventArgs_Unit.WorkPlaceHPID); } if (bool_Refresh) { myClass_Data.SetFilter(str_Filter); if (this.myEventArgs_Unit.bool_JustFill) { if (this.myDataTable.Rows.Count == 0) { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_Unit.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; } else { myClass_Data.RefreshData(this.myEventArgs_Unit.bool_JustFill, this.myDataTable); } } else { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_Unit.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; } } else { if (this.myDataTable == null) { myClass_Data.SetFilter("1=1"); this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_Unit.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; } else { } ((DataView)this.dataGridView_Data.DataSource).RowFilter = str_Filter; } if (string.IsNullOrEmpty(((DataView)this.dataGridView_Data.DataSource).Sort)) { ((DataView)this.dataGridView_Data.DataSource).Sort = myClass_Data.myDataView.Sort; } this.label_Data.Text = string.Format("焊工信息,({0}):", this.dataGridView_Data.RowCount); if (this.dataGridView_Data.RowCount == 0) { EventArgs_WelderBelong my_e = new EventArgs_WelderBelong(""); Publisher_WelderBelong.OnEventName(my_e); } }
/// <summary> /// 初始化数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void InitDataGridView(object sender, EventArgs_Unit e) { if (e == null) { return; } this.myEventArgs_Unit = e; Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.WelderBelongExam.ToString(), false); Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.WelderBelongQC.ToString()]; string str_Filter; string str_FilterShipClassification; if (string.IsNullOrEmpty(this.myEventArgs_Unit.WorkPlaceHPID)) { if (string.IsNullOrEmpty(this.myEventArgs_Unit.DepartmentHPID)) { if (string.IsNullOrEmpty(this.myEventArgs_Unit.EmployerHPID)) { if (string.IsNullOrEmpty(this.myEventArgs_Unit.EmployerGroup)) { str_Filter = string.Format("1=1"); } else { str_Filter = string.Format("WelderBelongEmployerGroup='{0}'", this.myEventArgs_Unit.EmployerGroup); } } else { str_Filter = string.Format("WelderBelongEmployerHPID='{0}'", this.myEventArgs_Unit.EmployerHPID); } } else { str_Filter = string.Format("WelderBelongDepartmentHPID='{0}'", this.myEventArgs_Unit.DepartmentHPID); } } else { str_Filter = string.Format("WelderBelongWorkPlaceHPID='{0}'", this.myEventArgs_Unit.WorkPlaceHPID); } //str_Filter += string .Format (" And isQCValid =1");//已在数据库视图中设置 if (string.IsNullOrEmpty(this.str_ShipClassificationAb)) { str_FilterShipClassification = "1=1"; } else { str_FilterShipClassification = string.Format("ShipClassificationAb = '{0}'", this.str_ShipClassificationAb); if (string.IsNullOrEmpty(this.str_ShipboardNo)) { } else { str_FilterShipClassification += string.Format(" And ShipboardNo = '{0}'", this.str_ShipboardNo); } } DateTime myDataTime_Begin; switch (this.str_KindofQC) { case "全部证书": str_FilterShipClassification += string.Format(" And isQCValid=1 And ValidUntil>=#{0}#", DateTime.Now); break; case "签证证书": string str_FilterSupervision; str_FilterSupervision = string.Format("(IssuedOnMonth - SupervisionCycle*48 - {0})%6=0 and (IssuedOnMonth - {0}>0) And (not (ProlongQCContinuous=0 and PeriodofProlongation>0 and ValidUntil<#{1}#))", Class_ExamField.SupervisionOffset, DateTime.Today.AddMonths(3)); str_FilterShipClassification += string.Format(" And isQCValid=1 And ValidUntil>=#{0}# And ({1})", DateTime.Now.Date.AddDays(0 - DateTime.Now.Day).AddMonths(0 - Class_ExamField.SupervisionOffset), str_FilterSupervision); break; case "延期证书": myDataTime_Begin = DateTime.Now.Date.AddDays(1 - DateTime.Now.Day).AddMonths(0 - Class_ExamField.SupervisionOffset); str_FilterShipClassification += string.Format(" And isQCValid=1 And (ProlongQCContinuous=1 or (ProlongQCContinuous=0 and PeriodofProlongation=0)) And ValidUntil>=#{0}# And ValidUntil<#{1}#", myDataTime_Begin.AddDays(-1), myDataTime_Begin.AddMonths(1).AddDays(-1)); break; case "复训证书": myDataTime_Begin = DateTime.Now.Date.AddDays(1 - DateTime.Now.Day).AddMonths(0 - Class_ExamField.QCRegain); str_FilterShipClassification += string.Format(" And isQCValid=1 And ProlongQCContinuous=0 and PeriodofProlongation>0 And ValidUntil>=#{0}# And ValidUntil<#{1}#", myDataTime_Begin, myDataTime_Begin.AddMonths(1)); break; case "失效证书": str_FilterShipClassification += string.Format(" And ((ValidUntil>=#{0}# And ValidUntil<#{1}#) Or (isQCValid = 0 and ValidUntil>#{1}#))", DateTime.Now.AddMonths(-12), DateTime.Now); break; } str_Filter = string.Format("({0}) And ({1})", str_Filter, str_FilterShipClassification); if (bool_Refresh) { myClass_Data.SetFilter(str_Filter); if (this.myEventArgs_Unit.bool_JustFill) { if (this.myDataTable.Rows.Count == 0) { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_Unit.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; } else { myClass_Data.RefreshData(this.myEventArgs_Unit.bool_JustFill, this.myDataTable); } } else { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_Unit.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; } } else { if (this.myDataTable == null) { myClass_Data.SetFilter("1=1"); this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_Unit.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; } ((DataView)this.dataGridView_Data.DataSource).RowFilter = str_Filter; } if (string.IsNullOrEmpty(((DataView)this.dataGridView_Data.DataSource).Sort)) { ((DataView)this.dataGridView_Data.DataSource).Sort = myClass_Data.myDataView.Sort; } this.label_Data.Text = string.Format("焊工证书,({0}):", this.dataGridView_Data.RowCount); this.toolStripStatusLabel_ShipClassificationAb.Text = string.Format("船级社:{0}", this.str_ShipClassificationAb); this.toolStripStatusLabel_ShipboardNo.Text = string.Format("船舶系列:{0}", this.str_ShipboardNo); this.toolStripStatusLabel_KindofQC.Text = this.str_KindofQC; }
private void UserControl_GasAndWeldingFluxBase_Load(object sender, EventArgs e) { Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTableSecond.GasAndWeldingFluxGroup.ToString()]; Class_DataControlBind.InitializeComboBox(this.comboBox_GasAndWeldingFluxGroup, myClass_Data.myDataView, "GasAndWeldingFluxGroup", "GasAndWeldingFluxGroup"); }
private void InitDataGridView(object sender, EventArgs_WPS e) { Class_DataControlBind.InitializeDataGridView(this.dataGridView_WPSWeldingSequence, Enum_DataTableSecond.WPSWeldingSequence.ToString(), false); Class_DataControlBind.InitializeDataGridView(this.dataGridView_WPSWeldingLayer, Enum_DataTableSecond.WPSWeldingLayer.ToString(), false); this.myEventArgs_WPS = e; Class_Data myClass_Data_WPSWeldingSequence = (Class_Data)Class_Public.myHashtable[Enum_DataTableSecond.WPSWeldingSequence.ToString()]; Class_Data myClass_Data_WPSWeldingLayer = (Class_Data)Class_Public.myHashtable[Enum_DataTableSecond.WPSWeldingLayer.ToString()]; myClass_Data_WPSWeldingSequence.SetFilter(string.Format("WPSID='{0}'", this.myEventArgs_WPS.str_WPSID)); myClass_Data_WPSWeldingLayer.SetFilter(string.Format("WPSID='{0}'", this.myEventArgs_WPS.str_WPSID)); if (this.myEventArgs_WPS.bool_JustFill) { if (this.myDataTable_WPSWeldingSequence.Rows.Count == 0) { this.dataGridView_WPSWeldingSequence.DataSource = null; myClass_Data_WPSWeldingSequence.RefreshData(this.myEventArgs_WPS.bool_JustFill); this.myDataTable_WPSWeldingSequence = myClass_Data_WPSWeldingSequence.myDataTable.Copy(); this.myDataView_WPSWeldingSequence = new DataView(this.myDataTable_WPSWeldingSequence); this.dataGridView_WPSWeldingSequence.DataSource = this.myDataView_WPSWeldingSequence; } else { myClass_Data_WPSWeldingSequence.RefreshData(this.myEventArgs_WPS.bool_JustFill, this.myDataTable_WPSWeldingSequence); } } else { this.dataGridView_WPSWeldingSequence.DataSource = null; myClass_Data_WPSWeldingSequence.RefreshData(this.myEventArgs_WPS.bool_JustFill); this.myDataTable_WPSWeldingSequence = myClass_Data_WPSWeldingSequence.myDataTable.Copy(); this.myDataView_WPSWeldingSequence = new DataView(this.myDataTable_WPSWeldingSequence); this.dataGridView_WPSWeldingSequence.DataSource = this.myDataView_WPSWeldingSequence; } if (string.IsNullOrEmpty(((DataView)this.dataGridView_WPSWeldingSequence.DataSource).Sort)) { ((DataView)this.dataGridView_WPSWeldingSequence.DataSource).Sort = myClass_Data_WPSWeldingSequence.myDataView.Sort; } if (this.myEventArgs_WPS.bool_JustFill) { if (this.myDataTable_WPSWeldingLayer.Rows.Count == 0) { this.dataGridView_WPSWeldingLayer.DataSource = null; myClass_Data_WPSWeldingLayer.RefreshData(this.myEventArgs_WPS.bool_JustFill); this.myDataTable_WPSWeldingLayer = myClass_Data_WPSWeldingLayer.myDataTable.Copy(); this.myDataView_WPSWeldingLayer = new DataView(this.myDataTable_WPSWeldingLayer); this.dataGridView_WPSWeldingLayer.DataSource = this.myDataView_WPSWeldingLayer; } else { myClass_Data_WPSWeldingLayer.RefreshData(this.myEventArgs_WPS.bool_JustFill, this.myDataTable_WPSWeldingLayer); } } else { this.dataGridView_WPSWeldingLayer.DataSource = null; myClass_Data_WPSWeldingLayer.RefreshData(this.myEventArgs_WPS.bool_JustFill); this.myDataTable_WPSWeldingLayer = myClass_Data_WPSWeldingLayer.myDataTable.Copy(); this.myDataView_WPSWeldingLayer = new DataView(this.myDataTable_WPSWeldingLayer); this.dataGridView_WPSWeldingLayer.DataSource = this.myDataView_WPSWeldingLayer; } if (string.IsNullOrEmpty(((DataView)this.dataGridView_WPSWeldingLayer.DataSource).Sort)) { ((DataView)this.dataGridView_WPSWeldingLayer.DataSource).Sort = myClass_Data_WPSWeldingLayer.myDataView.Sort; } this.label_WPSSequence.Text = string.Format("焊接工艺道次类别:({0})", this.dataGridView_WPSWeldingSequence.RowCount); this.label_WPSLayer.Text = string.Format("焊接层次分布:({0})", this.dataGridView_WPSWeldingLayer.RowCount); }
/// <summary> /// 初始化数据 /// </summary> /// <param name="myClass_KindofEmployerWelder"></param> /// <param name="bool_Add"></param> public void InitControl(Class_KindofEmployerWelder myClass_KindofEmployerWelder, bool bool_Add) { Class_Data myClass_Data; myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.Employer.ToString()]; this.myDataView_Employer = new DataView(myClass_Data.myDataTable); this.myDataView_Employer.Sort = myClass_Data.myDataView.Sort; myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.Department.ToString()]; this.myDataView_Department = new DataView(myClass_Data.myDataTable); this.myDataView_Department.Sort = myClass_Data.myDataView.Sort; myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.WorkPlace.ToString()]; this.myDataView_WorkPlace = new DataView(myClass_Data.myDataTable); this.myDataView_WorkPlace.Sort = myClass_Data.myDataView.Sort; myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.LaborServiceTeam.ToString()]; this.myDataView_LaborServiceTeam = new DataView(myClass_Data.myDataTable); this.myDataView_LaborServiceTeam.Sort = myClass_Data.myDataView.Sort; Class_DataControlBind.InitializeComboBox(this.ComboBox_LaborServiceTeam, this.myDataView_LaborServiceTeam, "LaborServiceTeamHPID", "LaborServiceTeam"); Class_DataControlBind.InitializeComboBox(this.ComboBox_WorkPlace, this.myDataView_WorkPlace, "WorkPlaceHPID", "WorkPlace"); Class_DataControlBind.InitializeComboBox(this.ComboBox_Department, this.myDataView_Department, "DepartmentHPID", "Department"); Class_DataControlBind.InitializeComboBox(this.ComboBox_Employer, this.myDataView_Employer, "EmployerHPID", "Employer"); Class_Public.InitializeComboBox(this.ComboBox_Schooling, Enum_DataTable.Schooling.ToString(), "Schooling", "Schooling"); this.myClass_KindofEmployerWelder = myClass_KindofEmployerWelder; this.textBox_KindofEmployer.Text = this.myClass_KindofEmployerWelder.KindofEmployer; Class_KindofEmployer myClass_KindofEmployer = new Class_KindofEmployer(this.myClass_KindofEmployerWelder.KindofEmployer); switch (myClass_KindofEmployer.KindofEmployerLevel) { case 0: break; case 1: this.ComboBox_Employer.Enabled = false; break; case 2: this.ComboBox_Employer.Enabled = false; this.ComboBox_Department.Enabled = false; this.CheckBox_Department.Enabled = false; break; case 3: this.ComboBox_Employer.Enabled = false; this.ComboBox_Department.Enabled = false; this.CheckBox_Department.Enabled = false; this.ComboBox_WorkPlace.Enabled = false; this.CheckBox_WorkPlace.Enabled = false; break; case 4: this.ComboBox_Employer.Enabled = false; this.ComboBox_LaborServiceTeam.Enabled = false; this.CheckBox_LaborServiceTeam.Enabled = false; break; } if (bool_Add) { if (!string.IsNullOrEmpty(myClass_KindofEmployer.KindofEmployerEmployerHPID)) { this.ComboBox_Employer.SelectedValue = myClass_KindofEmployer.KindofEmployerEmployerHPID; if (!string.IsNullOrEmpty(myClass_KindofEmployer.KindofEmployerDepartmentHPID)) { this.ComboBox_Department.SelectedValue = myClass_KindofEmployer.KindofEmployerDepartmentHPID; if (!string.IsNullOrEmpty(myClass_KindofEmployer.KindofEmployerWorkPlaceHPID)) { this.ComboBox_WorkPlace.SelectedValue = myClass_KindofEmployer.KindofEmployerWorkPlaceHPID; } } if (!string.IsNullOrEmpty(myClass_KindofEmployer.KindofEmployerLaborServiceTeamHPID)) { this.ComboBox_LaborServiceTeam.SelectedValue = myClass_KindofEmployer.KindofEmployerLaborServiceTeamHPID; } } if (myClass_KindofEmployerWelderDefault != null) { this.CheckBox_Sex.Checked = myClass_KindofEmployerWelderDefault.Sex == "男"; this.DateTimePicker_WeldingBeinning.Value = myClass_KindofEmployerWelderDefault.WeldingBeginning; this.ComboBox_Schooling.SelectedValue = myClass_KindofEmployerWelderDefault.Schooling; this.ComboBox_Employer.SelectedValue = myClass_KindofEmployerWelderDefault.myClass_BelongUnit.EmployerHPID; this.myDataView_Department.RowFilter = string.Format("EmployerHPID='{0}'", myClass_KindofEmployerWelderDefault.myClass_BelongUnit.EmployerHPID); this.myDataView_LaborServiceTeam.RowFilter = string.Format("EmployerHPID='{0}'", myClass_KindofEmployerWelderDefault.myClass_BelongUnit.EmployerHPID); if (string.IsNullOrEmpty(myClass_KindofEmployerWelderDefault.myClass_BelongUnit.DepartmentHPID)) { this.CheckBox_Department.Checked = false; } else { this.ComboBox_Department.SelectedValue = myClass_KindofEmployerWelderDefault.myClass_BelongUnit.DepartmentHPID; this.CheckBox_Department.Checked = true; this.myDataView_WorkPlace.RowFilter = string.Format("DepartmentHPID='{0}'", myClass_KindofEmployerWelderDefault.myClass_BelongUnit.DepartmentHPID); if (!string.IsNullOrEmpty(myClass_KindofEmployerWelderDefault.myClass_BelongUnit.WorkPlaceHPID)) { this.ComboBox_WorkPlace.SelectedValue = myClass_KindofEmployerWelderDefault.myClass_BelongUnit.WorkPlaceHPID; this.CheckBox_WorkPlace.Checked = true; } else { this.CheckBox_WorkPlace.Checked = false; } } if (string.IsNullOrEmpty(myClass_KindofEmployerWelderDefault.myClass_BelongUnit.LaborServiceTeamHPID)) { this.CheckBox_LaborServiceTeam.Checked = false; } else { this.ComboBox_LaborServiceTeam.SelectedValue = myClass_KindofEmployerWelderDefault.myClass_BelongUnit.LaborServiceTeamHPID; this.CheckBox_LaborServiceTeam.Checked = true; } } } else { this.textBox_KindofEmployerWelderID.Text = this.myClass_KindofEmployerWelder.KindofEmployerWelderID.ToString(); this.Button_IdentificationCardConvert.Enabled = false; this.MaskedTextBox_IdentificationCard.Text = myClass_KindofEmployerWelder.IdentificationCard; this.TextBox_WelderName.Text = myClass_KindofEmployerWelder.WelderName; this.textBox_WelderEnglishName.Text = myClass_KindofEmployerWelder.WelderEnglishName; this.CheckBox_Sex.Checked = myClass_KindofEmployerWelder.Sex == "男"; this.DateTimePicker_WeldingBeinning.Value = myClass_KindofEmployerWelder.WeldingBeginning; this.TextBox_WorkerID.Text = myClass_KindofEmployerWelder.myClass_BelongUnit.WorkerID; this.TextBox_WelderRemark.Text = myClass_KindofEmployerWelder.WelderRemark; this.ComboBox_Schooling.SelectedValue = myClass_KindofEmployerWelder.Schooling; this.ComboBox_Employer.SelectedValue = myClass_KindofEmployerWelder.myClass_BelongUnit.EmployerHPID; this.myDataView_Department.RowFilter = string.Format("EmployerHPID='{0}'", myClass_KindofEmployerWelder.myClass_BelongUnit.EmployerHPID); this.myDataView_LaborServiceTeam.RowFilter = string.Format("EmployerHPID='{0}'", myClass_KindofEmployerWelder.myClass_BelongUnit.EmployerHPID); if (string.IsNullOrEmpty(myClass_KindofEmployerWelder.myClass_BelongUnit.DepartmentHPID)) { this.CheckBox_Department.Checked = false; } else { this.ComboBox_Department.SelectedValue = myClass_KindofEmployerWelder.myClass_BelongUnit.DepartmentHPID; this.CheckBox_Department.Checked = true; this.myDataView_WorkPlace.RowFilter = string.Format("DepartmentHPID='{0}'", myClass_KindofEmployerWelder.myClass_BelongUnit.DepartmentHPID); if (!string.IsNullOrEmpty(myClass_KindofEmployerWelder.myClass_BelongUnit.WorkPlaceHPID)) { this.ComboBox_WorkPlace.SelectedValue = myClass_KindofEmployerWelder.myClass_BelongUnit.WorkPlaceHPID; this.CheckBox_WorkPlace.Checked = true; } else { this.CheckBox_WorkPlace.Checked = false; } } if (string.IsNullOrEmpty(myClass_KindofEmployerWelder.myClass_BelongUnit.LaborServiceTeamHPID)) { this.CheckBox_LaborServiceTeam.Checked = false; } else { this.ComboBox_LaborServiceTeam.SelectedValue = myClass_KindofEmployerWelder.myClass_BelongUnit.LaborServiceTeamHPID; this.CheckBox_LaborServiceTeam.Checked = true; } } }
private void toolStripMenuItem_DataGridViewRowExportToExcel_Click(object sender, EventArgs e) { Class_DataControlBind.DataGridViewExportExcel(this.dataGridView_Data, true, false); }
private void Form_Welder_Query_Load(object sender, EventArgs e) { Class_DataControlBind.InitializeDataGridView(this.dataGridView_Query, Enum_DataTable.Welder.ToString(), this.bool_QueryBatch); this.dataGridView_Query.ReadOnly = !bool_QueryBatch; this.checkBox_CheckAll.Visible = bool_QueryBatch; }
/// <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; } }
private void toolStripMenuItem_WPSSequenceRowExportExcel_Click(object sender, EventArgs e) { Class_DataControlBind.DataGridViewExportExcel(this.dataGridView_WPSWeldingSequence, true, true); }
private void toolStripMenuItem_SubjectResultRowExportToExcel_Click(object sender, EventArgs e) { Class_DataControlBind.DataGridViewExportExcel(this.dataGridView_SubjectPositionResult, true, true); }
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="sender"></param> /// <param name="e"></param> private void InitDataGridView(object sender, EventArgs_ShipClassification e) { this.myEventArgs_ShipClassification = e; string str_Filter; if (!string.IsNullOrEmpty(this.myEventArgs_ShipClassification.str_ShipClassificationAb)) { str_Filter = string.Format("ShipClassificationAb='{0}'", this.myEventArgs_ShipClassification.str_ShipClassificationAb); if (!string.IsNullOrEmpty(this.myEventArgs_ShipClassification.str_ShipboardNo)) { str_Filter += string.Format(" And ShipboardNo='{0}'", this.myEventArgs_ShipClassification.str_ShipboardNo); //if (this.myEventArgs_ShipClassification.bool_GXTheory) //{ // Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.GXTheoryIssue.ToString()); // myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.GXTheoryIssue.ToString()]; //} } else if (!string.IsNullOrEmpty(this.myEventArgs_ShipClassification.str_Year)) { str_Filter += string.Format(" And (SignUpDate >= '{0}-1-1' and SignUpDate<='{0}-12-31 23:59:59.997')", this.myEventArgs_ShipClassification.str_Year); } } else { str_Filter = this.myEventArgs_ShipClassification.str_Filter; } Class_Data myClass_Data; if (this.myEventArgs_ShipClassification.bool_GXTheory) { Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.GXTheoryIssue.ToString(), false); myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.GXTheoryIssue.ToString()]; } else { Class_DataControlBind.InitializeDataGridView(this.dataGridView_Data, Enum_DataTable.Issue.ToString(), false); myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.Issue.ToString()]; } if (Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("焊工权限"), Enum_zwjKindofUpdate.Read)) { } else if (Class_CustomUser.GetSecurity(Class_zwjPublic.myClass_CustomUser.UserGUID, Class_CustomSecurity.GetSecurityGUID("报考权限"), Enum_zwjKindofUpdate.Read)) { Class_Data myClass_Data_KindofEmployer = (Class_Data)Class_Public.myHashtable[Enum_DataTable.KindofEmployer.ToString()]; string str_Filter_KindofEmployer = "(1=0"; foreach (DataRowView myDataRowView_KindofEmployer in myClass_Data_KindofEmployer.myDataView) { Class_KindofEmployer myClass_KindofEmployer = new Class_KindofEmployer(myDataRowView_KindofEmployer["KindofEmployer"].ToString()); if (myClass_KindofEmployer.KindofEmployerManagerID.Equals(Class_zwjPublic.myClass_CustomUser.UserGUID)) { str_Filter_KindofEmployer += string.Format(" or KindofEmployer='{0}'", myClass_KindofEmployer.KindofEmployer); } } str_Filter_KindofEmployer += ")"; str_Filter = str_Filter_KindofEmployer + " and (" + str_Filter + ")"; } myClass_Data.SetFilter(str_Filter); if (this.myEventArgs_ShipClassification.bool_JustFill) { if (this.myDataTable.Rows.Count == 0) { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_ShipClassification.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; if (this.dataGridView_Data.Rows.Count > 0) { this.dataGridView_Data.CurrentCell = this.dataGridView_Data.Rows[this.dataGridView_Data.Rows.Count - 1].Cells["IssueNo"]; } } else { myClass_Data.RefreshData(this.myEventArgs_ShipClassification.bool_JustFill, this.myDataTable); } } else { this.dataGridView_Data.DataSource = null; myClass_Data.RefreshData(this.myEventArgs_ShipClassification.bool_JustFill); this.myDataTable = myClass_Data.myDataTable.Copy(); this.myDataView = new DataView(this.myDataTable); this.dataGridView_Data.DataSource = this.myDataView; if (this.dataGridView_Data.Rows.Count > 0) { this.dataGridView_Data.CurrentCell = this.dataGridView_Data.Rows[this.dataGridView_Data.Rows.Count - 1].Cells["IssueNo"]; } } if (string.IsNullOrEmpty(((DataView)this.dataGridView_Data.DataSource).Sort)) { ((DataView)this.dataGridView_Data.DataSource).Sort = myClass_Data.myDataView.Sort; } this.label_Data.Text = string.Format("班级,({0}):", this.dataGridView_Data.RowCount); if (this.dataGridView_Data.RowCount == 0) { EventArgs_Issue my_e = new EventArgs_Issue(null, this.myEventArgs_ShipClassification.bool_GXTheory); Publisher_Issue.OnEventName(my_e); } }
private void toolStripMenuItem_DataGridViewRowExportToExcel_Click(object sender, EventArgs e) { Class_DataControlBind.DataGridViewExportExcel(this.dataGridView_WPSGasAndWeldingFlux, true, true); }
/// <summary> /// 初始化数据 /// </summary> /// <param name="myKindofEmployer"></param> /// <param name="bool_Add"></param> public void InitControl(Class_KindofEmployer myClass_KindofEmployer, bool bool_Add) { Class_Data myClass_Data; myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.Employer.ToString()]; this.myDataView_Employer = new DataView(myClass_Data.myDataTable); this.myDataView_Employer.Sort = myClass_Data.myDataView.Sort; myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.Department.ToString()]; this.myDataView_Department = new DataView(myClass_Data.myDataTable); this.myDataView_Department.Sort = myClass_Data.myDataView.Sort; myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.WorkPlace.ToString()]; this.myDataView_WorkPlace = new DataView(myClass_Data.myDataTable); this.myDataView_WorkPlace.Sort = myClass_Data.myDataView.Sort; myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.LaborServiceTeam.ToString()]; this.myDataView_LaborServiceTeam = new DataView(myClass_Data.myDataTable); this.myDataView_LaborServiceTeam.Sort = myClass_Data.myDataView.Sort; Class_DataControlBind.InitializeComboBox(this.ComboBox_LaborServiceTeam, this.myDataView_LaborServiceTeam, "LaborServiceTeamHPID", "LaborServiceTeam"); Class_DataControlBind.InitializeComboBox(this.ComboBox_WorkPlace, this.myDataView_WorkPlace, "WorkPlaceHPID", "WorkPlace"); Class_DataControlBind.InitializeComboBox(this.ComboBox_Department, this.myDataView_Department, "DepartmentHPID", "Department"); Class_DataControlBind.InitializeComboBox(this.ComboBox_Employer, this.myDataView_Employer, "EmployerHPID", "Employer"); this.myClass_KindofEmployer = myClass_KindofEmployer; if (bool_Add) { if (myClass_KindofEmployerDefault != null) { this.TextBox_KindofEmployer.Text = myClass_KindofEmployerDefault.KindofEmployer; } } else { this.TextBox_KindofEmployer.ReadOnly = true; this.TextBox_KindofEmployer.Text = myClass_KindofEmployer.KindofEmployer; Class_CustomUser myClass_CustomUser = new Class_CustomUser(); myClass_CustomUser.UserGUID = this.myClass_KindofEmployer.KindofEmployerManagerID; if (myClass_CustomUser.FillData()) { this.textBox_KindofEmployerManager.Text = string.Format("{0}:{1}", myClass_CustomUser.Name, myClass_CustomUser.UserGUID.ToString()); } if (myClass_KindofEmployer.KindofEmployerLevel >= this.NumericUpDown_KindofEmployerLevel.Minimum && myClass_KindofEmployer.KindofEmployerLevel <= this.NumericUpDown_KindofEmployerLevel.Maximum) { this.NumericUpDown_KindofEmployerLevel.Value = myClass_KindofEmployer.KindofEmployerLevel; } this.ComboBox_Employer.SelectedValue = myClass_KindofEmployer.KindofEmployerEmployerHPID; this.myDataView_Department.RowFilter = string.Format("EmployerHPID='{0}'", myClass_KindofEmployer.KindofEmployerEmployerHPID); this.myDataView_LaborServiceTeam.RowFilter = string.Format("EmployerHPID='{0}'", myClass_KindofEmployer.KindofEmployerEmployerHPID); if (string.IsNullOrEmpty(myClass_KindofEmployer.KindofEmployerDepartmentHPID)) { this.CheckBox_Department.Checked = false; this.CheckBox_WorkPlace.Checked = false; } else { this.ComboBox_Department.SelectedValue = myClass_KindofEmployer.KindofEmployerDepartmentHPID; this.CheckBox_Department.Checked = true; this.myDataView_WorkPlace.RowFilter = string.Format("DepartmentHPID='{0}'", myClass_KindofEmployer.KindofEmployerDepartmentHPID); if (!string.IsNullOrEmpty(myClass_KindofEmployer.KindofEmployerWorkPlaceHPID)) { this.ComboBox_WorkPlace.SelectedValue = myClass_KindofEmployer.KindofEmployerWorkPlaceHPID; this.CheckBox_WorkPlace.Checked = true; } else { this.CheckBox_WorkPlace.Checked = false; } } if (string.IsNullOrEmpty(myClass_KindofEmployer.KindofEmployerLaborServiceTeamHPID)) { this.CheckBox_LaborServiceTeam.Checked = false; } else { this.ComboBox_LaborServiceTeam.SelectedValue = myClass_KindofEmployer.KindofEmployerLaborServiceTeamHPID; this.CheckBox_LaborServiceTeam.Checked = true; } this.checkBox_CanUpLoadWelderPicture.Checked = myClass_KindofEmployer.CanUpLoadWelderPicture; this.checkBox_CanModifyWelderPicture.Checked = myClass_KindofEmployer.CanModifyWelderPicture; this.checkBox_CanDeleteWelderPicture.Checked = myClass_KindofEmployer.CanDeleteWelderPicture; this.numericUpDown_KindofEmployerIndex.Value = this.myClass_KindofEmployer.KindofEmployerIndex; this.TextBox_KindofEmployerRemark.Text = myClass_KindofEmployer.KindofEmployerRemark; this.textBox_EmployerTel.Text = myClass_KindofEmployer.KindofEmployerTel; this.textBox_EmployerFax.Text = myClass_KindofEmployer.KindofEmployerFax; this.textBox_EmployerMobile.Text = myClass_KindofEmployer.KindofEmployerMobile; this.textBox_EmployerEmail.Text = myClass_KindofEmployer.KindofEmployerEmail; } }
private void toolStripMenuItem_RowExportWelderPictureExcel_Click(object sender, EventArgs e) { Class_DataControlBind.ExportExcelFromDataTable(Class_Welder.DetectWelderPictureisValid(this.myDataView.ToTable()), true, false); }
private void toolStripMenuItem_WPSSequenceRowFrozenThisColumn_CheckedChanged(object sender, EventArgs e) { Class_DataControlBind.DataGridViewFrozenColumn((ToolStripMenuItem)sender, this.dataGridView_WPSWeldingSequence); }
private void InitDataGridView() { string str_Unit; string str_WelderBelongFilter; Class_Employer myClass_Employer; Class_Department myClass_Department; Class_WorkPlace myClass_WorkPlace; switch (this.myClass_KindofEmployer.KindofEmployerLevel) { case 1: myClass_Employer = new Class_Employer(this.myClass_KindofEmployer.KindofEmployerEmployerHPID); str_Unit = myClass_Employer.Employer; str_WelderBelongFilter = string.Format("WelderBelongEmployerHPID='{0}'", myClass_Employer.EmployerHPID); break; case 2: myClass_Department = new Class_Department(this.myClass_KindofEmployer.KindofEmployerDepartmentHPID); myClass_Employer = new Class_Employer(myClass_Department.EmployerHPID); str_Unit = string.Format("{0} , {1}", myClass_Employer.Employer, myClass_Department.Department); str_WelderBelongFilter = string.Format("WelderBelongDepartmentHPID='{0}'", myClass_Department.DepartmentHPID); break; case 3: myClass_WorkPlace = new Class_WorkPlace(this.myClass_KindofEmployer.KindofEmployerWorkPlaceHPID); myClass_Department = new Class_Department(myClass_WorkPlace.DepartmentHPID); myClass_Employer = new Class_Employer(myClass_Department.EmployerHPID); str_Unit = string.Format("{0} , {1} , {2}", myClass_Employer.Employer, myClass_Department.Department, myClass_WorkPlace.WorkPlace); str_WelderBelongFilter = string.Format("WelderBelongWorkPlaceHPID='{0}'", myClass_WorkPlace.WorkPlaceHPID); break; default: return; } Class_DataControlBind.InitializeDataGridView(this.dataGridView_WelderBelong, Enum_DataTable.WelderBelong.ToString(), false); Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.WelderBelong.ToString()]; myClass_Data.SetFilter(str_WelderBelongFilter); myClass_Data.RefreshData(false); this.myDataTable_WelderBelong = myClass_Data.myDataTable.Copy(); this.dataGridView_WelderBelong.DataSource = new DataView(this.myDataTable_WelderBelong); ((DataView)this.dataGridView_WelderBelong.DataSource).Sort = myClass_Data.myDataView.Sort; this.label_WelderBelong.Text = string.Format("本系统: {0},({1})", str_Unit, this.dataGridView_WelderBelong.RowCount); Class_DataControlBind.InitializeDataGridView(this.dataGridView_KindofEmployerWelder, Enum_DataTable.KindofEmployerWelder.ToString(), false); myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.KindofEmployerWelder.ToString()]; myClass_Data.SetFilter(string.Format("KindofEmployer='{0}'", this.myClass_KindofEmployer.KindofEmployer)); myClass_Data.RefreshData(false); this.myDataTable_KindofEmployerWelder = myClass_Data.myDataTable.Copy(); this.dataGridView_KindofEmployerWelder.DataSource = new DataView(this.myDataTable_KindofEmployerWelder); ((DataView)this.dataGridView_KindofEmployerWelder.DataSource).Sort = myClass_Data.myDataView.Sort; this.label_KindofEmployerWelder.Text = string.Format("报考单位: {0},({1})", this.myClass_KindofEmployer.KindofEmployer, this.dataGridView_KindofEmployerWelder.RowCount); if (this.comboBox_KindofSynchronization.SelectedIndex == 0) { this.label_KindofSynchronization.Text = string.Format("同步数据类型:{0} -> {1}", this.myClass_KindofEmployer.KindofEmployer, str_Unit); Class_DataControlBind.InitializeDataGridView(this.dataGridView_Add, Enum_DataTable.KindofEmployerWelder.ToString(), false); Class_DataControlBind.InitializeDataGridView(this.dataGridView_Modify, Enum_DataTable.KindofEmployerWelder.ToString(), false); Class_DataControlBind.InitializeDataGridView(this.dataGridView_Delete, Enum_DataTable.WelderBelong.ToString(), false); this.myDataTable_Add = myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Add, true, false); this.myDataTable_Modify = myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Modify, true, false); this.myDataTable_Delete = myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Delete, true, false); } else { this.label_KindofSynchronization.Text = string.Format("同步数据类型:{1} -> {0}", this.myClass_KindofEmployer.KindofEmployer, str_Unit); Class_DataControlBind.InitializeDataGridView(this.dataGridView_Add, Enum_DataTable.WelderBelong.ToString(), false); Class_DataControlBind.InitializeDataGridView(this.dataGridView_Modify, Enum_DataTable.WelderBelong.ToString(), false); Class_DataControlBind.InitializeDataGridView(this.dataGridView_Delete, Enum_DataTable.KindofEmployerWelder.ToString(), false); this.myDataTable_Add = myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Add, false, false); this.myDataTable_Modify = myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Modify, false, false); this.myDataTable_Delete = myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Delete, false, false); } this.dataGridView_Add.DataSource = new DataView(this.myDataTable_Add); this.label_Add.Text = string.Format("添加后的数据,({0}):", this.dataGridView_Add.RowCount); this.dataGridView_Modify.DataSource = new DataView(this.myDataTable_Modify); this.label_Modify.Text = string.Format("修改后的数据,({0}):", this.dataGridView_Modify.RowCount); this.dataGridView_Delete.DataSource = new DataView(this.myDataTable_Delete); this.label_Delete.Text = string.Format("删除前的数据,({0}):", this.dataGridView_Delete.RowCount); }
private void toolStripMenuItem_DataGridViewRowFrozenThisColumn_Click(object sender, EventArgs e) { Class_DataControlBind.DataGridViewFrozenColumn((ToolStripMenuItem)sender, this.dataGridView_WPSWeldingLayer); }
/// <summary> /// 冻结或解冻任意数据列 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowFrozenThisColumn_CheckStateChanged(object sender, EventArgs e) { Class_DataControlBind.DataGridViewFrozenColumn((ToolStripMenuItem)sender, this.dataGridView_Data); }
/// <summary> /// 初始化数据 /// </summary> /// <param name="myClass_ShipClassification"></param> /// <param name="bool_Add"></param> public void InitControl(Class_ShipClassification myClass_ShipClassification, bool bool_Add) { Class_Public.InitializeComboBox(this.ComboBox_TestCommitteeID, Enum_DataTable.TestCommittee.ToString(), "TestCommitteeID", "TestCommitteeID"); Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.WeldingStandardAndGroup.ToString()]; DataView myDataView_WeldingStandardAndGroup = new DataView(myClass_Data.myDataTable); myDataView_WeldingStandardAndGroup.RowFilter = "WeldingStandardGroup='焊工考试标准'"; Class_DataControlBind.InitializeComboBox(this.ComboBox_WeldingStandard, myDataView_WeldingStandardAndGroup, "WeldingStandard", "WeldingStandard"); this.myClass_ShipClassification = myClass_ShipClassification; if (bool_Add) { if (myClass_ShipClassificationDefault != null) { this.CheckBox_WeldingStandardRestrict.Checked = myClass_ShipClassificationDefault.WeldingStandardRestrict; this.checkBox_YearSeparate.Checked = myClass_ShipClassificationDefault.YearSeparate; this.CheckBox_ShipRestrict.Checked = myClass_ShipClassificationDefault.ShipRestrict; this.CheckBox_TheorySeparate.Checked = myClass_ShipClassificationDefault.TheorySeparate; this.checkBox_ProlongQCContinuous.Checked = myClass_ShipClassificationDefault.ProlongQCContinuous; this.ComboBox_WeldingStandard.SelectedValue = myClass_ShipClassificationDefault.WeldingStandard; this.MaskedTextBox_NextIssueNo.Text = myClass_ShipClassificationDefault.NextIssueNo; this.MaskedTextBox_NextExaminingNo.Text = myClass_ShipClassificationDefault.NextExaminingNo; this.MaskedTextBox_NextCertificateNo.Text = myClass_ShipClassificationDefault.NextCertificateNo; if (myClass_ShipClassificationDefault.IssueNoSignificantDigit >= this.NumericUpDown_IssueNoSignificantDigit.Minimum && myClass_ShipClassificationDefault.IssueNoSignificantDigit <= this.NumericUpDown_IssueNoSignificantDigit.Maximum) { this.NumericUpDown_IssueNoSignificantDigit.Value = myClass_ShipClassificationDefault.IssueNoSignificantDigit; } if (myClass_ShipClassificationDefault.ExaminingNoSignificantDigit >= this.NumericUpDown_ExaminingNoSignificantDigit.Minimum && myClass_ShipClassificationDefault.ExaminingNoSignificantDigit <= this.NumericUpDown_ExaminingNoSignificantDigit.Maximum) { this.NumericUpDown_ExaminingNoSignificantDigit.Value = myClass_ShipClassificationDefault.ExaminingNoSignificantDigit; } if (myClass_ShipClassificationDefault.CertificateNoSignificantDigit >= this.NumericUpDown_CertificateNoSignificantDigit.Minimum && myClass_ShipClassificationDefault.CertificateNoSignificantDigit <= this.NumericUpDown_CertificateNoSignificantDigit.Maximum) { this.NumericUpDown_CertificateNoSignificantDigit.Value = myClass_ShipClassificationDefault.CertificateNoSignificantDigit; } this.TextBox_IssueNoRegex.Text = myClass_ShipClassificationDefault.IssueNoRegex; this.TextBox_ExaminingNoRegex.Text = myClass_ShipClassificationDefault.ExaminingNoRegex; this.TextBox_CertificateNoRegex.Text = myClass_ShipClassificationDefault.CertificateNoRegex; this.ComboBox_TestCommitteeID.SelectedValue = myClass_ShipClassificationDefault.TestCommitteeID; if (myClass_ShipClassificationDefault.YearBegin >= this.numericUpDown_YearBegin.Minimum && myClass_ShipClassificationDefault.YearBegin <= this.numericUpDown_YearBegin.Maximum) { this.numericUpDown_YearBegin.Value = myClass_ShipClassificationDefault.YearBegin; } if (myClass_ShipClassificationDefault.YearEnd >= this.numericUpDown_YearEnd.Minimum && myClass_ShipClassificationDefault.YearEnd <= this.numericUpDown_YearEnd.Maximum) { this.numericUpDown_YearEnd.Value = myClass_ShipClassificationDefault.YearEnd; } } } else { this.TextBox_ShipClassificationAb.ReadOnly = true; this.TextBox_ShipClassificationAb.Text = this.myClass_ShipClassification.ShipClassificationAb; this.TextBox_ShipClassification.Text = this.myClass_ShipClassification.ShipClassification; if (myClass_ShipClassification.ShipClassificationIndex >= this.numericUpDown_ShipClassificationIndex.Minimum && myClass_ShipClassification.ShipClassificationIndex <= this.numericUpDown_ShipClassificationIndex.Maximum) { this.numericUpDown_ShipClassificationIndex.Value = this.myClass_ShipClassification.ShipClassificationIndex; } this.TextBox_ShipClassificationEnglishName.Text = this.myClass_ShipClassification.ShipClassificationEnglishName; this.TextBox_ShipClassificationRemark.Text = this.myClass_ShipClassification.ShipClassificationRemark; this.CheckBox_WeldingStandardRestrict.Checked = this.myClass_ShipClassification.WeldingStandardRestrict; this.checkBox_YearSeparate.Checked = this.myClass_ShipClassification.YearSeparate; this.CheckBox_ShipRestrict.Checked = this.myClass_ShipClassification.ShipRestrict; this.CheckBox_TheorySeparate.Checked = this.myClass_ShipClassification.TheorySeparate; this.checkBox_ProlongQCContinuous.Checked = this.myClass_ShipClassification.ProlongQCContinuous; this.ComboBox_WeldingStandard.SelectedValue = this.myClass_ShipClassification.WeldingStandard; this.MaskedTextBox_NextIssueNo.Text = this.myClass_ShipClassification.NextIssueNo; this.MaskedTextBox_NextExaminingNo.Text = this.myClass_ShipClassification.NextExaminingNo; this.MaskedTextBox_NextCertificateNo.Text = this.myClass_ShipClassification.NextCertificateNo; if (myClass_ShipClassification.IssueNoSignificantDigit >= this.NumericUpDown_IssueNoSignificantDigit.Minimum && myClass_ShipClassification.IssueNoSignificantDigit <= this.NumericUpDown_IssueNoSignificantDigit.Maximum) { this.NumericUpDown_IssueNoSignificantDigit.Value = myClass_ShipClassification.IssueNoSignificantDigit; } if (myClass_ShipClassification.ExaminingNoSignificantDigit >= this.NumericUpDown_ExaminingNoSignificantDigit.Minimum && myClass_ShipClassification.ExaminingNoSignificantDigit <= this.NumericUpDown_ExaminingNoSignificantDigit.Maximum) { this.NumericUpDown_ExaminingNoSignificantDigit.Value = myClass_ShipClassification.ExaminingNoSignificantDigit; } if (myClass_ShipClassification.CertificateNoSignificantDigit >= this.NumericUpDown_CertificateNoSignificantDigit.Minimum && myClass_ShipClassification.CertificateNoSignificantDigit <= this.NumericUpDown_CertificateNoSignificantDigit.Maximum) { this.NumericUpDown_CertificateNoSignificantDigit.Value = myClass_ShipClassification.CertificateNoSignificantDigit; } this.TextBox_IssueNoRegex.Text = this.myClass_ShipClassification.IssueNoRegex; this.TextBox_ExaminingNoRegex.Text = this.myClass_ShipClassification.ExaminingNoRegex; this.TextBox_CertificateNoRegex.Text = this.myClass_ShipClassification.CertificateNoRegex; this.ComboBox_TestCommitteeID.SelectedValue = this.myClass_ShipClassification.TestCommitteeID; if (myClass_ShipClassification.YearBegin >= this.numericUpDown_YearBegin.Minimum && myClass_ShipClassification.YearBegin <= this.numericUpDown_YearBegin.Maximum) { this.numericUpDown_YearBegin.Value = this.myClass_ShipClassification.YearBegin; } if (myClass_ShipClassification.YearEnd >= this.numericUpDown_YearEnd.Minimum && myClass_ShipClassification.YearEnd <= this.numericUpDown_YearEnd.Maximum) { this.numericUpDown_YearEnd.Value = this.myClass_ShipClassification.YearEnd; } } }