UserManage.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Data.Common;
  5. using CB.Common;
  6. using CB.Entity;
  7. using CB.Interface.Infrastructure;
  8. namespace CB.Data.SqlServer
  9. {
  10. public class UsersManage : Repository<UserInfo>, IUsersService
  11. {
  12. public UsersManage(string interfaceId)
  13. : base(interfaceId)
  14. {
  15. }
  16. public override bool Save(UserInfo entity)
  17. {
  18. throw new NotImplementedException();
  19. }
  20. public override bool Update(UserInfo entity)
  21. {
  22. throw new NotImplementedException();
  23. }
  24. public override bool Delete(int Id)
  25. {
  26. throw new NotImplementedException();
  27. }
  28. public override UserInfo Get<TKey>(TKey key)
  29. {
  30. throw new NotImplementedException();
  31. }
  32. public override IList<UserInfo> ToList()
  33. {
  34. throw new NotImplementedException();
  35. }
  36. public override IList<UserInfo> ToList(UserInfo entity)
  37. {
  38. throw new NotImplementedException();
  39. }
  40. public override IList<UserInfo> ToPaging(UserInfo entity, int pageSize, int pageIndex, out int recordCount)
  41. {
  42. throw new NotImplementedException();
  43. }
  44. protected override UserInfo LoadEntity(DataRow dr)
  45. {
  46. return new UserInfo
  47. {
  48. Uid = TypeConverter.ObjectToInt(dr["Uid"]),
  49. UserName = dr["UserName"].ToString().Trim(),
  50. UserPWD = dr["UserPWD"].ToString(),
  51. NickName = dr["NickName"].ToString().Trim(),
  52. GroupId = TypeConverter.ObjectToInt(dr["GroupId"]),
  53. Times = TypeConverter.ObjectToInt(dr["Times"]),
  54. LastVisit = TypeConverter.ObjectToDateTime(dr["LastVisit"], DateTime.MinValue),
  55. LastIp = dr["LastIp"].ToString().Trim(),
  56. RegDate = TypeConverter.ObjectToDateTime(dr["OSInfo"], DateTime.MinValue),
  57. RegIp = dr["RegIp"].ToString().Trim()
  58. };
  59. }
  60. protected override UserInfo LoadEntity(IDataReader reader)
  61. {
  62. return new UserInfo
  63. {
  64. Uid = TypeConverter.ObjectToInt(reader["Uid"]),
  65. UserName = reader["UserName"].ToString().Trim(),
  66. UserPWD = reader["UserPWD"].ToString(),
  67. NickName = reader["NickName"].ToString().Trim(),
  68. GroupId = TypeConverter.ObjectToInt(reader["GroupId"]),
  69. Times = TypeConverter.ObjectToInt(reader["Times"]),
  70. LastVisit = TypeConverter.ObjectToDateTime(reader["LastVisit"], DateTime.MinValue),
  71. LastIp = reader["LastIp"].ToString().Trim(),
  72. RegDate = TypeConverter.ObjectToDateTime(reader["OSInfo"], DateTime.MinValue),
  73. RegIp = reader["RegIp"].ToString().Trim()
  74. };
  75. }
  76. }
  77. }