您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->个人图书管理系统源码>>App-Code/BusinessLogicLayer/Borrow.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:个人图书管理系统源码
当前文件:文件类型 MyLibary/App_Code/BusinessLogicLayer/Borrow.cs打开代码结构图
高亮显示
		            using System;
using System.Data;
using System.Collections;
using System.Data.SqlClient;
using MyLibrary.DataAccessLayer;
using MyLibrary.DataAccessHelper;


namespace MyLibrary.BusinessLogicLayer
{
    //用户类
    public class Borrow
    {
        #region 私有成员
        private int _borrowID;                                              //借书号
        private string _userID;                                             //用户编号
        private int _bookID;                                                //书号
        private DateTime _borrowBeginDate;                                  //借书时间
        private DateTime _borrowEndDate;                                    //还书时间
        private int _borrowState;                                           //借书状态:0表示不在馆,1表示在馆        

        #endregion 私有成员

        #region 属性

        public int BorrowID
        {
            set
            {
                this._borrowID = value;
            }
            get
            {
                return this._borrowID;
            }
        }
        public string UserID
        {
            set
            {
                this._userID = value;
            }
            get
            {
                return this._userID;
            }
        }        
        public int BookID
        {
            set
            {
                this._bookID = value;
            }
            get
            {
                return this._bookID;
            }
        }        
        public DateTime BorrowBeginDate
        {
            set
            {
                this._borrowBeginDate = value;
            }
            get
            {
                return this._borrowBeginDate;
            }
        }
        public DateTime BorrowEndDate
        {
            set
            {
                this._borrowEndDate = value;
            }
            get
            {
                return this._borrowEndDate;
            }
        }
        public int BorrowState
        {
            set
            {
                this._borrowState = value;
            }
            get
            {
                return this._borrowState;
            }
        }        

        #endregion 属性

        #region 方法

        //向Borrow表中添加借阅信息(借书)
        //输出:
        //      插入成功:返回True;
        //      插入失败:返回False;
        public bool InsertByProc()
        {
            SqlParameter[] Params = new SqlParameter[5];

            DataBase DB = new DataBase();

            Params[0] = DB.MakeInParam("@UserID", SqlDbType.VarChar, 50, UserID);                   //用户编号
            Params[1] = DB.MakeInParam("@BookID", SqlDbType.Int , 4, BookID);                       //书号
            Params[2] = DB.MakeInParam("@BorrowBeginDate", SqlDbType.DateTime, 8, BorrowBeginDate); //借阅时间
            Params[3] = DB.MakeInParam("@BorrowEndDate", SqlDbType.DateTime, 8, BorrowEndDate);     //还书时间
            Params[4] = DB.MakeInParam("@BorrowState", SqlDbType.Int, 4, BorrowState);              //借书状态
            
            int Count = -1;
            Count = DB.RunProc("Proc_BorrowAdd", Params);
            if (Count > 0)
                return true;
            else return false;
        }

        //还书
        public bool UpdateByProc(int XBookID)
        {
            SqlParameter[] Params = new SqlParameter[2];
            DataBase DB = new DataBase();           
            Params[0] = DB.MakeInParam("@BookID", SqlDbType.Int, 4, BookID);                       //书号           
            Params[1] = DB.MakeInParam("@BorrowState", SqlDbType.Int, 4, BorrowState);              //借书状态

            int Count = -1;
            Count = DB.RunProc("Proc_ReturnBook", Params);
            if (Count > 0)
                return true;
            else return false;
        }        

        //查询借阅历史        
        public DataSet QueryBorrowHistory(string XUserID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase DB = new DataBase();
            Params[0] = DB.MakeInParam("@UserID", SqlDbType.VarChar, 50, XUserID);                       //书号            
            return DB.GetDataSet("Proc_ReaderBorrowHistory",Params);
        }

        //查询目前借阅图书        
        public DataSet QueryCurrentBorrow(string XUserID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase DB = new DataBase();
            Params[0] = DB.MakeInParam("@UserID", SqlDbType.VarChar, 50, XUserID);                       //书号            
            return DB.GetDataSet("Proc_ReaderCurrentBorrow", Params);
        }

        //查询超期该还图书        
        public DataSet QueryExpireBorrow(string XUserID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase DB = new DataBase();
            Params[0] = DB.MakeInParam("@UserID", SqlDbType.VarChar, 50, XUserID);                       //书号            
            return DB.GetDataSet("Proc_ReaderExpireCuiHuan", Params);
        }

        //查询目前借阅图书数量        
        public int QueryCurrentBorrowCount(string XUserID)
        {
            SqlParameter[] Params = new SqlParameter[1];
            DataBase DB = new DataBase();
            Params[0] = DB.MakeInParam("@UserID", SqlDbType.VarChar, 50, XUserID);                       //书号            
            return DB.RunProcGetCount("Proc_ReaderCurrentBorrowCount", Params);
        }

        #endregion 方法
    }
}


        
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:个人图书管理系统源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号