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.

41 lines
1.6 KiB

  1. using Swift.DAL.SwiftDAL;
  2. using System.Data;
  3. namespace Swift.DAL.BL.System.Utility
  4. {
  5. public class AgentLocationSetupDao:SwiftDao
  6. {
  7. public DbResult Update(string user, string locationId, string agentId, string city, string country, string address, string zip,string postalCode)
  8. {
  9. string sql = "exec [proc_agentDoorToDoorLocation]";
  10. sql += " @flag =" + (locationId == "0" ? "'i'" : "'u'");
  11. sql += ",@user=" + FilterString(user);
  12. sql += ",@locationId=" + FilterString(locationId);
  13. sql += ",@agentId=" + FilterString(agentId);
  14. sql += ",@city=" + FilterString(city);
  15. sql += ",@country=" + FilterString(country);
  16. sql += ",@address=" + FilterString(address);
  17. sql += ",@zip=" + FilterString(zip);
  18. sql += ",@postalCode=" + FilterString(postalCode);
  19. return ParseDbResult(sql);
  20. }
  21. public DbResult Delete(string user, string locationId)
  22. {
  23. string sql = "exec [proc_agentDoorToDoorLocation]";
  24. sql += " @flag = 'd'";
  25. sql += ",@locationId=" + FilterString(locationId);
  26. sql += ",@user=" + FilterString(user);
  27. return ParseDbResult(sql);
  28. }
  29. public DataRow SelectById(string user, string locationId)
  30. {
  31. string sql = "exec [proc_agentDoorToDoorLocation]";
  32. sql += " @flag = 'a'";
  33. sql += ",@locationId=" + FilterString(locationId);
  34. sql += ",@user=" + FilterString(user);
  35. return ExecuteDataRow(sql);
  36. }
  37. }
  38. }