/// <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_WelderModify_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.MaskedTextBox_IdentificationCard.Text)) { MessageBox.Show("没有焊工信息修改!"); return; } Form_Welder_Update myForm = new Form_Welder_Update(); myForm.bool_Add = false; myForm.myClass_Welder = new Class_Welder(this.MaskedTextBox_IdentificationCard.Text); if (myForm.ShowDialog() == DialogResult.OK) { this.myClass_BlackList.IdentificationCard = myForm.myClass_Welder.IdentificationCard; this.InitControlWelder(myForm.myClass_Welder); } }
/// <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("该行数据已被删除!"); } }