LotteryAwardManage.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Data.Common;
  5. using CB.Common;
  6. using CB.Data;
  7. using CB.Entity;
  8. using CB.Interface.Infrastructure;
  9. namespace CB.Data.SqlServer
  10. {
  11. public class LotteryAwardManage : ILotteryAwardrService
  12. {
  13. public string InterfaceId = "";
  14. public LotteryAwardManage(string interfaceId)
  15. {
  16. InterfaceId = interfaceId;
  17. }
  18. public IList<LotteryAwardInfo> GetLotteryAwardList()
  19. {
  20. IList<LotteryAwardInfo> list = new List<LotteryAwardInfo>();
  21. using (IDataReader reader = GetLotteryAward())
  22. {
  23. if (reader.Read())
  24. {
  25. list.Add(LoadEntity(reader));
  26. }
  27. while (reader.NextResult() && reader.Read())
  28. {
  29. list.Add(LoadEntity(reader));
  30. }
  31. reader.Close();
  32. }
  33. return list;
  34. }
  35. protected LotteryAwardInfo LoadEntity(IDataReader reader)
  36. {
  37. return new LotteryAwardInfo
  38. {
  39. Lottery = reader["lottery"].ToString().Trim(),
  40. LotteryName = reader["lotteryName"].ToString().Trim(),
  41. Qi = TypeConverter.ObjectToInt(reader["term"]),
  42. Addtime = TypeConverter.ObjectToDateTime(reader["addtime"], DateTime.MinValue),
  43. Detail = reader["detail"].ToString().Trim()
  44. };
  45. }
  46. /// <summary>
  47. /// 开奖详情--同步至55125
  48. /// 2014-07-09 JNswins
  49. /// </summary>
  50. /// <returns></returns>
  51. public IDataReader GetLotteryAward()
  52. {
  53. return DbHelper.ExecuteReader(InterfaceId, CommandType.StoredProcedure, "cc_st_kjdataFor55125");
  54. }
  55. }
  56. }