?? lineiteminfo.cs
字號:
?using System;
/// <summary>
/// 訂單中某條記錄的具體信息
/// </summary>
[Serializable]
public class LineItemInfo
{
// 內部變量
private int id;
private string productName;
private int line;
private int quantity;
private decimal price;
/// <summary>
/// 默認的構造函數
/// </summary>
public LineItemInfo() { }
/// <summary>
/// 帶參數的構造函數
/// </summary>
/// <param name="id">購物籃中的項目ID</param>
/// <param name="line">行號</param>
/// <param name="qty">訂單中的數量</param>
/// <param name="price">訂單中的價格</param>
public LineItemInfo(int id, string name, int line, int qty, decimal price)
{
this.id = id;
this.productName = name;
this.line = line;
this.price = price;
this.quantity = qty;
}
// 公共屬性
public int ItemId
{
get { return id; }
set { id = value; }
}
public string Name
{
get { return productName; }
set { productName = value; }
}
public int Line
{
get { return line; }
set { line = value; }
}
public int Quantity
{
get { return quantity; }
set { quantity = value; }
}
public decimal Price
{
get { return price; }
set { price = value; }
}
public decimal Subtotal
{
get { return price * quantity; }
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -