CeWithdraw.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using Castle.ActiveRecord;
  2. using NHibernate.Criterion;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. namespace BizCom
  7. {
  8. [ActiveRecord("CE_Withdraw")]
  9. public class CeWithdraw : ComBase<CeWithdraw>
  10. {
  11. [PrimaryKey(PrimaryKeyType.Assigned)]
  12. public string tid { get; set; }
  13. private int _userid = 0;
  14. /// <summary>
  15. ///用户id
  16. /// </summary>
  17. [Property]
  18. public int userid
  19. {
  20. get { return _userid; }
  21. set { _userid = value; }
  22. }
  23. private string _providerid = "";
  24. /// <summary>
  25. ///供应商id
  26. /// </summary>
  27. [Property]
  28. public string providerid
  29. {
  30. get { return _providerid; }
  31. set { _providerid = value; }
  32. }
  33. /// <summary>
  34. ///发起时间
  35. /// </summary>
  36. [Property]
  37. public DateTime? creationtime { get; set; }
  38. /// <summary>
  39. ///供应商确认时间
  40. /// </summary>
  41. [Property]
  42. public DateTime? acknowledgingtime { get; set; }
  43. private int _status = 0;
  44. /// <summary>
  45. ///状态
  46. /// </summary>
  47. [Property]
  48. public int status
  49. {
  50. get { return _status; }
  51. set { _status = value; }
  52. }
  53. public static void Del(object id)
  54. {
  55. StringBuilder sql = new StringBuilder();
  56. sql.AppendFormat("delete from CE_Withdraw where id=" + id);
  57. ExecuteNonQuery(sql.ToString());
  58. }
  59. public static CeWithdraw GetByTid(string tid)
  60. {
  61. return FindFirst(Expression.Eq("tid", tid));
  62. }
  63. //直接用状态以及tid查询订单
  64. public static CeWithdraw GetByTidAndStatus(string tid, int status)
  65. {
  66. Dictionary<string, string> map = null;
  67. map.Add("tid", tid);
  68. map.Add("status", status.ToString());
  69. return FindFirst(Expression.AllEq(map));
  70. }
  71. }
  72. }