// 修改数据库特性 private void toolStripButton_modifyDatabase_Click(object sender, EventArgs e) { string strError = ""; int nRet = 0; if (this.listView_databases.SelectedItems.Count == 0) { strError = "尚未选定要修改的数据库"; goto ERROR1; } ListViewItem item = this.listView_databases.SelectedItems[0]; string strTypeName = ListViewUtil.GetItemText(item, 1); string strName = item.Text; string strType = GetTypeString(strTypeName); if (strType == null) strType = strTypeName; if (strType == "biblio") { BiblioDatabaseDialog dlg = new BiblioDatabaseDialog(); MainForm.SetControlFont(dlg, this.Font, false); dlg.Text = "修改书目库特性"; dlg.ManagerForm = this; dlg.CreateMode = false; dlg.StartPosition = FormStartPosition.CenterScreen; nRet = dlg.Initial((string)item.Tag, out strError); if (nRet == -1) goto ERROR1; dlg.ShowDialog(this); if (dlg.DialogResult != DialogResult.OK) return; // 刷新库名列表 nRet = ListAllDatabases(out strError); if (nRet == -1) { MessageBox.Show(this, strError); } // 选定刚修改的数据库 SelectDatabaseLine(dlg.BiblioDatabaseName); RefreshOpacDatabaseList(); RefreshOpacBrowseFormatTree(); // 重新获得各种库名、列表 this.MainForm.StartPrepareNames(false, false); } else if (strType == "reader") { ReaderDatabaseDialog dlg = new ReaderDatabaseDialog(); MainForm.SetControlFont(dlg, this.Font, false); dlg.Text = "修改读者库特性"; dlg.ManagerForm = this; dlg.LibraryCodeList = this.GetLibraryCodeList(); dlg.CreateMode = false; dlg.StartPosition = FormStartPosition.CenterScreen; nRet = dlg.Initial((string)item.Tag, out strError); if (nRet == -1) goto ERROR1; dlg.ShowDialog(this); if (dlg.DialogResult != DialogResult.OK) return; // 刷新库名列表 nRet = ListAllDatabases(out strError); if (nRet == -1) { MessageBox.Show(this, strError); } // 选定刚修改的数据库 SelectDatabaseLine(dlg.ReaderDatabaseName); // 重新获得各种库名、列表 this.MainForm.StartPrepareNames(false, false); RefreshOpacDatabaseList(); RefreshOpacBrowseFormatTree(); } else if (strType == "message" || strType == "amerce" || strType == "invoice" || strType == "arrived" || strType == "zhongcihao" || strType == "publisher" || strType == "dictionary" || strType == "inventory") { SimpleDatabaseDialog dlg = new SimpleDatabaseDialog(); MainForm.SetControlFont(dlg, this.Font, false); /* string strTypeName = GetTypeName(strType); if (strTypeName == null) strTypeName = strType; * */ dlg.Text = "修改" + strTypeName + "库特性"; dlg.ManagerForm = this; dlg.CreateMode = false; dlg.StartPosition = FormStartPosition.CenterScreen; nRet = dlg.Initial( strType, (string)item.Tag, out strError); if (nRet == -1) goto ERROR1; dlg.ShowDialog(this); if (dlg.DialogResult != DialogResult.OK) return; // 刷新库名列表 nRet = ListAllDatabases(out strError); if (nRet == -1) { MessageBox.Show(this, strError); } // 选定刚修改的数据库 SelectDatabaseLine(dlg.DatabaseName); RefreshOpacDatabaseList(); RefreshOpacBrowseFormatTree(); // 重新获得各种库名、列表 this.MainForm.StartPrepareNames(false, false); } return; ERROR1: MessageBox.Show(this, strError); }
// 创建读者库 private void ToolStripMenuItem_createReaderDatabase_Click(object sender, EventArgs e) { string strLibraryCodeList = this.GetLibraryCodeList(); ReaderDatabaseDialog dlg = new ReaderDatabaseDialog(); MainForm.SetControlFont(dlg, this.Font, false); dlg.Text = "创建新读者库"; dlg.ManagerForm = this; dlg.LibraryCodeList = this.GetLibraryCodeList(); dlg.CreateMode = true; dlg.StartPosition = FormStartPosition.CenterScreen; dlg.ShowDialog(this); if (dlg.DialogResult != DialogResult.OK) return; // 刷新库名列表 string strError = ""; int nRet = ListAllDatabases(out strError); if (nRet == -1) { MessageBox.Show(this, strError); } // 选定刚创建的数据库 SelectDatabaseLine(dlg.ReaderDatabaseName); // 如果馆代码列表发生了变化 if (this.GetLibraryCodeList() != strLibraryCodeList) UpdateLoanPolicyLibraryCode(); // 重新获得各种库名、列表 this.MainForm.StartPrepareNames(false, false); }
// 创建读者库 private void ToolStripMenuItem_createReaderDatabase_Click(object sender, EventArgs e) { ReaderDatabaseDialog dlg = new ReaderDatabaseDialog(); dlg.Text = "创建新读者库"; dlg.ManagerForm = this; dlg.CreateMode = true; dlg.StartPosition = FormStartPosition.CenterScreen; dlg.ShowDialog(this); if (dlg.DialogResult != DialogResult.OK) return; // 刷新库名列表 string strError = ""; int nRet = ListAllDatabases(out strError); if (nRet == -1) { MessageBox.Show(this, strError); } // 选定刚创建的数据库 SelectDatabaseLine(dlg.ReaderDatabaseName); // 重新获得各种库名、列表 this.MainForm.StartPrepareNames(false); }