/// <summary> /// 新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnInsert_Click(object sender, EventArgs e) { frmDepartmentManageEdit frm = new frmDepartmentManageEdit(EditMode.Add, null); frm.MdiParent = this.MdiParent; frm.WindowState = FormWindowState.Maximized; frm.Show(); }
/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnUpate_Click(object sender, EventArgs e) { if (dgv.SelectedCells.Count == 0) { Func.ShowMessage(MessageType.Warning, "没有选中一条数据"); return; } EapDepartment entity = new EapDepartment(); entity.DEPARTMENT_ID = Int32.Parse(dgv.Rows[dgv.CurrentCell.RowIndex].Cells["DEPARTMENT_ID"].Value.ToString()); entity.DEPARTMENT_CODE = dgv.Rows[dgv.CurrentCell.RowIndex].Cells["DEPARTMENT_CODE"].Value.ToString(); entity.DEPARTMENT_NAME = dgv.Rows[dgv.CurrentCell.RowIndex].Cells["DEPARTMENT_NAME"].Value.ToString(); entity.DEPARTMENT_TYPE = dgv.Rows[dgv.CurrentCell.RowIndex].Cells["DEPARTMENT_TYPE"].Value.ToString(); entity.ASSEMBLY_LINE = dgv.Rows[dgv.CurrentCell.RowIndex].Cells["ASSEMBLY_LINE"].Value.ToString(); entity.STATUS = decimal.Parse(dgv.Rows[dgv.CurrentCell.RowIndex].Cells["STATUS"].Value.ToString()); frmDepartmentManageEdit frm = new frmDepartmentManageEdit(EditMode.Edit, entity); frm.MdiParent = this.MdiParent; frm.WindowState = FormWindowState.Maximized; frm.Show(); }