/// <summary> /// 添加数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowAdd_Click(object sender, EventArgs e) { if (this.myEventArgs_ReviveQC == null) { return; } Form_ReviveQC_Update myForm = new Form_ReviveQC_Update(); myForm.myClass_ReviveQC = new Class_ReviveQC(); myForm.bool_Add = true; if (myForm.ShowDialog() == DialogResult.OK) { this.RefreshData(false); Class_DataControlBind.SetDataGridViewSelectedPosition("ReviveQCID", myForm.myClass_ReviveQC.ReviveQCID.ToString(), this.dataGridView_Data); } }
/// <summary> /// 修改数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripMenuItem_DataGridViewRowModify_Click(object sender, EventArgs e) { Form_ReviveQC_Update myForm = new Form_ReviveQC_Update(); myForm.myClass_ReviveQC = new Class_ReviveQC(); myForm.myClass_ReviveQC.ReviveQCID = (int)this.dataGridView_Data.CurrentRow.Cells["ReviveQCID"].Value; if (myForm.myClass_ReviveQC.FillData()) { myForm.bool_Add = false; if (myForm.ShowDialog() == DialogResult.OK) { this.RefreshData(true); } } else { MessageBox.Show("该行数据已被删除!"); } }