LogOperate.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using Castle.ActiveRecord;
  2. using System;
  3. namespace BizCom
  4. {
  5. [ActiveRecord("LogOperate")]
  6. public class LogOperate : ComBase<LogOperate>
  7. {
  8. private string _id = "";
  9. /// <summary>
  10. ///
  11. /// </summary>
  12. [PrimaryKey(PrimaryKeyType.Assigned)]
  13. public string id
  14. {
  15. get { return _id; }
  16. set { _id = value; }
  17. }
  18. private string _operate_ip = "";
  19. /// <summary>
  20. ///
  21. /// </summary>
  22. [Property]
  23. public string operate_ip
  24. {
  25. get { return _operate_ip; }
  26. set { _operate_ip = value; }
  27. }
  28. private string _operate_page = "";
  29. /// <summary>
  30. ///
  31. /// </summary>
  32. [Property]
  33. public string operate_page
  34. {
  35. get { return _operate_page; }
  36. set { _operate_page = value; }
  37. }
  38. /// <summary>
  39. ///
  40. /// </summary>
  41. [Property]
  42. public DateTime? create_time { get; set; }
  43. private int _create_uid = 0;
  44. /// <summary>
  45. ///
  46. /// </summary>
  47. [Property]
  48. public int create_uid
  49. {
  50. get { return _create_uid; }
  51. set { _create_uid = value; }
  52. }
  53. string _user_name = "";
  54. [Property]
  55. public string user_name
  56. {
  57. get { return _user_name; }
  58. set { _user_name = value; }
  59. }
  60. static log4net.ILog logger = log4net.LogManager.GetLogger("LogOperate");//»ñȡһ¸öÈÕÖ¾¼Ç¼Æ÷
  61. public static void Save(int uId, string userName, string ip, string pagePath)
  62. {
  63. logger.Info("uId:" + uId + " userName:" + userName + " ip:" + ip + " pagePath:" + pagePath);
  64. /*
  65. LogOperate logOperate = new LogOperate();
  66. logOperate.create_uid = uId;
  67. logOperate.user_name = userName;
  68. logOperate.operate_page = pagePath;
  69. logOperate.operate_ip = ip;
  70. logOperate.id = Guid.NewGuid().ToString();
  71. logOperate.create_time = DateTime.Now;
  72. Save(logOperate);*/
  73. }
  74. }
  75. }