/// <summary> /// 添加数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowAdd_Click(object sender, EventArgs e) { if (this.myEventArgs_Welder == null || string.IsNullOrEmpty(this.myEventArgs_Welder.str_IdentificationCard)) { return; } Form_BlackList_Update myForm = new Form_BlackList_Update(); myForm.myClass_BlackList = new Class_BlackList(); myForm.myClass_BlackList.IdentificationCard = this.myEventArgs_Welder.str_IdentificationCard; myForm.bool_Add = true; if (myForm.ShowDialog() == DialogResult.OK) { this.RefreshData(true); } }
/// <summary> /// 修改数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowModify_Click(object sender, EventArgs e) { Form_BlackList_Update myForm = new Form_BlackList_Update(); myForm.myClass_BlackList = new Class_BlackList(); myForm.myClass_BlackList.BlackListID = (int)this.dataGridView_Data.CurrentRow.Cells["BlackListID"].Value; if (myForm.myClass_BlackList.FillData()) { myForm.bool_Add = false; if (myForm.ShowDialog() == DialogResult.OK) { this.RefreshData(true); } } else { MessageBox.Show("该行数据已被删除!"); } }