private void CopyAdd(int id) { QualityTrackingEntity entity; try { QualityTrackingDAC dac = new QualityTrackingDAC(); entity = dac.Select(id); } catch (Exception ex) { MessageBox.Show("读取数据库出错,请检查网络;\r\n原因:" + ex.Message); return; } if (entity != null) { frmQualityTracking frm = new frmQualityTracking(); //修改模式 frm.EditMode = 1; frm.objTracking = entity; if (frm.ShowDialog() == DialogResult.OK) { Refresh(); } frm.Dispose(); frm = null; } }
private void Add() { frmQualityTracking frmAdd = new frmQualityTracking(); //新增 frmAdd.EditMode = 0; if (frmAdd.ShowDialog() == DialogResult.OK) { Refresh(); } frmAdd.Dispose(); frmAdd = null; }