FundCustUsedDetailDAL.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using CoreFS.CA06;
  7. using DbHelp = Core.StlMes.Client.Sale.DbHelp;
  8. namespace Core.StlMes.Client.Sale.SaleFundMgt.FundDAL.FundCustAccountDAL
  9. {
  10. public class FundCustUsedDetailDAL:BaseDAL.BaseDAL
  11. {
  12. public FundCustUsedDetailDAL(OpeBase ob)
  13. : base(ob)
  14. {
  15. }
  16. private const string SQL_INSERT = @" insert into sel_fund_cust_useddetail(trans_seq,
  17. trans_type,
  18. balancesubject,
  19. buyercode,
  20. money,
  21. leavemoney,
  22. otheraccount,
  23. trans_time,
  24. trans_person,
  25. remark,
  26. updatetime)
  27. values('{0}','{1}','{2}','{3}',{4},{5},'{6}',sysdate,'{8}','{9}',sysdate)";
  28. private const string SQL_QUERY = @"select trans_seq,
  29. trans_type,
  30. balancesubject,
  31. buyercode,
  32. money,
  33. leavemoney,
  34. otheraccount,
  35. trans_time,
  36. trans_person,
  37. remark,
  38. updatetime from sel_fund_cust_useddetail where 1 = 1 {0} ";
  39. /// <summary>
  40. /// 获取资金转移表的明细记录
  41. /// </summary>
  42. /// <param name="sqlcondtion"></param>
  43. /// <returns></returns>
  44. public DataSet GetSelFundUsedDetail(string sqlcondtion)
  45. {
  46. string sqlStr = string.Format(SQL_QUERY,sqlcondtion);
  47. DataSet ds = base.ExecuteReader(sqlStr);
  48. base.SetDataSetCaption(ref ds, base.GetColumnNameAndCaption());
  49. return ds;
  50. }
  51. /// <summary>
  52. /// 通过结算单位,客户名称返回其资金转移明细数据
  53. /// </summary>
  54. /// <param name="balancesubject"></param>
  55. /// <param name="buyercode"></param>
  56. /// <returns></returns>
  57. public DataSet GetSelFundUsedDetail(string balancesubject,string buyercode)
  58. {
  59. string sqlcondtion = base.GetSqlConditon(balancesubject,buyercode,0);
  60. return GetSelFundUsedDetail(sqlcondtion);
  61. }
  62. public void Insert( Model.SEL_FUND_CUST_USEDDETAIL detail,out string errMsg )
  63. {
  64. try
  65. {
  66. errMsg = "";
  67. string sqlStr = string.Format(SQL_INSERT, detail.TRANS_SEQ,
  68. detail.TRANS_TYPE,
  69. detail.BALANCESUBJECT,
  70. detail.BUYERCODE,
  71. detail.MONEY,
  72. detail.LEAVEMONEY,
  73. detail.OTHERACCOUNT,
  74. //Util.DateTimeUtil.GetSystemDate(),
  75. detail.TRANS_PERSON,
  76. detail.REMARK
  77. // Util.DateTimeUtil.GetSystemDate()
  78. );
  79. base.ExecuteNoReader(sqlStr, out errMsg);
  80. }
  81. catch(Exception ex)
  82. {
  83. errMsg = ex.Message;
  84. }
  85. }
  86. public void Insert(Model.SEL_FUND_CUST_USEDDETAIL detail, DbHelp.DbTransaction transaction)
  87. {
  88. try
  89. {
  90. string sqlStr = string.Format(SQL_INSERT, detail.TRANS_SEQ,
  91. detail.TRANS_TYPE,
  92. detail.BALANCESUBJECT,
  93. detail.BUYERCODE,
  94. detail.MONEY,
  95. detail.LEAVEMONEY,
  96. detail.OTHERACCOUNT,
  97. Util.DateTimeUtil.GetSystemDate(),
  98. detail.TRANS_PERSON,
  99. detail.REMARK,
  100. Util.DateTimeUtil.GetSystemDate()
  101. );
  102. base.ExecuteNoReaderForSaleFund(sqlStr, transaction);
  103. }
  104. catch(Exception ex)
  105. {
  106. transaction.ErrMsg = ex.Message;
  107. }
  108. }
  109. public string Sql_Insert(Model.SEL_FUND_CUST_USEDDETAIL detail)
  110. {
  111. string sqlStr = string.Format(SQL_INSERT, detail.TRANS_SEQ,
  112. detail.TRANS_TYPE,
  113. detail.BALANCESUBJECT,
  114. detail.BUYERCODE,
  115. detail.MONEY,
  116. detail.LEAVEMONEY,
  117. detail.OTHERACCOUNT,
  118. Util.DateTimeUtil.GetSystemDate(),
  119. detail.TRANS_PERSON,
  120. detail.REMARK,
  121. Util.DateTimeUtil.GetSystemDate()
  122. );
  123. return sqlStr;
  124. }
  125. }
  126. }