⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bookinfo.cs

📁 一个ASP.NET下的中文内容管理和社区系统
💻 CS
字号:
namespace ASPNET.StarterKit.Communities.Books {

	using System;
	using System.Data.SqlClient;


    //*********************************************************************
    //
    // BookInfo Class
    //
    // Represents all information about a particular book. 
    //
    //*********************************************************************

	public class BookInfo : ContentInfo {

        string _bookAuthor;
		string _fullDescription;
		string _isbn;
		string _purchaseLink;
		decimal _price;
		int _imageID = -1;
		string _imageName = String.Empty;
        string _publisher = String.Empty;
        string _publisherLink = String.Empty;
        DateTime _publicationDate;		
        


        //*********************************************************************
        //
        // BookInfo Constructor
        //
        // Initializes book information from a SqlDataReader. 
        //
        //*********************************************************************

        public BookInfo(SqlDataReader dr) : base(dr) {
            // Populate required fields
            _bookAuthor = (string)dr["Book_Author"];
            _price = (decimal)dr["Book_Price"];
            _publicationDate = (DateTime)dr["Book_PublicationDate"];
            _publisher = (string)dr["Book_Publisher"];
            _publisherLink = (string)dr["Book_PublisherLink"];
            _isbn = (string)dr["Book_ISBN"];
            _purchaseLink = (string)dr["Book_PurchaseLink"];
        
            // Populate optional fields
            if (dr["Image_ID"] != DBNull.Value)
                _imageID = (int)dr["Image_ID"];
            if (dr["Image_FileName"] != DBNull.Value)
                _imageName = (string)dr["Image_FileName"];
            if (dr["Book_FullDescription"] != DBNull.Value)
                _fullDescription = (string)dr["Book_FullDescription"];
            
        }



        //*********************************************************************
        //
        // Author Property
        //
        // Represents the author of a book.
        //
        //*********************************************************************

		public string BookAuthor {
			get {return _bookAuthor;}
			set {_bookAuthor = value;}
		}



        //*********************************************************************
        //
        // FullDescription Property
        //
        // Represents the full description of a book.
        //
        //*********************************************************************

		public string FullDescription {
			get {return _fullDescription;}
			set {_fullDescription = value;}
		}

        
        //*********************************************************************
        //
        // ISBN Property
        //
        // Represents the ISBN number of a book.
        //
        //*********************************************************************

		public string ISBN {
			get {return _isbn;}
			set {_isbn = value;}
		}

		
        //*********************************************************************
        //
        // PurchaseLink Property
        //
        // Represents a URL to a location where the book can be purchased.
        //
        //*********************************************************************
		
		public string PurchaseLink {
			get {return _purchaseLink;}
			set {_purchaseLink = value;}
		}


        //*********************************************************************
        //
        // Price Property
        //
        // Represents the price of a book.
        //
        //*********************************************************************

		public decimal Price {
			get {return _price;}
			set {_price = value;}
		}


        //*********************************************************************
        //
        // ImageID Property
        //
        // Represents the id of the image of the book cover.
        //
        //*********************************************************************

		public int ImageID {
			get {return _imageID;}
			set {_imageID = value;}
		}


        //*********************************************************************
        //
        // ImageName Property
        //
        // Represents the the name of the image of the book cover.
        //
        //*********************************************************************

		public string ImageName {
			get {return _imageName;}
			set {_imageName = value;}
		}


        //*********************************************************************
        //
        // Publisher Property
        //
        // Represents the name of the book publisher.
        //
        //*********************************************************************
        
        public string Publisher {
            get {return _publisher;}
            set {_publisher = value;}
        }

        
        //*********************************************************************
        //
        // PublisherLink Property
        //
        // Represents a link to the book publisher.
        //
        //*********************************************************************
        
        public string PublisherLink {
            get {return _publisherLink;}
            set {_publisherLink = value;}
        }

        
        //*********************************************************************
        //
        // PublicationDate Property
        //
        // Represents the date when the book was published.
        //
        //*********************************************************************
        
        public DateTime PublicationDate {
            get {return _publicationDate;}
            set {_publicationDate = value;}
        }



	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -