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.

70 lines
2.9 KiB

  1. using Swift.web.Library;
  2. using System;
  3. using System.IO;
  4. using System.Web;
  5. namespace Swift.web.Handler
  6. {
  7. /// <summary>
  8. /// Summary description for CustomerSignature
  9. /// </summary>
  10. public class CustomerSignature : IHttpHandler
  11. {
  12. public void ProcessRequest(HttpContext context)
  13. {
  14. var registerDate = context.Request.QueryString["registerDate"];
  15. var customerId = context.Request.QueryString["customerId"];
  16. var membershipNo = context.Request.QueryString["membershipNo"];
  17. var fileName = context.Request.QueryString["fileName"];
  18. var showType = context.Request.QueryString["showType"];
  19. var isForMobileTempUpload = context.Request.QueryString["showType"];
  20. var fileDescription = context.Request.QueryString["fileDescription"];
  21. var isMoved = context.Request.QueryString["isMoved"];
  22. DateTime txnDate = Convert.ToDateTime(registerDate);
  23. string fileUrl = "";
  24. if (context.Request.QueryString["fileDesc"] == "Compliance Document")
  25. {
  26. fileUrl = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + registerDate.Replace("-", "\\") + "\\" + membershipNo + "\\ComplianceDocument\\" + fileName;
  27. }
  28. else
  29. {
  30. if (isForMobileTempUpload == "Y" && isMoved == "N")
  31. fileUrl = GetStatic.GetCustomerFilePath() + "CustomerDocument\\VerifyDocumentUpload\\" + fileName;
  32. else if (showType == "D")
  33. fileUrl = GetStatic.GetCustomerFilePath() + "CustomerDocument\\DepositSlip\\" + fileName;
  34. else if(fileDescription == "Deposit Slip")
  35. fileUrl = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + registerDate.Replace("-", "\\") + "\\" + membershipNo + "\\" + "CustomerDepositSlip\\" + fileName;
  36. else
  37. fileUrl = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + registerDate.Replace("-", "\\") + "\\" + membershipNo + "\\" + fileName;
  38. if (!string.IsNullOrEmpty(showType) && showType == "compliance")
  39. fileUrl = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + registerDate.Replace("-", "\\") + "\\" + membershipNo + "\\ComplianceDocument\\" + fileName;
  40. }
  41. if (File.Exists(fileUrl))
  42. {
  43. context.Response.ContentType = fileUrl.GetFileExtension().GetMimeType();
  44. }
  45. else
  46. {
  47. fileUrl = (GetStatic.ReadWebConfig("root", "") + "Images\\na.gif");
  48. context.Response.ContentType = fileUrl.GetFileExtension().GetMimeType();
  49. }
  50. context.Response.WriteFile(fileUrl);
  51. }
  52. public bool IsReusable
  53. {
  54. get
  55. {
  56. return false;
  57. }
  58. }
  59. }
  60. }