?? productinfo.cs
字號:
?using System;
/// <summary>
/// 圖書的基本信息
/// </summary>
[Serializable]
public class ProductInfo
{
// 內部變量
private int id;
private string name;
private string description;
private string image;
private int categoryId;
/// <summary>
/// 默認構造函數
/// </summary>
public ProductInfo() { }
/// <summary>
/// 帶參數的構造函數
/// </summary>
/// <param name="id">圖書ID</param>
/// <param name="name">書名</param>
/// <param name="description">圖書簡介</param>
/// <param name="image">封面地址</param>
/// <param name="categoryId">所屬目錄ID</param>
public ProductInfo(int id, string name, string description, string image, int categoryId)
{
this.id = id;
this.name = name;
this.description = description;
this.image = image;
this.categoryId = categoryId;
}
// 公共屬性
public int Id
{
get { return id; }
set { id = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
public string Description
{
get { return description; }
set { description = value; }
}
public string Image
{
get { return image; }
set { image = value; }
}
public int CategoryId
{
get { return categoryId; }
set { categoryId = value; }
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -