资源简介

.net图书管理系统源码

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using BooksManager.IDAL;
using BooksManager.Models;
using BooksManager.DBUtility;
using System.Data;
using System.Data.OleDb;
using System.IO;

namespace BooksManager.AccessDAL
{
    public class BookService : IBookService
    {
        private string PhotoFilePath = ““;
        private readonly string connString = System.Configuration.ConfigurationSettings.AppSettings[“AccessConnString“].ToString();
        
        #region 书籍信息表

        #region 增加一条书籍信息
        public bool InsertBook(Book book)
        {
            int result = -1;
            int num = -1;
            try
            {
                string strOleDb = “INSERT INTO BookInfo (BCode BName BIsbn BAuthor BPrice BType BPublishNameBPublishAddressBPublishDateBStoreBLanguageBWithBSpacePointBFormatBPrintTimesBCopyframeBPageBIntoTimeBstateBRemark) VALUES (‘“ + book.BCode + “‘‘“ + book.BName + “‘‘“ + book.BIsbn + “‘‘“ + book.BAuthor + “‘‘“ + book.BPrice + “‘‘“ + book.BType + “‘ ‘“ + book.BPublishName + “‘ ‘“ + book.BPublishAddress + “‘‘“ + book.BPublishDate + “‘“ + book.BStore + “ ‘“ + book.BLanguage + “‘‘“ + book.BWith + “‘‘“ + book.BSpacePoint + “‘‘“ + book.BFormat + “‘ ‘“ + book.BPrintTimes + “‘ ‘“ + book.BCopyframe + “‘“ + book.BPage + “‘“ + book.BIntoTime + “‘ “ + book.Bstate + “ ‘“ + book.BRemark + “‘)“;

                result = AccessHelper.executeNonQuery(strOleDb);
                AccessHelper.InsertImageToDB(“update BookInfo set BPhoto=@BPhoto where BCode=‘“ + book.BCode + “‘“ “@BPhoto“ book.BPhoto);
            }
            catch (Exception)
            {

                throw;
            }
            if (result > 0)
            {
                return true;
            }
            else
            {
                return false;
            }

        }
        #endregion

        #region 删除一条书籍信息
        public bool DelBook(string Id)
        {
            int result = -1;
            try
            {
                string strOleDb = “delete from BookInfo where Id= “ + Id + “ “;
                result = AccessHelper.executeNonQuery(strOleDb);
            }
            catch (Exception)
            {

                throw;
            }
            if (result > 0)
            {
                return true;
            }
            else
            {
                return false;
            }

        }

        #endregion

        #region 更新书籍信息
        public int ModifyBook(Book book)
        {
            int num = -2;
            
            using (OleDbConnection conn = new OleDbConnection(connString))
            {
                string sql = “update BookInfo set BCode=‘“ + book.BCode + “‘BName=‘“ + book.BName + “‘BIsbn=‘“ + book.BIsbn + “‘BAuthor=‘“ + book.BAuthor + “‘BPrice=‘“ + book.BPrice + “‘BType=‘“ + book.BType + “‘ BPublishName=‘“ + book.BPublishName + “‘

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-08-26 09:22  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\
     目录           0  2010-08-25 09:36  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\
     文件        2930  2010-06-13 23:16  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\AccessDAL.csproj
     文件         168  2010-06-13 23:16  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\AccessDAL.csproj.user
     目录           0  2010-08-25 09:36  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\
     目录           0  2010-08-25 09:37  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\Debug\
     文件       36352  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\Debug\AccessDAL.dll
     文件       75264  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\Debug\AccessDAL.pdb
     文件       15872  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\Debug\DBUtility.dll
     文件       65024  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\Debug\DBUtility.pdb
     文件        5120  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\Debug\IDAL.dll
     文件        7680  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\Debug\IDAL.pdb
     文件       13312  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\Debug\Model.dll
     文件       79360  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\bin\Debug\Model.pdb
     文件       19088  2008-05-22 17:57  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\BookService.cs
     文件        5465  2008-05-22 00:59  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\BookTypeService.cs
     文件       17994  2008-05-22 01:33  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\BorrowInfoService.cs
     目录           0  2010-08-25 09:36  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\
     文件         274  2008-05-22 18:03  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\AccessDAL.csproj.FileList.txt
     文件        2429  2008-05-22 18:44  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\AccessDAL.csproj.FileListAbsolute.txt
     目录           0  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\Debug\
     文件        3396  2010-08-25 14:19  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\Debug\AccessDAL.csproj.FileListAbsolute.txt
     文件       36352  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\Debug\AccessDAL.dll
     文件       75264  2010-08-25 10:47  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\Debug\AccessDAL.pdb
     目录           0  2010-08-25 09:36  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\Debug\Refactor\
     文件       16384  2008-05-22 17:37  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\Debug\Refactor\AccessDAL.dll
     文件        7387  2008-03-07 15:49  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\Debug\ResolveAssemblyReference.cache
     目录           0  2013-08-07 08:42  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\obj\Debug\TempPE\
     目录           0  2010-08-25 09:36  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\Properties\
     文件        1313  2008-03-04 14:14  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\Properties\AssemblyInfo.cs
     文件       10695  2008-05-22 17:52  lotus0126BooksManager_75a48900-d840-455c-be9d-725917ca9bf3\AccessDAL\ReaderService.cs
............此处省略842个文件信息

评论

共有 条评论