FundBaseBLL.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. using System.Collections;
  9. namespace Core.StlMes.Client.Sale.SaleFundMgt.FundBLL.FundBaseBLL
  10. {
  11. public class FundBaseBLL
  12. {
  13. private OpeBase _ob;
  14. public FundBaseBLL(OpeBase ob)
  15. {
  16. _ob = ob;
  17. }
  18. protected FundDAL.FundPactAccountDAL.FundPactAccountDAL GetFundPactAccountInstance()
  19. {
  20. return new FundDAL.FundPactAccountDAL.FundPactAccountDAL(_ob);
  21. }
  22. protected FundDAL.FundPactAccountDAL.FundPactAccountRelationDAL GetFundPactAccountRelationInstance()
  23. {
  24. return new FundDAL.FundPactAccountDAL.FundPactAccountRelationDAL(_ob);
  25. }
  26. protected FundDAL.FundPactAccountDAL.FundPactUsedDetailDAL GetFundPactUsedDetailInstance()
  27. {
  28. return new FundDAL.FundPactAccountDAL.FundPactUsedDetailDAL(_ob);
  29. }
  30. protected FundDAL.FundPactAccountDAL.FundPactTransDetailDAL GetFundPactTransDetailInstance()
  31. {
  32. return new FundDAL.FundPactAccountDAL.FundPactTransDetailDAL(_ob);
  33. }
  34. protected FundDAL.FundCustAccountDAL.FundCustUsedDetailDAL GetFundCustUsedDetailInstance()
  35. {
  36. return new FundDAL.FundCustAccountDAL.FundCustUsedDetailDAL(_ob);
  37. }
  38. protected FundDAL.FundInOutDAL.FundInOutDAL GetFundInOutInstance()
  39. {
  40. return new FundDAL.FundInOutDAL.FundInOutDAL(_ob);
  41. }
  42. protected FundDAL.FundCustAccountDAL.FundCustAccountDAL GetFundCustAccountInstance()
  43. {
  44. return new FundDAL.FundCustAccountDAL.FundCustAccountDAL(_ob);
  45. }
  46. protected FundDAL.FundSecondLevelAccountDAL.FundSecondlevelAccountDAL GetFundSecondAccountInstance()
  47. {
  48. return new FundDAL.FundSecondLevelAccountDAL.FundSecondlevelAccountDAL(_ob);
  49. }
  50. protected FundDAL.FundSecondLevelAccountDAL.FundSecondUsedDetailDAL GetFundSecondUsedDetailInstance()
  51. {
  52. return new FundDAL.FundSecondLevelAccountDAL.FundSecondUsedDetailDAL(_ob);
  53. }
  54. protected FundDAL.FundUserAndBalanceRelationDAL.FundUserAndBalRelationDAL GetFundUserAndBalRelationInstance()
  55. {
  56. return new FundDAL.FundUserAndBalanceRelationDAL.FundUserAndBalRelationDAL(_ob);
  57. }
  58. protected FundDAL.FundBusiNessInfoDAL.SelFundBusinessinfoDAL GetFundBusinessInfoDAL()
  59. {
  60. return new FundDAL.FundBusiNessInfoDAL.SelFundBusinessinfoDAL(_ob);
  61. }
  62. protected Model.SEL_FUND_TRANS_CUST GetSelFundTranCustModel(string balancesubject, string buyercode, double transmoney)
  63. {
  64. return new Model.SEL_FUND_TRANS_CUST(balancesubject,buyercode,transmoney);
  65. }
  66. protected Model.SEL_FUND_TRANS_SECONDACCOUNT GetSelFundTransSecondAccount(string balancesubject, string buyercode, string secondAccount, double transmoney)
  67. {
  68. Model.SEL_FUND_TRANS_CUST cust = GetSelFundTranCustModel(balancesubject,buyercode,transmoney);
  69. return new Model.SEL_FUND_TRANS_SECONDACCOUNT(cust,secondAccount,transmoney);
  70. }
  71. public Model.SEL_FUND_TRANS_PACT GetSelFundTransPact(string balancesubject, string buyercode, string secondAccount, string pactno, double transmoney)
  72. {
  73. return new Model.SEL_FUND_TRANS_PACT
  74. (GetSelFundTransSecondAccount(balancesubject,buyercode,secondAccount,transmoney),pactno,transmoney);
  75. }
  76. protected Model.SEL_FUND_PACT_ACCOUNT GetFundPactAccount(string balansub, string buyercode, string secondeaccount, string pactno)
  77. {
  78. Model.SEL_FUND_PACT_ACCOUNT acct = new Model.SEL_FUND_PACT_ACCOUNT();
  79. acct.BALANCESUBJECT = balansub;
  80. acct.BUYERCODE = buyercode;
  81. acct.SECONDACCOUNT = secondeaccount;
  82. acct.PACTNO = pactno;
  83. acct.PACT_BEGINDATE = Util.DateTimeUtil.GetSystemDate();
  84. acct.IMPORTTIME = Util.DateTimeUtil.GetSystemDate();
  85. acct.IMPORTOR = "";
  86. acct.PACT_BEGINDATE = Util.DateTimeUtil.GetSystemDate();
  87. return acct;
  88. }
  89. /// <summary>
  90. /// 获取事务管理实例类
  91. /// </summary>
  92. /// <returns></returns>
  93. protected DbHelp.DbTransaction GetTransaction()
  94. {
  95. return new Core.StlMes.Client.Sale.DbHelp.DbTransaction(this._ob);
  96. }
  97. public DataSet ExecuteReader(string sql)
  98. {
  99. Core.StlMes.Client.Sale.DbHelp.DbExecute dbExecute
  100. = new Core.StlMes.Client.Sale.DbHelp.DbExecute(this._ob);
  101. return dbExecute.ExecuteQuery(sql);
  102. }
  103. public void ExecuteNoReader(ArrayList sqlList,out string errMsg)
  104. {
  105. string gurid = System.Guid.NewGuid().ToString();
  106. errMsg = "";
  107. Core.StlMes.Client.Sale.DbHelp.DbExecute dbExecute
  108. = new Core.StlMes.Client.Sale.DbHelp.DbExecute(this._ob);
  109. if (sqlList == null || sqlList.Count == 0)
  110. return;
  111. StringBuilder sblist = new StringBuilder();
  112. foreach (string s in sqlList)
  113. {
  114. sblist.Append(s).Append(" ;");
  115. }
  116. StringBuilder sb = new StringBuilder();
  117. sb.Append("declare str varchar2(1000); ");
  118. sb.Append(" begin ");
  119. sb.Append(sblist.ToString());
  120. sb.Append(" commit; ");
  121. sb.Append(string.Format(" exception when others then rollback; str := substr(sqlerrm,1,100); insert into slm_pro_execute_result(id_,exresult,eresult) select '{0}',-1,substr(str,1,200) from dual; delete from slm_pro_execute_result where indate < sysdate - 600/86400; commit; ", gurid));
  122. sb.Append(" end ;");
  123. string sql = sb.ToString();
  124. dbExecute.ExecuteNoQuery(sql);
  125. string sqlresutl = string.Format(" select id_,exresult,eresult from slm_pro_execute_result where id_= '{0}' and exresult = -1", gurid);
  126. try
  127. {
  128. DataSet ds = dbExecute.ExecuteQuery(sqlresutl);
  129. if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
  130. {
  131. }
  132. else
  133. {
  134. foreach (DataRow dr in ds.Tables[0].Rows)
  135. {
  136. errMsg = dr["ERESULT"].ToString();
  137. break;
  138. }
  139. }
  140. }
  141. catch
  142. { }
  143. }
  144. protected string _errMsgMoneyNotEnough = "资金不足";
  145. protected string _errDefaultMsg = "异常错误";
  146. }
  147. }