CeErpOrderFormData.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using Castle.ActiveRecord;
  2. using NHibernate.Criterion;
  3. using System.Text;
  4. namespace BizCom
  5. {
  6. [ActiveRecord("CE_ErpOrderFormData")]
  7. public class CeErpOrderFormData : ComBase<CeErpOrderFormData>
  8. {
  9. /// <summary>
  10. ///
  11. /// </summary>
  12. [PrimaryKey(PrimaryKeyType.Native)]
  13. public int ID { get; set; }
  14. private string _tid = "";
  15. /// <summary>
  16. ///订单tid
  17. /// </summary>
  18. [Property]
  19. public string tid
  20. {
  21. get { return _tid; }
  22. set { _tid = value; }
  23. }
  24. //內容
  25. public string _content = "";
  26. [Property]
  27. public string content
  28. {
  29. get { return _content; }
  30. set { _content = value; }
  31. }
  32. //用戶id
  33. public int _userId = 0;
  34. [Property]
  35. public int userId
  36. {
  37. get { return _userId; }
  38. set { _userId = value; }
  39. }
  40. public static CeErpOrderFormData GetByTid(string tid)
  41. {
  42. return FindFirst(Expression.Eq("tid", tid));
  43. }
  44. public static void DelByTid(object tid)
  45. {
  46. StringBuilder sql = new StringBuilder();
  47. sql.AppendFormat("delete from CE_ErpOrderFormData where tid='" + tid + "'");
  48. ExecuteNonQuery(sql.ToString());
  49. }
  50. public static void Del(object id)
  51. {
  52. StringBuilder sql = new StringBuilder();
  53. sql.AppendFormat("delete from CE_ErpOrderFormData where id=" + id);
  54. ExecuteNonQuery(sql.ToString());
  55. }
  56. }
  57. }