private void button_QueryAdvance_Click(object sender, EventArgs e) { Form_QueryFilter myForm = new Form_QueryFilter(); myForm.InitControl(Enum_DataTable.Welder.ToString()); if (myForm.ShowDialog() == DialogResult.OK) { EventArgs_WelderFilter g = new EventArgs_WelderFilter(myForm.str_Filter); Publisher_WelderFilter.OnEventName(g); } }
/// <summary> /// 添加数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowAdd_Click(object sender, EventArgs e) { Form_Welder_Update myForm = new Form_Welder_Update(); myForm.myClass_Welder = new Class_Welder(); myForm.bool_Add = true; if (myForm.ShowDialog() == DialogResult.OK) { EventArgs_WelderFilter my_e = new EventArgs_WelderFilter(null); my_e.str_IdentificationCard = myForm.myClass_Welder.IdentificationCard; Publisher_WelderFilter.OnEventName(my_e); } }
private void button_OnOK_Click(object sender, EventArgs e) { EventArgs_WelderFilter my_e = new EventArgs_WelderFilter(null); my_e.str_IdentificationCard = Class_DataValidateTool.CovertIdentificationCard(this.TextBox_IdentificationCardQuery.Text); my_e.str_WelderName = this.TextBox_WelderNameQuery.Text; my_e.str_RegistrationNo = this.TextBox_RegistrationNoQuery.Text; my_e.str_WelderWorkerID = this.TextBox_WorkerIDQuery.Text; my_e.str_ExaminingNo = this.TextBox_ExaminingNoQuery.Text; my_e.str_CertificateNo = this.TextBox_CertificateNoQuery.Text; my_e.str_IssueNo = this.textBox_IssueNoQuery.Text; Publisher_WelderFilter.OnEventName(my_e); }
/// <summary> /// 删除数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowDelete_Click(object sender, EventArgs e) { if (Class_Welder.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IdentificationCard"].Value.ToString(), Enum_zwjKindofUpdate.CanDelete)) { if (MessageBox.Show("确认删除吗?", "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK) { Class_Welder.ExistAndCanDeleteAndDelete(this.dataGridView_Data.CurrentRow.Cells["IdentificationCard"].Value.ToString(), Enum_zwjKindofUpdate.Delete); EventArgs_WelderFilter my_e = new EventArgs_WelderFilter(null); my_e.str_IdentificationCard = this.dataGridView_Data.CurrentRow.Cells["IdentificationCard"].Value.ToString(); Publisher_WelderFilter.OnEventName(my_e); } } else { MessageBox.Show("不能删除!"); } }
/// <summary> /// 修改数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowModify_Click(object sender, EventArgs e) { Form_Welder_Update myForm = new Form_Welder_Update(); myForm.myClass_Welder = new Class_Welder(); myForm.myClass_Welder.IdentificationCard = this.dataGridView_Data.CurrentRow.Cells["IdentificationCard"].Value.ToString(); if (myForm.myClass_Welder.FillData()) { myForm.bool_Add = false; if (myForm.ShowDialog() == DialogResult.OK) { EventArgs_WelderFilter my_e = new EventArgs_WelderFilter(null); my_e.str_IdentificationCard = myForm.myClass_Welder.IdentificationCard; Publisher_WelderFilter.OnEventName(my_e); } } else { MessageBox.Show("该行数据已被删除!"); } }
private void toolStripMenuItem_RowAddByExcel_Click(object sender, EventArgs e) { DataTable myDataTable = Class_DataControlBind.ImportExcelToDataTable(); if (myDataTable != null) { if (!myDataTable.Columns.Contains("IdentificationCard")) { MessageBox.Show("数据表中不存在 'IdentificationCard' 列!"); return; } DataRow[] myDataRow_Range; myDataRow_Range = myDataTable.Select("len(IdentificationCard)>0"); StringBuilder myStringBuilder = new StringBuilder(); myStringBuilder.Append("1=0"); foreach (DataRow myDataRow in myDataRow_Range) { myStringBuilder.Append(string.Format(" Or IdentificationCard='{0}'", Class_DataValidateTool.CovertIdentificationCard(myDataRow["IdentificationCard"].ToString()))); } EventArgs_WelderFilter g = new EventArgs_WelderFilter(myStringBuilder.ToString()); Publisher_WelderFilter.OnEventName(g); } }