基本信息
源码名称:C#图书馆管理系统(源码+数据库)
源码大小:3.50M
文件格式:.rar
开发语言:C#
更新时间:2019-07-09
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 5 元 
   源码介绍
实现图书馆图书的增删改查等功能,数据库脚本在 C#图书管理系统项目源码\BookManageSystem\BookDB.sql 文件中


        private void tv_BookType_AfterSelect(object sender, TreeViewEventArgs e)
        {
            Select_OnTypeName();
        }

        /// <summary>
        /// 由当前选中的类型查询图书信息
        /// </summary>
        public void Select_OnTypeName()
        {
            lv_bookinfo.Items.Clear();

            if (tv_BookType.SelectedNode.Tag is BookTypeInfo)
            {
                tv_BookType.SelectedImageIndex = 1;
                List<BookInfo> list = new List<BookInfo>();

                try
                {
                    //获取当前选中节点,查询图书信息
                    list = BookInfoManage.SelectOnBookTypeName(tv_BookType.SelectedNode.Text);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                foreach (BookInfo bi in list)
                {
                    //循环遍历List,将数据加载到ListView控件
                    ListViewItem item = new ListViewItem(bi.BookID.ToString());
                    item.Tag = bi;
                    item.SubItems.Add(bi.BookName);
                    item.SubItems.Add(bi.BookTypeName);
                    item.SubItems.Add(bi.Author);
                    item.SubItems.Add(bi.Press);
                    item.SubItems.Add(bi.PubDate);
                    item.SubItems.Add(bi.Pricing.ToString());
                    item.SubItems.Add(bi.Page.ToString());
                    lv_bookinfo.Items.Add(item);
                }
            }
            else
            {
                Select_AllBookInfo();
            }
        }

        /// <summary>
        /// 如果选中的行数大于0,则查询当前行数据
        /// </summary>
        private void lv_bookinfo_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (lv_bookinfo.SelectedItems.Count > 0)
                {
                    int index = Convert.ToInt32(lv_bookinfo.SelectedItems[0].Text);

                    BookInfo bi = BookInfoManage.SelectOnBookId(index);

                    imageList1.Images.Clear();
                    imageList1.ImageSize = new Size(194, 154);
                    imageList1.Images.Add(Image.FromFile(Directory.GetCurrentDirectory() @"\bookimg\" bi.CoverImage));

                    ptb_bimg.Image = imageList1.Images[0];
                    txt_BookSum.Text = bi.Summary;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }