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.

107 lines
4.4 KiB

  1. using Swift.DAL.BL.AgentPanel.Send;
  2. using Swift.web.Library;
  3. using System;
  4. using System.Text;
  5. namespace Swift.web.Remit.CustomerSOA.TxnHistroy
  6. {
  7. public partial class SenderAdvanceSearch : System.Web.UI.Page
  8. {
  9. private readonly StaticDataDdl _sdd = new StaticDataDdl();
  10. private readonly SwiftLibrary sl = new SwiftLibrary();
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. Authenticate();
  14. searchValue.Focus();
  15. }
  16. private void Authenticate()
  17. {
  18. //sl.CheckAuthentication(ViewFunctionId);
  19. sl.CheckSession();
  20. }
  21. private void PopulateDdl()
  22. {
  23. _sdd.SetDDL(ref searchType, "EXEC proc_dropDownLists @flag = 'custSearchType'", "detailTitle", "detailDesc", "", "Select");
  24. }
  25. #region method
  26. private void LoadGrid()
  27. {
  28. rpt_grid.InnerHtml = "";
  29. SendTranIRHDao dao = new SendTranIRHDao();
  30. var dt = dao.LoadCustomerData(searchType.Text, searchValue.Text, "advS", GetStatic.GetCountryId(), GetStatic.GetSettlingAgent());
  31. if (dt == null || dt.Rows.Count == 0)
  32. {
  33. ManageMessage("1", "Record not found for respected Search.");
  34. return;
  35. }
  36. if (dt.Rows[0]["errorCode"].ToString() == "1")
  37. {
  38. ManageMessage(dt.Rows[0]["errorCode"].ToString(), dt.Rows[0]["msg"].ToString());
  39. return;
  40. }
  41. int cnt = 0;
  42. StringBuilder sb = new StringBuilder("<div class='table table-responsive'><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" class=\"table table-bordered table-condensed\">");
  43. sb.AppendLine("<tr >");
  44. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'></th>");
  45. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>Customer ID</th>");
  46. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>Sender Name</th>");
  47. //sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>Receiver Name</th>");
  48. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>Country</th>");
  49. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>Address</th>");
  50. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>Mobile No</th>");
  51. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>ID Type</th>");
  52. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>ID Number</th>");
  53. sb.AppendLine("<th class='frmTitle' nowrap='nowrap'>Valid Date</th>");
  54. sb.AppendLine("</tr>");
  55. for (int i = 0; i < dt.Rows.Count; i++)
  56. {
  57. ++cnt;
  58. sb.AppendLine("<tr onclick='CheckTR(" + cnt + ");' class=" + (cnt % 2 == 0 ? "'oddbg'" : "'evenbg'") + ">");
  59. //for (int j = 0; j < dt.Columns.Count; j++)
  60. //{
  61. sb.AppendLine("<td><input type='radio' name='rdoId' id='rdoId' value=" + dt.Rows[i]["customerId"] + "></td>");
  62. sb.AppendLine("<td>" + dt.Rows[i]["customerId"] + "</td>");
  63. sb.AppendLine("<td>" + dt.Rows[i]["senderName"] + "</td>");
  64. //sb.AppendLine("<td>" + dt.Rows[i]["receiverName"] + "</td>");
  65. sb.AppendLine("<td>" + dt.Rows[i]["countryName"] + "</td>");
  66. sb.AppendLine("<td>" + dt.Rows[i]["address"] + "</td>");
  67. sb.AppendLine("<td>" + dt.Rows[i]["mobile"] + "</td>");
  68. sb.AppendLine("<td>" + dt.Rows[i]["idType"] + "</td>");
  69. sb.AppendLine("<td>" + dt.Rows[i]["idNumber"] + "</td>");
  70. sb.AppendLine("<td>" + dt.Rows[i]["validDate"] + "</td>");
  71. //}
  72. sb.AppendLine("</tr>");
  73. }
  74. sb.AppendLine("</table>");
  75. rpt_grid.InnerHtml = sb.ToString();
  76. }
  77. private void ManageMessage(string res, string msg)
  78. {
  79. GetStatic.CallBackJs1(Page, "Call Back", "alert('" + msg + "');");
  80. }
  81. #endregion method
  82. protected void BtnSave2_Click(object sender, EventArgs e)
  83. {
  84. if (searchValue.Text != "")
  85. LoadGrid();
  86. }
  87. protected void btnOk_Click(object sender, EventArgs e)
  88. {
  89. string id = Request.Form["rdoId"];
  90. GetStatic.CallBackJs1(Page, "Call Back", "CallBack('" + id + "');");
  91. //ManageMessage(id, "");
  92. }
  93. }
  94. }