using Castle.ActiveRecord; using NHibernate.Criterion; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BizCom { [ActiveRecord("CE_ErpTradeSpu")] public class CeErpTradeSpu : ComBase { /// /// /// [PrimaryKey(PrimaryKeyType.Native)] public int ID { get; set; } /// ///发货时间 /// [Property] public DateTime? createTime { get; set; } private string _spuId = ""; /// /// /// [Property] public string spuId { get { return _spuId; } set { _spuId = value; } } private string _tid = ""; /// /// /// [Property] public string tid { get { return _tid; } set { _tid = value; } } /// /// 分类 /// private string _category = ""; [Property] public string category { get { return _category; } set { _category = value; } } /// /// 流水号 /// private string _serialNumber = ""; [Property] public string serialNumber { get { return _serialNumber; } set { _serialNumber = value; } } /// /// 运营 /// private string _operate = ""; [Property] public string operate { get { return _operate; } set { _operate = value; } } /// /// 美工 /// private string _designer = ""; [Property] public string designer { get { return _designer; } set { _designer = value; } } /// /// 附件 /// private string _atta = ""; [Property] public string atta { get { return _atta; } set { _atta = value; } } /// /// 店铺 /// private int _shopId = 0; [Property] public int shopId { get { return _shopId; } set { _shopId = value; } } /// ///上架时间 /// [Property] public DateTime? upTime { get; set; } /// /// 是否同步 /// private bool _isSync = false; public bool isSync { get { return _isSync; } set { _isSync = value; } } /// /// 返回信息 /// private string _message = ""; public string message { get { return _message; } set { _message = value; } } public static CeErpTradeSpu GetBySpuId(string spuId) { return FindFirst(Expression.Eq("spuId", spuId)); } public static void updateAsync(string id) { ExecuteNonQuery(string.Format("update CE_ErpTradeSpu set isSync=1 where ID='{0}'", id)); } public static void updateError(string id, string message) { ExecuteNonQuery(string.Format("update CE_ErpTradeSpu set message='{1}' where ID='{0}'", id, message)); } } }