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