📄 librarymanager.cs
字号:
// mnuReaderStatistics
//
this.mnuReaderStatistics.Index = 1;
this.mnuReaderStatistics.Shortcut = System.Windows.Forms.Shortcut.CtrlW;
this.mnuReaderStatistics.Text = "读者借阅排名";
this.mnuReaderStatistics.Click += new System.EventHandler(this.mnuReaderStatistics_Click);
//
// mnuWindows
//
this.mnuWindows.Index = 7;
this.mnuWindows.MdiList = true;
this.mnuWindows.Text = "窗口(&W)";
//
// mnuHelp
//
this.mnuHelp.Index = 8;
this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem19,
this.menuItem20,
this.mnuAboutLibraryManageSystem});
this.mnuHelp.Text = "帮助(&H)";
//
// menuItem19
//
this.menuItem19.Index = 0;
this.menuItem19.Shortcut = System.Windows.Forms.Shortcut.F1;
this.menuItem19.Text = "帮助目录";
//
// menuItem20
//
this.menuItem20.Index = 1;
this.menuItem20.Text = "-";
//
// mnuAboutLibraryManageSystem
//
this.mnuAboutLibraryManageSystem.Index = 2;
this.mnuAboutLibraryManageSystem.Text = "关于(&A)...";
this.mnuAboutLibraryManageSystem.Click += new System.EventHandler(this.mnuAboutLibraryManageSystem_Click);
//
// iltToolBar
//
this.iltToolBar.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.iltToolBar.ImageSize = new System.Drawing.Size(16, 16);
this.iltToolBar.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("iltToolBar.ImageStream")));
this.iltToolBar.TransparentColor = System.Drawing.Color.Silver;
//
// tbMain
//
this.tbMain.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
this.tbMain.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton7,
this.toolBarButton2,
this.toolBarButton3,
this.toolBarButton4,
this.toolBarButton5,
this.toolBarButton6});
this.tbMain.DropDownArrows = true;
this.tbMain.ImageList = this.iltToolBar;
this.tbMain.Location = new System.Drawing.Point(0, 0);
this.tbMain.Name = "tbMain";
this.tbMain.ShowToolTips = true;
this.tbMain.Size = new System.Drawing.Size(794, 41);
this.tbMain.TabIndex = 2;
this.tbMain.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tbMain_ButtonClick);
//
// toolBarButton1
//
this.toolBarButton1.ImageIndex = 0;
this.toolBarButton1.Text = "图书资料";
this.toolBarButton1.ToolTipText = "图书资料";
//
// toolBarButton7
//
this.toolBarButton7.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
//
// toolBarButton2
//
this.toolBarButton2.ImageIndex = 1;
this.toolBarButton2.Text = "借阅图书";
this.toolBarButton2.ToolTipText = "借阅图书";
//
// toolBarButton3
//
this.toolBarButton3.ImageIndex = 2;
this.toolBarButton3.Text = "续借图书";
this.toolBarButton3.ToolTipText = "续借图书";
//
// toolBarButton4
//
this.toolBarButton4.ImageIndex = 3;
this.toolBarButton4.Text = "归还图书";
this.toolBarButton4.ToolTipText = "归还图书";
//
// toolBarButton5
//
this.toolBarButton5.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
//
// toolBarButton6
//
this.toolBarButton6.ImageIndex = 8;
this.toolBarButton6.Text = "退出系统";
this.toolBarButton6.ToolTipText = "退出系统";
//
// menuItem2
//
this.menuItem2.Index = 8;
this.menuItem2.Text = "读者部门管理";
this.menuItem2.Visible = false;
//
// Global
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(794, 595);
this.Controls.Add(this.tbMain);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.IsMdiContainer = true;
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(800, 620);
this.Menu = this.mnuMain;
this.MinimumSize = new System.Drawing.Size(800, 620);
this.Name = "Global";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "LibraryManage";
this.Closing += new System.ComponentModel.CancelEventHandler(this.Global_Closing);
this.MdiChildActivate += new System.EventHandler(this.Global_MdiChildActivate);
this.Load += new System.EventHandler(this.Global_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 图书采购
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void mnuBuyBooks_Click(object sender, System.EventArgs e)
{
Library.BuyBooks dialog = new BuyBooks(false,"");
dialog.ShowDialog();
}
/// <summary>
/// 关于 图书馆管理系统
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void mnuAboutLibraryManageSystem_Click(object sender, EventArgs e)
{
Library.AboutLibraryManageSystem dialog = new AboutLibraryManageSystem();
dialog.ShowDialog();
}
/// <summary>
/// 窗体加载代码
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Global_Load(object sender, System.EventArgs e)
{
initializeAuthority();
}
/// <summary>
/// 初始化用户权限
/// </summary>
public void initializeAuthority()
{
mnuSystem.Visible = b_SystemSetting;
mnuBooksSetting.Visible = b_BooksSetting;
mnuBooksManage.Visible = b_BooksManage;
mnuReaderManage.Visible = b_ReaderManage;
mnuSystemSearch.Visible = b_SystemSearch;
mnuStatistics.Visible = b_Statistics;
}
/// <summary>
/// 设置默认显示——BooksInfo
/// </summary>
public void initializeBooksInfo()
{
sbpGlobal.Text = "当前模块:图书资料";
BooksInfo = true;
ActiveChild = "BooksInfo";
}
/// <summary>
/// 设置默认显示——BorrowBooks
/// </summary>
public void initializeBorrowBooks()
{
sbpGlobal.Text = "当前模块:借阅图书";
BorrowBooks = true;
ActiveChild = "BorrowBooks";
}
/// <summary>
/// 设置默认显示——ReturnBooks
/// </summary>
public void initializeReturnBooks()
{
sbpGlobal.Text = "当前模块:归还图书";
ReturnBooks = true;
ActiveChild = "ReturnBooks";
}
/// <summary>
/// 图书借阅排名
/// </summary>
public void initializeBooksStatistics()
{
sbpGlobal.Text = "当前模块:图书借阅排名";
BooksStatistics = true;
ActiveChild = "BooksStatistics";
}
/// <summary>
/// 续借图书
/// </summary>
private void initializeReborrowBooks()
{
sbpGlobal.Text = "当前模块:续借图书";
ReborrowBooks = true;
ActiveChild = "ReborrowBooks";
}
/// <summary>
/// 读者借阅排名
/// </summary>
private void initializeReaderStatistics()
{
sbpGlobal.Text = "当前模块:读者借阅排名";
ReaderStatistics = true;
ActiveChild = "ReaderStatistics";
}
/// <summary>
/// 子窗体激活事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Global_MdiChildActivate(object sender, System.EventArgs e)
{
if(ActiveForm.ActiveMdiChild != null)
{
switch(ActiveForm.ActiveMdiChild.Name)
{
case "BooksInfo":
initializeBooksInfo();
break;
case "BorrowBooks":
initializeBorrowBooks();
break;
case "ReturnBooks":
initializeReturnBooks();
break;
case "BooksStatistics":
initializeBooksStatistics();
break;
case "ReborrowBooks":
initializeReborrowBooks();
break;
case "ReaderStatistics":
initializeReaderStatistics();
break;
}
}
}
/// <summary>
/// 系统关闭代码
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Global_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if(ActiveForm.ActiveMdiChild != null)
{
for(int i=0;i<this.MdiChildren.Length;i++)
{
this.MdiChildren[i].Close();
}
}
if(conn != null)conn.Close();
}
/// <summary>
/// 暂时离开
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void mnuProvisionalLeave_Click(object sender, System.EventArgs e)
{
Library.LoginSystem dialog = new LoginSystem(false);
dialog.ShowDialog();
}
/// <summary>
/// 读者办证
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void mnuAddNewCard_Click(object sender, System.EventArgs e)
{
Library.AddNewCard dialog = new AddNewCard();
dialog.ShowDialog();
}
/// <summary>
/// 读者类型
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuItem23_Click(object sender, System.EventArgs e)
{
Library.ReaderType dialog = new ReaderType();
dialog.ShowDialog();
}
/// <summary>
/// 出版社设置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void mnuPressSetting_Click(object sender, System.EventArgs e)
{
Library.PressSetting dialog = new PressSetting();
dialog.ShowDialog();
}
/// <summary>
/// 管理员设置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void mnuUserSetting_Click(object sender, System.EventArgs e)
{
Library.UserSetting dialog = new UserSetting();
dialog.ShowDialog();
}
/// <summary>
/// 图书资料
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void mnuBooksInfo_Click(object sender, System.EventArgs e)
{
if(BooksInfo == false)
{
Library.BooksInfo child = new BooksInfo();
child.MdiParent = this;
child.Show();
}
else
{
for(int i=0;i<this.MdiChildren.Length;i++)
{
if(this.MdiChildren[i].Name == "BooksInfo")
{
this.MdiChildren[i].BringToFront();
}
}
}
}
/// <summary>
/// 借阅图书
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void mnuBorrowBooks_Click(object sender, System.EventArgs e)
{
if(BorrowBooks == false)
{
Library.BorrowBooks child = new BorrowBooks();
child.MdiParent = this;
child.Show();
}
else
{
for(int i = 0;i<this.MdiChildren.Length;i++)
{
if(this.MdiChildren[i].Name == "BorrowBooks")
{
this.MdiChildren[i].BringToFront();
}
}
}
}
/// <summary>
/// 归还图书
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -