private void toolStripButtonAddNew_Click(object sender, EventArgs e) { frmAddEmployee addEmployee = new frmAddEmployee(); //CommStatic.FrmAddEmployee = addEmployee; if (addEmployee.ShowDialog() == DialogResult.OK) { InitList(); } CommStatic.TxtBoxCardId = txtCardId; }
private void toolStripButtonEdit_Click(object sender, EventArgs e) { DataGridViewSelectedRowCollection col = dgvList.SelectedRows; if (col.Count < 1) { MessageBox.Show("请选择要编辑的项目!"); return; } DataTable dt = dgvList.DataSource as DataTable; DataRow row = dt.Rows[col[0].Index]; frmAddEmployee editEmployee = new frmAddEmployee(row); //CommStatic.FrmAddEmployee = editEmployee; if (editEmployee.ShowDialog() == DialogResult.OK) { InitList(); } CommStatic.TxtBoxCardId = txtCardId; }