using System; using System.Collections.Generic; using System.ComponentModel; using System.Runtime.Serialization; using System.Web.Script.Serialization; using System.Xml.Serialization; using XCode; using XCode.Configuration; using XCode.DataAccessLayer; namespace COMCMS.Core { /// 用户优惠券 [Serializable] [DataObject] [Description("用户优惠券")] [BindTable("MemberCoupon", Description = "用户优惠券", ConnName = "dbconn", DbType = DatabaseType.SqlServer)] public partial class MemberCoupon { #region 属性 private Int32 _Id; /// 编号 [DisplayName("编号")] [Description("编号")] [DataObjectField(true, true, false, 0)] [BindColumn("Id", "编号", "")] public Int32 Id { get => _Id; set { if (OnPropertyChanging("Id", value)) { _Id = value; OnPropertyChanged("Id"); } } } private Int32 _UId; /// 用户ID [DisplayName("用户ID")] [Description("用户ID")] [DataObjectField(false, false, false, 0)] [BindColumn("UId", "用户ID", "", Master = true)] public Int32 UId { get => _UId; set { if (OnPropertyChanging("UId", value)) { _UId = value; OnPropertyChanged("UId"); } } } private String _ItemNO; /// 券号 [DisplayName("券号")] [Description("券号")] [DataObjectField(false, false, true, 20)] [BindColumn("ItemNO", "券号", "")] public String ItemNO { get => _ItemNO; set { if (OnPropertyChanging("ItemNO", value)) { _ItemNO = value; OnPropertyChanged("ItemNO"); } } } private Int32 _CouponId; /// 优惠券ID [DisplayName("优惠券ID")] [Description("优惠券ID")] [DataObjectField(false, false, false, 0)] [BindColumn("CouponId", "优惠券ID", "")] public Int32 CouponId { get => _CouponId; set { if (OnPropertyChanging("CouponId", value)) { _CouponId = value; OnPropertyChanged("CouponId"); } } } private Int32 _CouponType; /// 优惠券类型,0 现金用券,1打折券 [DisplayName("优惠券类型")] [Description("优惠券类型,0 现金用券,1打折券")] [DataObjectField(false, false, false, 0)] [BindColumn("CouponType", "优惠券类型,0 现金用券,1打折券", "")] public Int32 CouponType { get => _CouponType; set { if (OnPropertyChanging("CouponType", value)) { _CouponType = value; OnPropertyChanged("CouponType"); } } } private Decimal _DiscuountRates; /// 打折率,只有是打折券才有用 [DisplayName("打折率")] [Description("打折率,只有是打折券才有用")] [DataObjectField(false, false, false, 0)] [BindColumn("DiscuountRates", "打折率,只有是打折券才有用", "")] public Decimal DiscuountRates { get => _DiscuountRates; set { if (OnPropertyChanging("DiscuountRates", value)) { _DiscuountRates = value; OnPropertyChanged("DiscuountRates"); } } } private Int32 _IsLimit; /// 是否有类别限制,0 无限制;1 是类别限制,2是商品限制 [DisplayName("是否有类别限制")] [Description("是否有类别限制,0 无限制;1 是类别限制,2是商品限制")] [DataObjectField(false, false, false, 0)] [BindColumn("IsLimit", "是否有类别限制,0 无限制;1 是类别限制,2是商品限制", "")] public Int32 IsLimit { get => _IsLimit; set { if (OnPropertyChanging("IsLimit", value)) { _IsLimit = value; OnPropertyChanged("IsLimit"); } } } private Decimal _Price; /// 面额 [DisplayName("面额")] [Description("面额")] [DataObjectField(false, false, false, 0)] [BindColumn("Price", "面额", "")] public Decimal Price { get => _Price; set { if (OnPropertyChanging("Price", value)) { _Price = value; OnPropertyChanged("Price"); } } } private Decimal _NeedPrice; /// 需要消费面额 [DisplayName("需要消费面额")] [Description("需要消费面额")] [DataObjectField(false, false, false, 0)] [BindColumn("NeedPrice", "需要消费面额", "")] public Decimal NeedPrice { get => _NeedPrice; set { if (OnPropertyChanging("NeedPrice", value)) { _NeedPrice = value; OnPropertyChanged("NeedPrice"); } } } private DateTime _AddTime; /// 添加时间 [DisplayName("添加时间")] [Description("添加时间")] [DataObjectField(false, false, true, 0)] [BindColumn("AddTime", "添加时间", "")] public DateTime AddTime { get => _AddTime; set { if (OnPropertyChanging("AddTime", value)) { _AddTime = value; OnPropertyChanged("AddTime"); } } } private DateTime _StartTime; /// 添加时间 [DisplayName("添加时间")] [Description("添加时间")] [DataObjectField(false, false, true, 0)] [BindColumn("StartTime", "添加时间", "")] public DateTime StartTime { get => _StartTime; set { if (OnPropertyChanging("StartTime", value)) { _StartTime = value; OnPropertyChanged("StartTime"); } } } private DateTime _EndTime; /// 添加时间 [DisplayName("添加时间")] [Description("添加时间")] [DataObjectField(false, false, true, 0)] [BindColumn("EndTime", "添加时间", "")] public DateTime EndTime { get => _EndTime; set { if (OnPropertyChanging("EndTime", value)) { _EndTime = value; OnPropertyChanged("EndTime"); } } } private Int32 _IsUse; /// 是否使用 [DisplayName("是否使用")] [Description("是否使用")] [DataObjectField(false, false, false, 0)] [BindColumn("IsUse", "是否使用", "")] public Int32 IsUse { get => _IsUse; set { if (OnPropertyChanging("IsUse", value)) { _IsUse = value; OnPropertyChanged("IsUse"); } } } private DateTime _UseTime; /// 使用时间 [DisplayName("使用时间")] [Description("使用时间")] [DataObjectField(false, false, true, 0)] [BindColumn("UseTime", "使用时间", "")] public DateTime UseTime { get => _UseTime; set { if (OnPropertyChanging("UseTime", value)) { _UseTime = value; OnPropertyChanged("UseTime"); } } } private String _OrderNum; /// 订单号(使用后) [DisplayName("订单号")] [Description("订单号(使用后)")] [DataObjectField(false, false, true, 50)] [BindColumn("OrderNum", "订单号(使用后)", "")] public String OrderNum { get => _OrderNum; set { if (OnPropertyChanging("OrderNum", value)) { _OrderNum = value; OnPropertyChanged("OrderNum"); } } } private Int32 _OrderId; /// 订单编号(使用后) [DisplayName("订单编号")] [Description("订单编号(使用后)")] [DataObjectField(false, false, false, 0)] [BindColumn("OrderId", "订单编号(使用后)", "")] public Int32 OrderId { get => _OrderId; set { if (OnPropertyChanging("OrderId", value)) { _OrderId = value; OnPropertyChanged("OrderId"); } } } #endregion #region 获取/设置 字段值 /// 获取/设置 字段值 /// 字段名 /// public override Object this[String name] { get { switch (name) { case "Id": return _Id; case "UId": return _UId; case "ItemNO": return _ItemNO; case "CouponId": return _CouponId; case "CouponType": return _CouponType; case "DiscuountRates": return _DiscuountRates; case "IsLimit": return _IsLimit; case "Price": return _Price; case "NeedPrice": return _NeedPrice; case "AddTime": return _AddTime; case "StartTime": return _StartTime; case "EndTime": return _EndTime; case "IsUse": return _IsUse; case "UseTime": return _UseTime; case "OrderNum": return _OrderNum; case "OrderId": return _OrderId; default: return base[name]; } } set { switch (name) { case "Id": _Id = value.ToInt(); break; case "UId": _UId = value.ToInt(); break; case "ItemNO": _ItemNO = Convert.ToString(value); break; case "CouponId": _CouponId = value.ToInt(); break; case "CouponType": _CouponType = value.ToInt(); break; case "DiscuountRates": _DiscuountRates = Convert.ToDecimal(value); break; case "IsLimit": _IsLimit = value.ToInt(); break; case "Price": _Price = Convert.ToDecimal(value); break; case "NeedPrice": _NeedPrice = Convert.ToDecimal(value); break; case "AddTime": _AddTime = value.ToDateTime(); break; case "StartTime": _StartTime = value.ToDateTime(); break; case "EndTime": _EndTime = value.ToDateTime(); break; case "IsUse": _IsUse = value.ToInt(); break; case "UseTime": _UseTime = value.ToDateTime(); break; case "OrderNum": _OrderNum = Convert.ToString(value); break; case "OrderId": _OrderId = value.ToInt(); break; default: base[name] = value; break; } } } #endregion #region 字段名 /// 取得用户优惠券字段信息的快捷方式 public partial class _ { /// 编号 public static readonly Field Id = FindByName("Id"); /// 用户ID public static readonly Field UId = FindByName("UId"); /// 券号 public static readonly Field ItemNO = FindByName("ItemNO"); /// 优惠券ID public static readonly Field CouponId = FindByName("CouponId"); /// 优惠券类型,0 现金用券,1打折券 public static readonly Field CouponType = FindByName("CouponType"); /// 打折率,只有是打折券才有用 public static readonly Field DiscuountRates = FindByName("DiscuountRates"); /// 是否有类别限制,0 无限制;1 是类别限制,2是商品限制 public static readonly Field IsLimit = FindByName("IsLimit"); /// 面额 public static readonly Field Price = FindByName("Price"); /// 需要消费面额 public static readonly Field NeedPrice = FindByName("NeedPrice"); /// 添加时间 public static readonly Field AddTime = FindByName("AddTime"); /// 添加时间 public static readonly Field StartTime = FindByName("StartTime"); /// 添加时间 public static readonly Field EndTime = FindByName("EndTime"); /// 是否使用 public static readonly Field IsUse = FindByName("IsUse"); /// 使用时间 public static readonly Field UseTime = FindByName("UseTime"); /// 订单号(使用后) public static readonly Field OrderNum = FindByName("OrderNum"); /// 订单编号(使用后) public static readonly Field OrderId = FindByName("OrderId"); static Field FindByName(String name) => Meta.Table.FindByName(name); } /// 取得用户优惠券字段名称的快捷方式 public partial class __ { /// 编号 public const String Id = "Id"; /// 用户ID public const String UId = "UId"; /// 券号 public const String ItemNO = "ItemNO"; /// 优惠券ID public const String CouponId = "CouponId"; /// 优惠券类型,0 现金用券,1打折券 public const String CouponType = "CouponType"; /// 打折率,只有是打折券才有用 public const String DiscuountRates = "DiscuountRates"; /// 是否有类别限制,0 无限制;1 是类别限制,2是商品限制 public const String IsLimit = "IsLimit"; /// 面额 public const String Price = "Price"; /// 需要消费面额 public const String NeedPrice = "NeedPrice"; /// 添加时间 public const String AddTime = "AddTime"; /// 添加时间 public const String StartTime = "StartTime"; /// 添加时间 public const String EndTime = "EndTime"; /// 是否使用 public const String IsUse = "IsUse"; /// 使用时间 public const String UseTime = "UseTime"; /// 订单号(使用后) public const String OrderNum = "OrderNum"; /// 订单编号(使用后) public const String OrderId = "OrderId"; } #endregion } }