using Castle.ActiveRecord; using NHibernate.Criterion; using System; using System.Collections.Generic; using System.Text; namespace BizCom { [ActiveRecord("CE_Withdraw")] public class CeWithdraw : ComBase { [PrimaryKey(PrimaryKeyType.Assigned)] public string tid { get; set; } private int _userid = 0; /// ///用户id /// [Property] public int userid { get { return _userid; } set { _userid = value; } } private string _providerid = ""; /// ///供应商id /// [Property] public string providerid { get { return _providerid; } set { _providerid = value; } } /// ///发起时间 /// [Property] public DateTime? creationtime { get; set; } /// ///供应商确认时间 /// [Property] public DateTime? acknowledgingtime { get; set; } private int _status = 0; /// ///状态 /// [Property] public int status { get { return _status; } set { _status = value; } } public static void Del(object id) { StringBuilder sql = new StringBuilder(); sql.AppendFormat("delete from CE_Withdraw where id=" + id); ExecuteNonQuery(sql.ToString()); } public static CeWithdraw GetByTid(string tid) { return FindFirst(Expression.Eq("tid", tid)); } //直接用状态以及tid查询订单 public static CeWithdraw GetByTidAndStatus(string tid, int status) { Dictionary map = null; map.Add("tid", tid); map.Add("status", status.ToString()); return FindFirst(Expression.AllEq(map)); } } }