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.

39 lines
1.2 KiB

  1. using Swift.web.Library;
  2. using System;
  3. using System.IO;
  4. using System.Web;
  5. namespace Swift.web.Remit.Transaction.TxnDocView
  6. {
  7. /// <summary>
  8. /// Summary description for TxnDocView
  9. /// </summary>
  10. public class TxnDocView : IHttpHandler
  11. {
  12. public void ProcessRequest(HttpContext context)
  13. {
  14. var createdDate = context.Request.QueryString["txnDate"];
  15. var controlNo = context.Request.QueryString["controlNo"];
  16. DateTime txnDate = Convert.ToDateTime(createdDate);
  17. string fileUrl = GetStatic.GetCustomerFilePath() + "Transaction\\CustomerSignature\\" + txnDate.Year.ToString() + "\\" + txnDate.Month.ToString() + "\\" + txnDate.Day.ToString() + "\\" + controlNo + ".png";
  18. if (File.Exists(fileUrl))
  19. {
  20. context.Response.ContentType = fileUrl;
  21. }
  22. else
  23. {
  24. context.Response.ContentType = GetStatic.ReadWebConfig("root", "") + "Images\\na.gif";
  25. }
  26. context.Response.WriteFile(context.Response.ContentType);
  27. }
  28. public bool IsReusable
  29. {
  30. get
  31. {
  32. return false;
  33. }
  34. }
  35. }
  36. }