You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

258 lines
12 KiB

  1. using Swift.DAL.SwiftDAL;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. namespace Swift.DAL.AccountReport
  7. {
  8. public class AccountReportDao : SwiftDao
  9. {
  10. public ReportResult GetIntMonthlyReport(String sagentId, String ragentId, String fromDate, String toDate, String dateType, String paymentStatus, String reportType)
  11. {
  12. string sql="";
  13. if (reportType == "s")
  14. {
  15. sql = "Exec procAgentSummaryReportMonthly ";
  16. sql += " @flag=" + FilterString(dateType);
  17. sql += ", @dateform =" + FilterString(fromDate);
  18. sql += " ,@dateto =" + FilterString(toDate);
  19. sql += ", @agent =" + FilterString(sagentId);
  20. sql += ", @ragent =" + FilterString(ragentId);
  21. sql += " ,@pay_status =" + FilterString(paymentStatus);
  22. sql += " ,@reportType =" + FilterString(reportType);
  23. }
  24. else if (reportType == "p")
  25. {
  26. sql = "Exec procAgentSummaryReportReceiving ";
  27. sql += " @flag=" + FilterString(dateType);
  28. sql += ", @dateform =" + FilterString(fromDate);
  29. sql += " ,@dateto =" + FilterString(toDate);
  30. sql += ", @agent =" + FilterString(sagentId);
  31. sql += " ,@pay_status =" + FilterString(paymentStatus);
  32. sql += " ,@req_type =" + FilterString(reportType);
  33. }
  34. return ParseReportResult(sql);
  35. }
  36. public ReportResult GetIntShowCentralizeReport(string agentId, string fromDate, string toDate, string dateType, string paymentStatus)
  37. {
  38. string sql = "Exec procAgentSummaryReportReceiving @req_type='c'";
  39. sql += " ,@flag=" + FilterString(dateType);
  40. sql += ", @dateform =" + FilterString(fromDate);
  41. sql += " ,@dateto =" + FilterString(toDate);
  42. sql += ", @agent =" + FilterString(agentId);
  43. sql += " ,@pay_status =" + FilterString(paymentStatus);
  44. return ParseReportResult(sql);
  45. }
  46. public ReportResult GetIntShowReport(string agentId, string fromDate, string toDate, string dateType, string paymentStatus)
  47. {
  48. string sql = "Exec procAgentSummaryReportReceiving";
  49. sql += " @flag=" + FilterString(dateType);
  50. sql += ", @dateform =" + FilterString(fromDate);
  51. sql += " ,@dateto =" + FilterString(toDate);
  52. sql += ", @agent =" + FilterString(agentId);
  53. sql += " ,@pay_status =" + FilterString(paymentStatus);
  54. return ParseReportResult(sql);
  55. }
  56. public ReportResult GetIntOldReport(string agentId, string fromDate, string toDate, string dateType, string paymentStatus)
  57. {
  58. string sql = "Exec procAgentSummaryReport";
  59. sql += " @flag=" + FilterString(dateType);
  60. sql += ", @dateform =" + FilterString(fromDate);
  61. sql += " ,@dateto =" + FilterString(toDate);
  62. sql += ", @agent =" + FilterString(agentId);
  63. sql += " ,@pay_status =" + FilterString(paymentStatus);
  64. return ParseReportResult(sql);
  65. }
  66. public ReportResult GetIntNewReport(string agentId, string fromDate, string toDate, string dateType, string paymentStatus)
  67. {
  68. string sql = "Exec procAgentSummaryReport_new";
  69. sql += " @flag=" + FilterString(dateType);
  70. sql += ", @dateform =" + FilterString(fromDate);
  71. sql += " ,@dateto =" + FilterString(toDate);
  72. sql += ", @agent =" + FilterString(agentId);
  73. sql += " ,@pay_status =" + FilterString(paymentStatus);
  74. return ParseReportResult(sql);
  75. }
  76. public ReportResult GetIntlReconcileRpt(string sDate, string eDate)
  77. {
  78. string sql = "Exec Proc_ReconcileReport @flag='a' ";
  79. sql += " ,@date =" + FilterString(sDate);
  80. sql += ", @date2 =" + FilterString(eDate);
  81. return ParseReportResult(sql);
  82. }
  83. public ReportResult GetDomesticTxnReport(string user, string agentId, string fromDate, string todate, string DateType, string payment_status, string type)
  84. {
  85. string sql = "EXEC procLocalAgentSummaryReport ";
  86. sql += " @flag = " + FilterString(DateType);
  87. sql += ", @user = " + FilterString(user);
  88. sql += ", @dateform = " + FilterString(fromDate);
  89. sql += ", @dateto = " + FilterString(todate);
  90. sql += ", @agent = " + FilterString(agentId);
  91. sql += ", @PAY_STATUS = " + FilterString(payment_status);
  92. sql += ", @type = " + FilterString(type);
  93. return ParseReportResult(sql);
  94. }
  95. public ReportResult GetDomesticReceivingTxnReport(string user, string agentId, string fromDate, string todate, string DateType, string payment_status, string type)
  96. {
  97. string sql = "EXEC procLocalAgentSummaryReportReceiving ";
  98. sql += " @flag = " + FilterString(DateType);
  99. sql += ", @user = " + FilterString(user);
  100. sql += ", @dateform = " + FilterString(fromDate);
  101. sql += ", @dateto = " + FilterString(todate);
  102. sql += ", @agent = " + FilterString(agentId);
  103. sql += ", @PAY_STATUS = " + FilterString(payment_status);
  104. sql += ", @type = " + FilterString(type);
  105. return ParseReportResult(sql);
  106. }
  107. public ReportResult GetNrbDetailReport(string flag, string fromDate, string todate, string agentId)
  108. {
  109. string sql = "EXEC procNRBDetailReport";
  110. sql += " @flag = " + FilterString(flag);
  111. sql += ", @dateform = " + FilterString(fromDate);
  112. sql += ", @dateto = " + FilterString(todate);
  113. sql += ", @agent = " + FilterString(agentId);
  114. return ParseReportResult(sql);
  115. }
  116. public ReportResult GetNrbProcessReport(string dateFrom, string dateTo, string agentId)
  117. {
  118. string sql = "EXEC procAgentDepositReport";
  119. sql += " @dateform = " + FilterString(dateFrom);
  120. sql += ", @dateto = " + FilterString(dateTo);
  121. sql += ", @agent = " + FilterString(agentId);
  122. return ParseReportResult(sql);
  123. }
  124. public ReportResult GetPaidTxnReport(string fromDate, string toDate, string dateType, string reportType)
  125. {
  126. string sql = "EXEC proc_paidTxnReport";
  127. sql += " @FROMDATE = " + FilterString(fromDate);
  128. sql += ", @TODATE = " + FilterString(toDate);
  129. sql += ", @DATETYPE = " + FilterString(dateType);
  130. sql += ", @REPORTTYPE = " + FilterString(reportType);
  131. return ParseReportResult(sql);
  132. }
  133. public ReportResult GetDomesticSettlementReport(string fromDate)
  134. {
  135. string sql = "Exec [proc_DomesticSettelmentReport]";
  136. sql = sql + "@flag= " + FilterString("a");
  137. sql = sql + ",@date= " + FilterString(fromDate);
  138. return ParseReportResult(sql);
  139. }
  140. public ReportResult GetTxnDetailRpt(string fromDate, string toDate, string agentId)
  141. {
  142. string sql = "Exec proc_settlementDetailRpt @flag='rpt'";
  143. sql += ",@fromDate=" + FilterString(fromDate) + "";
  144. sql += ",@toDate=" + FilterString(toDate) + "";
  145. sql += ",@agentId=" + FilterString(agentId) + "";
  146. return ParseReportResult(sql);
  147. }
  148. public ReportResult GetSettlementHoRptDrillDown(string fromDate, string toDate, string agentId, string branch, string user, string country, string flag)
  149. {
  150. string sql = "Exec PROC_SETTLEMENT_REPORT @FLAG =" + FilterString(flag) + "";
  151. sql += ",@AGENT=" + FilterString(agentId) + "";
  152. sql += ",@DATE1=" + FilterString(fromDate) + "";
  153. sql += ",@DATE2=" + FilterString(toDate) + "";
  154. sql += ",@BRANCH=" + FilterString(branch) + "";
  155. sql += ",@USER=" + FilterString(user) + "";
  156. sql += ",@COUNTRY=" + FilterString(country) + "";
  157. return ParseReportResult(sql);
  158. }
  159. public ReportResult GetSettlementHoRpt(string fromDate, string toDate, string agentId, string branch, string user)
  160. {
  161. string sql = "Exec PROC_SETTLEMENT_REPORT @FLAG='m'";
  162. sql += ",@AGENT=" + FilterString(agentId) + "";
  163. sql += ",@DATE1=" + FilterString(fromDate) + "";
  164. sql += ",@DATE2=" + FilterString(toDate) + "";
  165. sql += ",@BRANCH=" + FilterString(branch) + "";
  166. sql += ",@USER=" + FilterString(user) + "";
  167. return ParseReportResult(sql);
  168. }
  169. public ReportResult GetAgentSummaryRpt(string agentGroup, string date, string tranType, string agentId)
  170. {
  171. string sql = "Exec proc_agentDebitBalance_weekly @FLAG='RPT'";
  172. sql += ",@agentGrp=" + FilterString(agentGroup) + "";
  173. sql += ",@agentId=" + FilterString(agentId) + "";
  174. sql += ",@date=" + FilterString(date) + "";
  175. sql += ",@trantype=" + FilterString(tranType) + "";
  176. return ParseReportResult(sql);
  177. }
  178. public ReportResult GetDailySettlemetReport(string fromDate, string toDate)
  179. {
  180. string sql = "exec Proc_dailySettlementReport @flag='dsr'";
  181. sql += ",@FROMDATE=" + FilterString(fromDate) + "";
  182. sql += ",@TODATE=" + FilterString(toDate) + "";
  183. return ParseReportResult(sql);
  184. }
  185. public ReportResult GetInternational_OldRpt(string agentId, string fromDate, string toDate, string dateType, string paymentStatus)
  186. {
  187. string sql = "Exec procAgentSummaryReport @flag=" + FilterString(dateType);
  188. sql = sql + ",@agent= " + FilterString(agentId);
  189. sql = sql + ",@dateform= " + FilterString(fromDate);
  190. sql = sql + ",@dateto= " + FilterString(toDate);
  191. // sql = sql + "@dateType= " + FilterString(dateType);
  192. sql = sql + ",@pay_status= " + FilterString(paymentStatus);
  193. return ParseReportResult(sql);
  194. }
  195. public ReportResult GetIndividualTxnRpt(string icn)
  196. {
  197. string sql = "exec Proc_dailySettlementReport @flag='icn', @ICN=" + FilterString(icn) + "";
  198. return ParseReportResult(sql);
  199. }
  200. public ReportResult GetTdsReport(string fromDate, string party)
  201. {
  202. string sql = "Exec CommissionAndTDSreport ";
  203. sql += " @date1=" + FilterString(fromDate);
  204. sql += ",@agentid=" + FilterString(party);
  205. return ParseReportResult(sql);
  206. }
  207. public ReportResult GetCompileReport(string asOnDate, string agentCode, string includeZeroValue, string bankCode, string fromDrAmt, string toDrAmt, string fromCrAmt, string toCrAmt)
  208. {
  209. string sql = "Exec proc_compileReport_web @flag='A'";
  210. sql += ",@DATE=" + FilterString(asOnDate);
  211. sql += ",@SAGENT=" + FilterString(agentCode);
  212. sql += ",@INCLUDEZERO=" + FilterString(includeZeroValue);
  213. sql += ",@BANKCODE=" + FilterString(bankCode);
  214. sql += ",@DR1=" + FilterString(fromDrAmt);
  215. sql += ",@DR2=" + FilterString(toDrAmt);
  216. sql += ",@CR1=" + FilterString(fromCrAmt);
  217. sql += ",@CR2=" + FilterString(toCrAmt);
  218. return ParseReportResult(sql);
  219. }
  220. public ReportResult CurrencyPositionRpt(string user, string startDate, string endDate, string flag)
  221. {
  222. string sql = "EXEC proc_StockPositionReport @flag = '" + flag + "'";
  223. sql += ",@fromDate = " + FilterString(startDate);
  224. sql += ",@toDate = " + FilterString(endDate);
  225. sql += ",@user = " + FilterString(user);
  226. return ParseReportResult(sql);
  227. }
  228. public ReportResult MultiCurrencyClosingRpt(string user, string asOnDate, string partner)
  229. {
  230. string sql = "EXEC proc_multiCurrencyClosingReport @flag = 'rpt'";
  231. sql += ",@asOnDate = " + FilterString(asOnDate);
  232. sql += ",@partner = " + FilterString(partner);
  233. sql += ",@user = " + FilterString(user);
  234. return ParseReportResult(sql);
  235. }
  236. }
  237. }