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.

57 lines
2.7 KiB

  1. using Swift.DAL.SwiftDAL;
  2. using System.Data;
  3. namespace Swift.DAL.BL.Remit.Compliance
  4. {
  5. public class AmountThresholdSetupDao : RemittanceDao
  6. {
  7. public DbResult SaveThresholdAmount(string sCountryId, string sCountryName, string rCountryId, string rCountryName, string sAgent, string Amount, string MessageTxt, string isActive, string user)
  8. {
  9. var sql = "EXEC proc_sendingAmtThreshold @flag='i'";
  10. sql += ",@sCountryId =" + FilterString(sCountryId);
  11. sql += ",@sCountryName =" + FilterString(sCountryName);
  12. sql += ",@rCountryId =" + FilterString(rCountryId);
  13. sql += ",@rCountryName =" + FilterString(rCountryName);
  14. sql += ",@sAgent =" + FilterString(sAgent);
  15. sql += ",@Amount =" + FilterString(Amount);
  16. sql += ",@MessageTxt =N"+ FilterString(MessageTxt);
  17. sql += ",@isActive =" + FilterString(isActive);
  18. sql += ",@user =" + FilterString(user);
  19. return ParseDbResult(sql);
  20. }
  21. public DbResult UpdateThresholdAmount(string id,string sCountryId, string sCountryName, string rCountryId, string rCountryName, string sAgent, string Amount,string MessageTxt,string isActive, string user)
  22. {
  23. var sql = "EXEC proc_sendingAmtThreshold @flag='u'";
  24. sql += ",@sAmtThresholdId = " + FilterString(id);
  25. sql += ",@sCountryId =" + FilterString(sCountryId);
  26. sql += ",@sCountryName =" + FilterString(sCountryName);
  27. sql += ",@rCountryId =" + FilterString(rCountryId);
  28. sql += ",@rCountryName =" + FilterString(rCountryName);
  29. sql += ",@sAgent =" + FilterString(sAgent);
  30. sql += ",@Amount =" + FilterString(Amount);
  31. sql += ",@MessageTxt =N" + FilterString(MessageTxt);
  32. sql += ",@isActive =" + FilterString(isActive);
  33. sql += ",@user =" + FilterString(user);
  34. return ParseDbResult(sql);
  35. }
  36. public DataRow SelectById(string user, string id)
  37. {
  38. string sql = "EXEC proc_sendingAmtThreshold";
  39. sql += " @flag = 'a'";
  40. sql += ", @user = " + FilterString(user);
  41. sql += ", @sAmtThresholdId = " + FilterString(id);
  42. DataSet ds = ExecuteDataset(sql);
  43. if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
  44. return null;
  45. return ds.Tables[0].Rows[0];
  46. }
  47. public DbResult DeleteThreshold(string id, string user)
  48. {
  49. var sql = "EXEC proc_sendingAmtThreshold @flag='d'";
  50. sql += ", @sAmtThresholdId = " + FilterString(id);
  51. sql += ",@user =" + FilterString(user);
  52. return ParseDbResult(sql);
  53. }
  54. }
  55. }