/// <summary>编辑 /// /// </summary> private void DoEdit() { string strMsg = CheckSelect("修改"); if (strMsg != string.Empty) { MessageBox.Show(strMsg); return; } DataGridViewRow drRowEdit = grdData.SelectedRows[0]; BseProject model = drRowEdit.Tag as BseProject; if (model == null) { int intKeyID = int.Parse(drRowEdit.Cells[gridmrzProjectID.Name].Value.ToString()); model = m_BseProjectDAL.GetModel(intKeyID); } if (model != null) { FrmBseProjectSimpleDialog frmDialog = new FrmBseProjectSimpleDialog(model, m_lstBseProject); if (frmDialog.ShowDialog() == DialogResult.OK) { m_lstBseProject = frmDialog.ListBseProject; grdData.DataSource = m_lstBseProject; grdData.Refresh(); } } }
/// <summary>新增 /// /// </summary> private void DoNew() { FrmBseProjectSimpleDialog frmDialog = new FrmBseProjectSimpleDialog(null, m_lstBseProject); if (frmDialog.ShowDialog() == DialogResult.OK) { m_lstBseProject = frmDialog.ListBseProject; grdData.DataSource = null; grdData.DataSource = m_lstBseProject; grdData.Refresh(); } }