void menu_loadToExistDetailWindow_Click(object sender, EventArgs e) { if (this.listView_browse.SelectedItems.Count == 0) { MessageBox.Show(this, "尚未选定要装入种册窗的事项"); return; } string strPath = this.listView_browse.SelectedItems[0].SubItems[0].Text; EntityForm form = Program.MainForm.GetTopChildWindow <EntityForm>(); if (form == null) { MessageBox.Show(this, "目前并没有已经打开的种册窗"); return; } Global.Activate(form); form.LoadRecordOld(strPath, "", true); }
// 打开到 种册窗 void menuItem_loadToEntityForm_Click(object sender, EventArgs e) { string strError = ""; if (this.dpTable_items.SelectedRows.Count == 0) { strError = "尚未选定要打开的册事项"; goto ERROR1; } DpRow selected_row = this.dpTable_items.SelectedRows[0]; string strItemBarcode = selected_row[COLUMN_ITEMBARCODE].Text; if (string.IsNullOrEmpty(strItemBarcode) == true) { strError = "所选定的册事项不具备册条码号信息"; goto ERROR1; } EntityForm form = Program.MainForm.EnsureEntityForm(); Global.Activate(form); if (strItemBarcode.StartsWith("@biblioRecPath:") == true) { form.LoadRecordOld(strItemBarcode.Substring("@biblioRecPath:".Length), "", true); } else { form.LoadItemByBarcode(strItemBarcode, false); } this.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.Close(); return; ERROR1: MessageBox.Show(this, strError); }