private void treeView_Data_AfterSelect(object sender, TreeViewEventArgs e) { EventArgs_ShipClassification my_e = new EventArgs_ShipClassification(null, false); switch (this.treeView_Data.SelectedNode.Level) { case 0: break; case 1: my_e.str_ShipClassificationAb = this.treeView_Data.SelectedNode.Tag.ToString(); break; case 2: my_e.str_ShipClassificationAb = this.treeView_Data.SelectedNode.Parent.Tag.ToString(); if (this.treeView_Data.SelectedNode.Tag.ToString() == "ShipboardNo") { my_e.str_ShipboardNo = this.treeView_Data.SelectedNode.Text; } else { my_e.str_Year = this.treeView_Data.SelectedNode.Text; } break; case 3: my_e.str_ShipClassificationAb = this.treeView_Data.SelectedNode.Parent.Parent.Tag.ToString(); my_e.str_ShipboardNo = this.treeView_Data.SelectedNode.Parent.Text; my_e.bool_GXTheory = (bool )this.treeView_Data.SelectedNode.Tag; break; } this.bool_GXTheory = my_e.bool_GXTheory; Publisher_ShipClassification.OnEventName(my_e); }
/// <summary> /// 刷新数据 /// </summary> /// <param name="bool_JustFill">true-只添加和修改数据,false-刷新全部数据</param> private void RefreshData(bool bool_JustFill) { if (this.myEventArgs_ShipClassification == null) { return; } this.myEventArgs_ShipClassification.bool_JustFill = bool_JustFill; Publisher_ShipClassification.OnEventName(this.myEventArgs_ShipClassification); }
private void button_QueryAdvance_Click(object sender, EventArgs e) { Form_QueryFilter myForm = new Form_QueryFilter(); if (this.bool_GXTheory == false) { myForm.InitControl(Enum_DataTable.Issue.ToString()); } else { myForm.InitControl(Enum_DataTable.GXTheoryIssue.ToString()); } if (myForm.ShowDialog() == DialogResult.OK) { EventArgs_ShipClassification g = new EventArgs_ShipClassification(null, this.bool_GXTheory); g.str_Filter = myForm.str_Filter; Publisher_ShipClassification.OnEventName(g); } }
private void button_OnOK_Click(object sender, EventArgs e) { string str_Filter = "1=1"; if (this.MaskedTextBox_IssueNoBegin.Text.Length > 0) { if (string.IsNullOrEmpty(this.MaskedTextBox_IssueNoBegin.Text)) { str_Filter = str_Filter + string.Format(" And IssueNo = '{0}'", this.MaskedTextBox_IssueNoBegin.Text); } else { str_Filter = str_Filter + string.Format(" And (IssueNo >= '{0}' And IssueNo <= '{1}')", this.MaskedTextBox_IssueNoBegin.Text, this.MaskedTextBox_IssueNoEnd.Text); } } if (this.ComboBox_WeldingProcessAb.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WeldingProcessAb = '{0}'", this.ComboBox_WeldingProcessAb.Text); } if (this.ComboBox_Employer.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And IssueEmployer = '{0}'", this.ComboBox_Employer.Text); } if (this.comboBox_KindofEmployer.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And KindofEmployer = '{0}'", this.comboBox_KindofEmployer.Text); } if (this.comboBox_ShipClassificationAb.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And ShipClassificationAb = '{0}'", this.comboBox_ShipClassificationAb.Text); } if (this.comboBox_ShipboardNo.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And ShipboardNo = '{0}'", this.comboBox_ShipboardNo.Text); } if (!this.bool_GXTheory) { if (this.comboBox_Material.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And IssueMaterial = '{0}'", this.comboBox_Material.Text); } if (this.comboBox_WeldingConsumable.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And IssueWeldingConsumable = '{0}'", this.comboBox_WeldingConsumable.Text); } } switch (this.ComboBox_SignUpDate.Text) { case "报名日期起始": str_Filter = str_Filter + string.Format(" And SignUpDate >= '{0}' And SignUpDate < '{1}'", this.DateTimePicker_SignUpDateBegin.Value.Date, this.DateTimePicker_SignUpDateEnd.Value.Date.AddDays(1)); break; case "培训开始日期": str_Filter = str_Filter + string.Format(" And DateBeginningofTrain >= '{0}' And DateBeginningofTrain < '{1}'", this.DateTimePicker_SignUpDateBegin.Value.Date, this.DateTimePicker_SignUpDateEnd.Value.Date.AddDays(1)); break; case "培训结束日期": str_Filter = str_Filter + string.Format(" And DateEndingofTrain >= '{0}' And DateEndingofTrain < '{1}'", this.DateTimePicker_SignUpDateBegin.Value.Date, this.DateTimePicker_SignUpDateEnd.Value.Date.AddDays(1)); break; case "理论考试日期": str_Filter = str_Filter + string.Format(" And TheoryExamDate >= '{0}' And TheoryExamDate < '{1}'", this.DateTimePicker_SignUpDateBegin.Value.Date, this.DateTimePicker_SignUpDateEnd.Value.Date.AddDays(1)); break; case "技能考试日期": if (!this.bool_GXTheory) { str_Filter = str_Filter + string.Format(" And SkillExamDate >= '{0}' And SkillExamDate < '{1}'", this.DateTimePicker_SignUpDateBegin.Value.Date, this.DateTimePicker_SignUpDateEnd.Value.Date.AddDays(1)); } break; case "理论补考日期": str_Filter = str_Filter + string.Format(" And TheoryMakeupDate >= '{0}' And TheoryMakeupDate < '{1}'", this.DateTimePicker_SignUpDateBegin.Value.Date, this.DateTimePicker_SignUpDateEnd.Value.Date.AddDays(1)); break; case "技能补考日期": if (!this.bool_GXTheory) { str_Filter = str_Filter + string.Format(" And SkillMakeupDate >= '{0}' And SkillMakeupDate < '{1}'", this.DateTimePicker_SignUpDateBegin.Value.Date, this.DateTimePicker_SignUpDateEnd.Value.Date.AddDays(1)); } break; case "办证日期起始": str_Filter = str_Filter + string.Format(" And IssueIssuedOn >= '{0}' And IssueIssuedOn < '{1}'", this.DateTimePicker_SignUpDateBegin.Value.Date, this.DateTimePicker_SignUpDateEnd.Value.Date.AddDays(1)); break; default: break; } EventArgs_ShipClassification g = new EventArgs_ShipClassification(null, this.bool_GXTheory); g.str_Filter = str_Filter; Publisher_ShipClassification.OnEventName(g); }