private void btnLikeAdd_Click(object sender, EventArgs e) { BaseItemsEntity entity = GetEntity(); entity.Id = null; FrmItemsAdd frmItemsAdd = new FrmItemsAdd(entity); frmItemsAdd.ShowDialog(); }
/// <summary> /// 添加 /// </summary> /// <returns>主键</returns> public string Add() { FrmItemsAdd frmItemsAdd = new FrmItemsAdd(); frmItemsAdd.OnDataChanged += new FrmItemsAdd.OnDataChangedEventHandler(this.OnDataChanged); if (frmItemsAdd.ShowDialog(this) == DialogResult.OK) { // 记录当前选中的主键 this.CurrentEntityId = frmItemsAdd.EntityId; // 加载窗体 this.FormOnLoad(); } return(this.CurrentEntityId); }