private void Button_WPSIDModify_Click(object sender, EventArgs e) { string str_NewWPSID = ""; Form_InputBox myForm = new Form_InputBox(); myForm.str_DefaultResponse = this.myClass_WPS.WPSID; myForm.str_Prompt = "请输入焊接工艺编号:"; myForm.str_Title = "输入焊接工艺编号"; if (myForm.ShowDialog() == DialogResult.OK) { str_NewWPSID = myForm.str_DefaultResponse; } if (str_NewWPSID.Length == 0) { MessageBox.Show("你没有输入焊接工艺编号,操作失败!"); return; } if (Class_WPS.ExistAndCanDeleteAndDelete(str_NewWPSID, ZCCL.ClassBase.Enum_zwjKindofUpdate.Exist) == true) { MessageBox.Show("焊接工艺编号重复,操作失败!"); return; } this.myClass_WPS.ModifyWPSID(str_NewWPSID); if (this.myEventArgs_WPSQuery != null) { this.myEventArgs_WPSQuery.bool_JustFill = false; Publisher_WPSQuery.OnEventName(this.myEventArgs_WPSQuery); } this.userControl_WPSBase1.InitControl(this.myClass_WPS, false); }
private void RefreshData(bool bool_JustFill) { if (this.myEventArgs_WPSQuery == null) { this.myEventArgs_WPSQuery = new EventArgs_WPSQuery(null); } this.myEventArgs_WPSQuery.bool_JustFill = bool_JustFill; Publisher_WPSQuery.OnEventName(this.myEventArgs_WPSQuery); }
private void UserControl_WPSDataGridView_Load(object sender, EventArgs e) { Publisher_WPSQuery.EventName += new EventHandler_WPSQuery(InitDataGridView); if (this.myEventArgs_WPSQuery == null) { this.myEventArgs_WPSQuery = new EventArgs_WPSQuery(null); } Publisher_WPSQuery.OnEventName(this.myEventArgs_WPSQuery); }
private void button_pWPSQueryAdvance_Click(object sender, EventArgs e) { Form_QueryFilter myForm = new Form_QueryFilter(); myForm.InitControl(Enum_DataTable.WPS.ToString()); if (myForm.ShowDialog() == DialogResult.OK) { EventArgs_WPSQuery g = new EventArgs_WPSQuery(myForm.str_Filter); Publisher_WPSQuery.OnEventName(g); } }
private void button_pWPSQuery_Click(object sender, EventArgs e) { string str_Filter = "1=1"; if (this.checkBox_Mistiness.Checked) { if (this.textBox_pWPSIDBegin.Text.Length > 0) { if (string.IsNullOrEmpty(this.textBox_pWPSIDEnd.Text)) { str_Filter = str_Filter + string.Format(" And WPSID like '%{0}%'", this.textBox_pWPSIDBegin.Text); } else { str_Filter = str_Filter + string.Format(" And (WPSID >= '{0}' And WPSID <= '{1}')", this.textBox_pWPSIDBegin.Text, this.textBox_pWPSIDEnd.Text); } } if (this.textBox_pWPSDenomination.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSDenomination like '%{0}%'", this.textBox_pWPSDenomination.Text); } if (this.textBox_pWPSWeldingProcessAb.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSWeldingProcessAb like '%{0}%'", this.textBox_pWPSWeldingProcessAb.Text); } if (this.textBox_pWPSMaterial.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And (WPSMaterial like '%{0}%' Or WPSMaterialSecond like '%{0}%')", this.textBox_pWPSMaterial.Text); } if (this.textBox_pWPSWeldingConsumable.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSWeldingConsumable like '%{0}%'", this.textBox_pWPSWeldingConsumable.Text); } if (this.textBox_pWPSWeldingPosition.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSWeldingPosition like '%{0}%'", this.textBox_pWPSWeldingPosition.Text); } if (this.comboBox_pWPSGrooveType.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSGrooveType like '%{0}%'", this.comboBox_pWPSGrooveType.Text); } if (this.comboBox_pWPSJointType .Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSJointType like '%{0}%'", this.comboBox_pWPSJointType.Text); } double dbl_pWPSThickness=0; double.TryParse(this.textBox_pWPSThickness.Text, out dbl_pWPSThickness); if (dbl_pWPSThickness > 0) { str_Filter = str_Filter + string.Format(" And (WPSThickness = {0} or WPSThicknessSecond = {0})", dbl_pWPSThickness); } } else { if (this.textBox_pWPSIDBegin.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSID = '{0}'", this.textBox_pWPSIDBegin.Text); } if (this.textBox_pWPSDenomination.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSDenomination = '{0}'", this.textBox_pWPSDenomination.Text); } if (this.textBox_pWPSWeldingProcessAb.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSWeldingProcessAb = '{0}'", this.textBox_pWPSWeldingProcessAb.Text); } if (this.textBox_pWPSMaterial.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And (WPSMaterial = '{0}' Or WPSMaterialSecond = '{0}')", this.textBox_pWPSMaterial.Text); } if (this.textBox_pWPSWeldingConsumable.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSWeldingConsumable = '{0}'", this.textBox_pWPSWeldingConsumable.Text); } if (this.textBox_pWPSWeldingPosition.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSWeldingPosition = '{0}'", this.textBox_pWPSWeldingPosition.Text); } if (this.comboBox_pWPSGrooveType.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSGrooveType = '{0}'", this.comboBox_pWPSGrooveType.Text); } if (this.comboBox_pWPSJointType.Text.Length > 0) { str_Filter = str_Filter + string.Format(" And WPSJointType = '{0}'", this.comboBox_pWPSJointType.Text); } double dbl_pWPSThickness = 0; double.TryParse(this.textBox_pWPSThickness.Text, out dbl_pWPSThickness); if (dbl_pWPSThickness > 0) { str_Filter = str_Filter + string.Format(" And (WPSThickness = {0} or WPSThicknessSecond = {0})", dbl_pWPSThickness); } } EventArgs_WPSQuery g = new EventArgs_WPSQuery(str_Filter); Publisher_WPSQuery.OnEventName(g); }