void btnAddItem_Click(object sender, EventArgs e) { if (this.treeView1.SelectedNode == null) { return; } Model.Info_mtl_kind kind = this.treeView1.SelectedNode.Tag as Model.Info_mtl_kind; FmMtlInfo fmItem = new FmMtlInfo(); fmItem.Tag = kind; fmItem.SelectValue += FmItem_SelectValue; fmItem.ShowDialog(); }
void btnEditItem_Click(object sender, EventArgs e) { if (mDataGridItem.CurrentRow == null) { return; } Model.Info_mtl_kind kind = this.treeView1.SelectedNode.Tag as Model.Info_mtl_kind; Model.Info_mtl_item item = this.mDataGridItem.GetCurrentEntity() as Model.Info_mtl_item; FmMtlInfo fmItem = new FmMtlInfo(item); fmItem.Tag = kind; fmItem.SelectValue += FmItem_SelectValue; fmItem.ShowDialog(); }