某毕业论文-图书管理系统-源代码.doc_第1页
某毕业论文-图书管理系统-源代码.doc_第2页
某毕业论文-图书管理系统-源代码.doc_第3页
某毕业论文-图书管理系统-源代码.doc_第4页
某毕业论文-图书管理系统-源代码.doc_第5页
已阅读5页,还剩75页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

登录窗体代码:Imports System.Data.SqlClientPublic Class FormDengLu Dim biaozhi As Boolean Private Sub ButtonDengLu_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonDengLu.Click sqlconn.ConnectionString = user id=sa;password=;initial catalog=重庆新华电脑学校图书管理系统;data source=(local) sqlconn.Open() Dim sqlcomm As New SqlCommand Dim sqlds As New DataSet Dim sqldapt As New SqlDataAdapter sqlcomm.CommandText = select * from userinfo where username= & TextBoxYongHu.Text & and password= & TextBoxMiMa.Text & sqlcomm.Connection = sqlconn sqldapt.SelectCommand = sqlcomm sqldapt.Fill(sqlds, userinfo) If sqlds.Tables(userinfo).Rows.Count = 0 Then If MessageBox.Show(用户名或密码错误, 错误提示, MessageBoxButtons.OK, MessageBoxIcon.Error) = Windows.Forms.DialogResult.OK Then TextBoxYongHu.Text = TextBoxMiMa.Text = sqlconn.Close() End If Else biaozhi = True Me.Close() FormZhuJieMian.ToolStripStatusLabel2.Text = Me.TextBoxYongHu.Text End If End Sub Private Sub FormDengLu_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If biaozhi = False Then End End If End Sub Private Sub FormDengLu_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown TextBoxYongHu.Focus() Me.PictureBox1.Image = New Bitmap(Application.StartupPath & picturedenglu.jpg) Me.BackgroundImage = New Bitmap(Application.StartupPath & picturebackgroudimage.jpg) Label1.Image = New Bitmap(Application.StartupPath & picturebackgroudimage.jpg) Label1.Text = 用户登录提示: & vbCrLf & vbCrLf & 系统默认用户名 & vbCrLf & vbCrLf & admin,密码admin Label1.Image = New Bitmap(Application.StartupPath & picturebackgroudimage.jpg) GroupBox1.BackgroundImage = New Bitmap(Application.StartupPath & picturebackgroudimage.jpg) End Sub Private Sub ButtonTuiChu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonTuiChu.Click End End SubEnd Class版本说明窗体代码:Public Class FormBanBenShuoMing Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked System.Diagnostics.Process.Start(/ylinuxs) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() End SubEnd Class打印窗体代码:Public Class FormTuShuDaYin Public biaozi As Boolean Private Sub ButtonYeMianSheZhi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonYeMianSheZhi.Click PageSetupDialog1.Document = PrintDocument1 PageSetupDialog1.ShowDialog() End Sub Private Sub ButtonYuLan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonYuLan.Click PrintPreviewDialog1.Document = PrintDocument1 PrintPreviewDialog1.ShowDialog() End Sub Private Sub ButtonDaYin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDaYin.Click PrintDialog1.Document = PrintDocument1 PrintDialog1.AllowSomePages = True PrintDialog1.AllowCurrentPage = True PrintDialog1.AllowSelection = True If PrintDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then PrintDocument1.Print() End If End Sub Private Sub ButtonYeMeiJiao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonYeMeiJiao.Click FormYeMeiJiao.ShowDialog() End Sub Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim w, h, x, y As Integer Dim PrintHeight As Integer Dim PrintLeft, PrintTop As Integer Dim CellWidth, Cellheight As Integer Dim k As Integer Dim i As Integer Static j As Integer If biaozi = True Then If FormYeMeiJiao.TextBoxYeMei.Text Then w = e.PageBounds.Width h = e.MarginBounds.Top y = h / 2 - FormYeMeiJiao.TextBoxYeMei.Font.Height / 2 x = w / 2 - (FormYeMeiJiao.TextBoxYeMei.TextLength * FormYeMeiJiao.TextBoxYeMei.Font.Height) / 2 e.Graphics.DrawString(FormYeMeiJiao.TextBoxYeMei.Text, FormYeMeiJiao.TextBoxYeMei.Font, Brushes.Blue, x, y) End If If FormYeMeiJiao.TextBoxYeJiao.Text Then w = e.PageBounds.Width h = e.PageBounds.Height - e.MarginBounds.Bottom y = h / 2 - FormYeMeiJiao.TextBoxYeJiao.Font.Height / 2 + e.MarginBounds.Bottom x = w / 2 - (FormYeMeiJiao.TextBoxYeJiao.TextLength * FormYeMeiJiao.TextBoxYeJiao.Font.Height) / 2 e.Graphics.DrawString(FormYeMeiJiao.TextBoxYeJiao.Text, FormYeMeiJiao.TextBoxYeJiao.Font, Brushes.Blue, x, y) End If PrintTop = e.MarginBounds.Top PrintLeft = e.MarginBounds.Left For k = 0 To FormTuShuGuanLi.DataGridView1.Columns.Count - 1 e.Graphics.DrawString(FormTuShuGuanLi.DataGridView1.Columns(k).HeaderText, FormTuShuGuanLi.DataGridView1.Font, Brushes.Red, PrintLeft, PrintTop) CellWidth = FormTuShuGuanLi.DataGridView1.Columns(k).Width Cellheight = FormTuShuGuanLi.DataGridView1.ColumnHeadersHeight e.Graphics.DrawRectangle(Pens.Blue, PrintLeft, PrintTop, CellWidth, Cellheight) PrintLeft = PrintLeft + FormTuShuGuanLi.DataGridView1.Columns(k).Width Next PrintTop = PrintTop + FormTuShuGuanLi.DataGridView1.ColumnHeadersHeight PrintHeight = FormTuShuGuanLi.DataGridView1.ColumnHeadersHeight i列下标的变化范围, j行下标的变化范围 Do While j = e.MarginBounds.Height Then Exit Do End If Loop If j = FormTuShuGuanLi.DataGridView1.Rows.Count - 1 Then e.HasMorePages = True Else e.HasMorePages = False j = 0 End If Else Dim w, h, x, y As Integer If FormYeMeiJiao.TextBoxYeMei.Text Then w = e.PageBounds.Width h = e.MarginBounds.Top y = h / 2 - FormYeMeiJiao.TextBoxYeMei.Font.Height / 2 x = w / 2 - (FormYeMeiJiao.TextBoxYeMei.TextLength * FormYeMeiJiao.TextBoxYeMei.Font.Height) / 2 e.Graphics.DrawString(FormYeMeiJiao.TextBoxYeMei.Text, FormYeMeiJiao.TextBoxYeMei.Font, Brushes.Blue, x, y) End If If FormYeMeiJiao.TextBoxYeJiao.Text Then w = e.PageBounds.Width h = e.PageBounds.Height - e.MarginBounds.Bottom y = h / 2 - FormYeMeiJiao.TextBoxYeJiao.Font.Height / 2 + e.MarginBounds.Bottom x = w / 2 - (FormYeMeiJiao.TextBoxYeJiao.TextLength * FormYeMeiJiao.TextBoxYeJiao.Font.Height) / 2 e.Graphics.DrawString(FormYeMeiJiao.TextBoxYeJiao.Text, FormYeMeiJiao.TextBoxYeJiao.Font, Brushes.Blue, x, y) End If Dim PrintHeight As Integer Dim PrintLeft, PrintTop As Integer PrintTop = e.MarginBounds.Top PrintLeft = e.MarginBounds.Left Dim CellWidth, Cellheight As Integer Dim k As Integer For k = 0 To FormDuZheGuanLi.DataGridView1.Columns.Count - 1 e.Graphics.DrawString(FormDuZheGuanLi.DataGridView1.Columns(k).HeaderText, FormDuZheGuanLi.DataGridView1.Font, Brushes.Red, PrintLeft, PrintTop) CellWidth = FormDuZheGuanLi.DataGridView1.Columns(k).Width Cellheight = FormDuZheGuanLi.DataGridView1.ColumnHeadersHeight e.Graphics.DrawRectangle(Pens.Blue, PrintLeft, PrintTop, CellWidth, Cellheight) PrintLeft = PrintLeft + FormDuZheGuanLi.DataGridView1.Columns(k).Width Next PrintTop = PrintTop + FormDuZheGuanLi.DataGridView1.ColumnHeadersHeight PrintHeight = FormDuZheGuanLi.DataGridView1.ColumnHeadersHeight Dim i As Integer Static j As Integer i列下标的变化范围, j行下标的变化范围 Do While j = e.MarginBounds.Height Then Exit Do End If Loop If j = FormDuZheGuanLi.DataGridView1.Rows.Count - 1 Then e.HasMorePages = True Else e.HasMorePages = False j = 0 End If End If End Sub Private Sub ButtonQuXiao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonQuXiao.Click Me.Close() End SubEnd Class读者查询打印窗体代码:Public Class FormDuZheChaXunDaYin Public biaozi As Boolean Private Sub ButtonYeMianSheZhi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonYeMianSheZhi.Click PageSetupDialog1.Document = PrintDocument1 PageSetupDialog1.ShowDialog() End Sub Private Sub ButtonYuLan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonYuLan.Click PrintPreviewDialog1.Document = PrintDocument1 PrintPreviewDialog1.ShowDialog() End Sub Private Sub ButtonDaYin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDaYin.Click PrintDialog1.Document = PrintDocument1 PrintDialog1.AllowSomePages = True PrintDialog1.AllowCurrentPage = True PrintDialog1.AllowSelection = True If PrintDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then PrintDocument1.Print() End If End Sub Private Sub ButtonYeMeiJiao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonYeMeiJiao.Click FormYeMeiJiao.ShowDialog() End Sub Private Sub ButtonQuXiao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonQuXiao.Click Me.Close() End Sub Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim w, h, x, y As Integer Dim PrintHeight As Integer Dim PrintLeft, PrintTop As Integer Dim CellWidth, Cellheight As Integer Dim i As Integer Dim k As Integer Static j As Integer If biaozi = True Then If FormYeMeiJiao.TextBoxYeMei.Text Then w = e.PageBounds.Width h = e.MarginBounds.Top y = h / 2 - FormYeMeiJiao.TextBoxYeMei.Font.Height / 2 x = w / 2 - (FormYeMeiJiao.TextBoxYeMei.TextLength * FormYeMeiJiao.TextBoxYeMei.Font.Height) / 2 e.Graphics.DrawString(FormYeMeiJiao.TextBoxYeMei.Text, FormYeMeiJiao.TextBoxYeMei.Font, Brushes.Blue, x, y) End If If FormYeMeiJiao.TextBoxYeJiao.Text Then w = e.PageBounds.Width h = e.PageBounds.Height - e.MarginBounds.Bottom y = h / 2 - FormYeMeiJiao.TextBoxYeJiao.Font.Height / 2 + e.MarginBounds.Bottom x = w / 2 - (FormYeMeiJiao.TextBoxYeJiao.TextLength * FormYeMeiJiao.TextBoxYeJiao.Font.Height) / 2 e.Graphics.DrawString(FormYeMeiJiao.TextBoxYeJiao.Text, FormYeMeiJiao.TextBoxYeJiao.Font, Brushes.Blue, x, y) End If PrintTop = e.MarginBounds.Top PrintLeft = e.MarginBounds.Left For k = 0 To FormDuZheGuaShiChaXun.DataGridView1.Columns.Count - 1 e.Graphics.DrawString(FormDuZheGuaShiChaXun.DataGridView1.Columns(k).HeaderText, FormDuZheGuaShiChaXun.DataGridView1.Font, Brushes.Red, PrintLeft, PrintTop) CellWidth = FormDuZheGuaShiChaXun.DataGridView1.Columns(k).Width Cellheight = FormDuZheGuaShiChaXun.DataGridView1.ColumnHeadersHeight e.Graphics.DrawRectangle(Pens.Blue, PrintLeft, PrintTop, CellWidth, Cellheight) PrintLeft = PrintLeft + FormDuZheGuaShiChaXun.DataGridView1.Columns(k).Width Next PrintTop = PrintTop + FormDuZheGuaShiChaXun.DataGridView1.ColumnHeadersHeight PrintHeight = FormDuZheGuaShiChaXun.DataGridView1.ColumnHeadersHeight i列下标的变化范围, j行下标的变化范围 Do While j = e.MarginBounds.Height Then Exit Do End If Loop If j = FormDuZheGuaShiChaXun.DataGridView1.Rows.Count - 1 Then e.HasMorePages = True Else e.HasMorePages = False j = 0 End If Else If FormYeMeiJiao.TextBoxYeMei.Text Then w = e.PageBounds.Width h = e.MarginBounds.Top y = h / 2 - FormYeMeiJiao.TextBoxYeMei.Font.Height / 2 x = w / 2 - (FormYeMeiJiao.TextBoxYeMei.TextLength * FormYeMeiJiao.TextBoxYeMei.Font.Height) / 2 e.Graphics.DrawString(FormYeMeiJiao.TextBoxYeMei.Text, FormYeMeiJiao.TextBoxYeMei.Font, Brushes.Blue, x, y) End If If FormYeMeiJiao.TextBoxYeJiao.Text Then w = e.PageBounds.Width h = e.PageBounds.Height - e.MarginBounds.Bottom y = h / 2 - FormYeMeiJiao.TextBoxYeJiao.Font.Height / 2 + e.MarginBounds.Bottom x = w / 2 - (FormYeMeiJiao.TextBoxYeJiao.TextLength * FormYeMeiJiao.TextBoxYeJiao.Font.Height) / 2 e.Graphics.DrawString(FormYeMeiJiao.TextBoxYeJiao.Text, FormYeMeiJiao.TextBoxYeJiao.Font, Brushes.Blue, x, y) End If PrintTop = e.MarginBounds.Top PrintLeft = e.MarginBounds.Lef

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论