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.

105 lines
4.4 KiB

  1. using System.Text;
  2. using Swift.DAL.SwiftDAL;
  3. using System.Data;
  4. namespace Swift.DAL.BL.System.Utility
  5. {
  6. public class ExportCsvFileDao : SwiftDao
  7. {
  8. public ExportFileInformation ExportTxnAcDeposit(string user, string status, string paymentType,
  9. string delimeter, string fields, string fromDate, string toDate, string bod, string eod,
  10. string agentId, string branchId, string mapCodeInt)
  11. {
  12. var sql = "EXEC proc_ExportACDeposit @flag='b'";
  13. sql += ", @user=" + FilterString(user);
  14. sql += ", @status=" + FilterString(status);
  15. sql += ", @paymentType=" + FilterString(paymentType);
  16. sql += ", @delimeter='" + (delimeter)+"'";
  17. sql += ", @fields=" + FilterString(fields);
  18. sql += ", @fromDate=" + FilterString(fromDate);
  19. sql += ", @toDate=" + FilterString(toDate);
  20. sql += ", @bod=" + FilterString(bod);
  21. sql += ", @eod=" + FilterString(eod);
  22. sql += ", @agentId = " + FilterString(agentId);
  23. sql += ", @branchId = " + FilterString(branchId);
  24. sql += ", @mapCodeInt = " + FilterString(mapCodeInt);
  25. DataSet ds = ExecuteDataset(sql);
  26. var fileInfo = new ExportFileInformation();
  27. DataTable dtBody = ds.Tables[0];
  28. var sb = new StringBuilder();
  29. sb.Append(DataTableToText(ref dtBody, delimeter));
  30. fileInfo.Content = sb.ToString();
  31. return fileInfo;
  32. }
  33. public ExportFileInformation ExportTxn(string user, string userType ,string fields, string mapCodeInt,
  34. string confDate, string fromDate, string toDate, string rcountry, string ragent, string payType,
  35. string senBranch, string statuss, string delimeter)
  36. {
  37. var sql = "EXEC proc_exportTransaction ";
  38. sql += " @fldmon= '" + fields + "'";
  39. sql += " ,@agentid= " + FilterString(mapCodeInt);
  40. sql += " ,@ddDate= " + FilterString(confDate);
  41. sql += " ,@fromDate= " + FilterString(fromDate);
  42. sql += " ,@toDate= " + FilterString(toDate);
  43. sql += " ,@receiverCountry= " + FilterString(rcountry);
  44. sql += " ,@payoutagentid= " + FilterString(ragent);
  45. sql += " ,@paymentType= " + FilterString(payType);
  46. sql += " ,@branch_id= " + FilterString(senBranch);
  47. sql += " ,@trn_status= " + FilterString(statuss);
  48. sql += " ,@user= " + FilterString(user);
  49. sql += " ,@userType= " + FilterString(userType);
  50. DataSet ds = ExecuteDataset(sql);
  51. var fileInfo = new ExportFileInformation();
  52. DataTable dtBody = ds.Tables[0];
  53. var sb = new StringBuilder();
  54. sb.Append(DataTableToText(ref dtBody, delimeter));
  55. fileInfo.Content = sb.ToString();
  56. return fileInfo;
  57. }
  58. public ExportFileInformation ExportFileAllInfo (string user, string status, string paymentType,
  59. string delimeter, string fields, string fromDate, string toDate, string bod, string eod,
  60. string agentId, string branchId, string mapCodeInt)
  61. {
  62. var sql = "EXEC proc_ExportTranAll @flag='b'";
  63. sql += ", @user=" + FilterString(user);
  64. sql += ", @status=" + FilterString(status);
  65. sql += ", @paymentType=" + FilterString(paymentType);
  66. sql += ", @delimeter='" + (delimeter) + "'";
  67. sql += ", @fields=" + FilterString(fields);
  68. sql += ", @fromDate=" + FilterString(fromDate);
  69. sql += ", @toDate=" + FilterString(toDate);
  70. sql += ", @bod=" + FilterString(bod);
  71. sql += ", @eod=" + FilterString(eod);
  72. sql += ", @agentId = " + FilterString(agentId);
  73. sql += ", @branchId = " + FilterString(branchId);
  74. sql += ", @mapCodeInt = " + FilterString(mapCodeInt);
  75. DataSet ds = ExecuteDataset(sql);
  76. var fileInfo = new ExportFileInformation();
  77. DataTable dtBody = ds.Tables[0];
  78. var sb = new StringBuilder();
  79. sb.Append(DataTableToText(ref dtBody, delimeter));
  80. fileInfo.Content = sb.ToString();
  81. return fileInfo;
  82. }
  83. }
  84. public class ExportFileInformation
  85. {
  86. public string Content { get; set; }
  87. }
  88. }