using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text; using Newtonsoft.Json; using POSV.Utils; namespace POSV.Bean { [Serializable] [JsonObject(MemberSerialization.OptIn)] public class ShoppingCartItem : IEquatable { private List _rows =new List(); /// /// 品类显示颜色1 /// [JsonProperty(PropertyName = "rows")] public List Rows { get { return this._rows; } set { this._rows = value; } } private int _rowHeight = 20; /// /// 行高度 /// [JsonProperty(PropertyName = "height")] public int RowHeight { get { return this._rowHeight; } set { this._rowHeight = (value <= 0 ? 20 : value); } } private string _textColor = ColorTranslator.ToHtml(Color.White); /// /// 字体显示颜色 /// [JsonProperty(PropertyName = "tcolor")] public string TextColor { get { return this._textColor; } set { this._textColor = value; } } private SystemFont _titleFont = SystemFont.大字; /// /// 品项的字体 /// [JsonProperty(PropertyName = "font")] public SystemFont TitleFont { get { return this._titleFont; } set { this._titleFont = value; } } private string _titleColor = ColorTranslator.ToHtml(Color.Black); /// /// 品类显示颜色 /// [JsonProperty(PropertyName = "bcolor")] public string TitleColor { get { return this._titleColor; } set { this._titleColor = value; } } public bool Equals(ShoppingCartItem other) { if (other == null) { return false; } return JsonUtils.Serialize(this).Equals(JsonUtils.Serialize(other)); } } /// /// 订单列设置呈现对应的实体类 /// [Serializable] [JsonObject(MemberSerialization.OptIn)] public class CartRow : IEquatable { /// /// 显示序号 /// [JsonProperty(PropertyName = "order")] public int Order { get; set; } /// /// 名称 /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// 对应的数据 /// [JsonProperty(PropertyName = "text")] public string Text { get; set; } /// /// 别名 /// [JsonProperty(PropertyName = "alias")] public string Alias { get; set; } /// /// 是否显示 /// [JsonProperty(PropertyName = "display")] public bool Display { get; set; } /// /// 最小宽度 /// [JsonProperty(PropertyName = "width")] [DefaultValue(80)] public long Width { get; set; } public bool Equals(CartRow obj) { if (obj == null) { return false; } return JsonUtils.Serialize(this).Equals(JsonUtils.Serialize(obj)); } } }