/// <summary> /// /// </summary> private void Edit() { if (NoRecordDataGrid()) { return; } int row = m_dataGrid.CurrentCell.RowNumber; int col = 0; string s_id = m_dataGrid[row, col].ToString(); if (s_id.Trim() == "") { MessageBox.Show("请正确选择需要编辑的数据行!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } int id = Convert.ToInt32(m_dataGrid[row, col].ToString()); frmFactoryDatasItem f = new frmFactoryDatasItem(id); if (DialogResult.OK == f.ShowDialog()) { m_dataGrid.TableStyles.Clear(); m_dataGrid.DataSource = null; InitializeGridTitle(); LoadDatas(m_Begin, m_End); } }
/// <summary> /// /// </summary> private void Add() { frmFactoryDatasItem f = new frmFactoryDatasItem(); if (DialogResult.OK == f.ShowDialog()) { m_dataGrid.TableStyles.Clear(); m_dataGrid.DataSource = null; InitializeGridTitle(); LoadDatas(m_Begin, m_End); } }