📄 inventory.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace HardwareDistributor.Business
{
public class Inventory
{
private int _inventoryId;
private string _inventoryName;
private byte[] _picture;
private decimal _price;
private int _inStock;
private int _distributionCenter;
private int _bin;
private MemoryStream _ms;
public Inventory() { }
public Inventory(int inventoryId, string inventoryName, byte[] picture, decimal price, int inStock, int distributionCenter, int bin)
{
this._inventoryId = inventoryId;
this._inventoryName = inventoryName;
this._picture = picture;
this._price = price;
this._inStock = inStock;
this._distributionCenter = distributionCenter;
this._bin = bin;
}
/// <summary>
/// Unique Inventory Id
/// </summary>
public int InventoryId
{
get
{
return _inventoryId;
}
set
{
_inventoryId = value;
}
}
/// <summary>
/// Name of the Inventory Item
/// </summary>
public string InventoryName
{
get
{
return _inventoryName;
}
set
{
_inventoryName = value;
}
}
/// <summary>
/// Byte Array to hold the Inventory image
/// </summary>
public byte[] Picture
{
get
{
return _picture;
}
set
{
_picture = value;
}
}
/// <summary>
/// Returns the Picture byte array as a MemoryStream
/// that can be displayed in a PictureBox
/// </summary>
public MemoryStream PictureAsStream
{
get
{
_ms = new MemoryStream(_picture);
return _ms;
}
}
/// <summary>
/// Price of the Inventory item
/// </summary>
public decimal Price
{
get
{
return _price;
}
set
{
_price = value;
}
}
/// <summary>
/// Number of Inventory Items in stock
/// </summary>
public int InStock
{
get
{
return _inStock;
}
set
{
_inStock = value;
}
}
/// <summary>
/// Id of Distribution Center
/// </summary>
public int DistributionCenter
{
get
{
return _distributionCenter;
}
set
{
_distributionCenter = value;
}
}
/// <summary>
/// Id of warehouse bin where
/// Inventory items are found
/// </summary>
public int Bin
{
get
{
return _bin;
}
set
{
_bin = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -