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.

67 lines
2.1 KiB

  1. using Swift.DAL.BL.Remit.Administration;
  2. using Swift.DAL.SwiftDAL;
  3. using Swift.web.Library;
  4. using System;
  5. using System.Data;
  6. using System.Text;
  7. namespace Swift.web.Remit.Administration.AgentBankMapping
  8. {
  9. public partial class Manage : System.Web.UI.Page
  10. {
  11. private readonly StaticDataDdl _sdd = new StaticDataDdl();
  12. private readonly CountryDao obj = new CountryDao();
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. GetStatic.PrintMessage(Page);
  16. if (!IsPostBack)
  17. {
  18. PopulateMenu();
  19. }
  20. }
  21. private void PopulateMenu()
  22. {
  23. _sdd.SetDDL(ref ddlApiBank, "exec proc_dropDownLists2 @flag='getAPIBank' ", "agentId", "agentName", "", "Select");
  24. }
  25. protected void btnSearch_Click(object sender, EventArgs e)
  26. {
  27. DataTable dt = obj.getAgentMappingData(ddlApiBank.SelectedValue, GetStatic.GetUser());
  28. int count = 1;
  29. StringBuilder sb = new StringBuilder();
  30. if (dt == null || dt.Rows.Count == 0)
  31. {
  32. return;
  33. }
  34. showData.Visible = true;
  35. foreach (DataRow dr in dt.Rows)
  36. {
  37. sb.Append("<tr>");
  38. sb.Append("<td>" + (count++) + " </td>");
  39. sb.Append("<td>" + dr["partnerName"].ToString() + " </td>");
  40. sb.Append("<td>" + dr["checkbox"].ToString() + " </td>");
  41. sb.Append("</tr>");
  42. }
  43. rpt.InnerHtml = sb.ToString();
  44. }
  45. protected void btnSave_Click(object sender, EventArgs e)
  46. {
  47. var checkedvalue = Request.Form["functionId"];
  48. DbResult res = obj.SaveData(checkedvalue, GetStatic.GetUser(), ddlApiBank.SelectedValue);
  49. GetStatic.SetMessage(res);
  50. if (res.ErrorCode != "0")
  51. {
  52. return;
  53. }
  54. Response.Redirect("List.aspx");
  55. }
  56. protected void btnCancel_Click(object sender, EventArgs e)
  57. {
  58. showData.Visible = false;
  59. PopulateMenu();
  60. }
  61. }
  62. }