📄 photoinfo.cs
字号:
namespace ASPNET.StarterKit.Communities.PhotoGallery {
using System;
using System.Data.SqlClient;
//*********************************************************************
//
// PhotoInfo Class
//
// Represents all information about a particular photo.
//
//*********************************************************************
public class PhotoInfo : ContentInfo {
int _imageID;
string _imageName;
string _fullDescription;
//*********************************************************************
//
// PhotoInfo Constructor
//
// Calls base ContentInfo constructor to initialize general
// content information and then initialize photo specific
// information from a SqlDataReader.
//
//*********************************************************************
public PhotoInfo(SqlDataReader dr) : base(dr) {
// Populate required fields
_imageID = (int)dr["Image_ID"];
_imageName = (string)dr["Image_FileName"];
// Populate optional fields
if (dr["Photo_FullDescription"] != DBNull.Value)
_fullDescription = (string)dr["Photo_FullDescription"];
}
//*********************************************************************
//
// ImageID Property
//
// Represents the ID for an image.
//
//*********************************************************************
public int ImageID {
get {return _imageID;}
set {_imageID = value;}
}
//*********************************************************************
//
// ImageName Property
//
// Represents the file name of an image.
//
//*********************************************************************
public string ImageName {
get {return _imageName;}
set {_imageName = value;}
}
//*********************************************************************
//
// FullDescription Property
//
// Represents the full description of an image.
//
//*********************************************************************
public string FullDescription {
get {return _fullDescription;}
set {_fullDescription = value;}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -