📄 eventinfo.cs
字号:
namespace ASPNET.StarterKit.Communities.Events {
using System;
using System.Data.SqlClient;
//*********************************************************************
//
// EventInfo Class
//
// Represents all information about a particular event.
//
//*********************************************************************
public class EventInfo : ContentInfo {
string _link = String.Empty;
string _fullDescription;
string _location;
string _speaker;
string _speakerBiography;
DateTime _date;
DateTime _dateVisible;
int _imageID = -1;
string _imageName = String.Empty;
//*********************************************************************
//
// EventInfo Constructor
//
// Initializes event information from a SqlDataReader.
//
//*********************************************************************
public EventInfo(SqlDataReader dr) : base(dr) {
// Populate required fields
_date = (DateTime)dr["ContentPage_SortOrder"];
_dateVisible = (DateTime)dr["ContentPage_DateVisible"];
_location = (string)dr["Event_Location"];
_speaker = (string)dr["Event_Speaker"];
_speakerBiography = (string)dr["Event_SpeakerBiography"];
// Populate optional fields
if (dr["Event_Link"] != DBNull.Value)
_link = (string)dr["Event_Link"];
if (dr["Event_FullDescription"] != DBNull.Value)
_fullDescription = (string)dr["Event_FullDescription"];
if (dr["Image_ID"] != DBNull.Value)
_imageID = (int)dr["Image_ID"];
if (dr["Image_FileName"] != DBNull.Value)
_imageName = (string)dr["Image_FileName"];
}
//*********************************************************************
//
// Date Property
//
// The date of the event.
//
//*********************************************************************
public DateTime Date {
get {return _date;}
set {_date = value;}
}
//*********************************************************************
//
// DateVisible Property
//
// The date when the event will be displayed.
//
//*********************************************************************
public DateTime DateVisible {
get {return _dateVisible;}
set {_dateVisible = value;}
}
//*********************************************************************
//
// Link Property
//
// The URL for additional event information.
//
//*********************************************************************
public string Link {
get {return _link;}
set {_link = value;}
}
//*********************************************************************
//
// FullDescription Property
//
// The full description of the event.
//
//*********************************************************************
public string FullDescription {
get {return _fullDescription;}
set {_fullDescription = value;}
}
//*********************************************************************
//
// Location Property
//
// The location of the event.
//
//*********************************************************************
public string Location {
get {return _location;}
set {_location = value;}
}
//*********************************************************************
//
// Speaker Property
//
// The speaker for the event.
//
//*********************************************************************
public string Speaker {
get {return _speaker;}
set {_speaker = value;}
}
//*********************************************************************
//
// SpeakerBiography Property
//
// The speaker biography.
//
//*********************************************************************
public string SpeakerBiography {
get {return _speakerBiography;}
set {_speakerBiography = value;}
}
//*********************************************************************
//
// ImageID Property
//
// The id of an image associated with the event.
//
//*********************************************************************
public int ImageID {
get {return _imageID;}
set {_imageID = value;}
}
//*********************************************************************
//
// ImageName Property
//
// The name of an image associated with the event.
//
//*********************************************************************
public string ImageName {
get {return _imageName;}
set {_imageName = value;}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -