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.2 KiB

  1. using Swift.DAL.Remittance.LawsonDeposits;
  2. using Swift.web.Library;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. namespace Swift.web.AgentNew.Administration.CustomerSetup.LawsonCardAgent
  10. {
  11. public partial class LawsonCardAgent : System.Web.UI.Page
  12. {
  13. private readonly RemittanceLibrary _sl = new RemittanceLibrary();
  14. private readonly StaticDataDdl _sdd = new StaticDataDdl();
  15. private readonly LawsonDepositDao _cd = new LawsonDepositDao();
  16. private const string ViewFunctionId = "42100000";
  17. private const string ApproveFunctionId = "42100010";
  18. protected void Page_Load(object sender, EventArgs e)
  19. {
  20. Authenticate();
  21. if (!IsPostBack)
  22. {
  23. PopulateDDL();
  24. }
  25. }
  26. private void Authenticate()
  27. {
  28. _sl.CheckAuthentication(ViewFunctionId);
  29. }
  30. private void PopulateDDL()
  31. {
  32. var user = GetStatic.GetUser();
  33. _sdd.SetDDL(ref ddlSearchBy, "exec proc_sendPageLoadData @flag='search-cust-by'", "VALUE", "TEXT", "", "");
  34. }
  35. protected void btnAssignLawsonCard_Click(object sender, EventArgs e)
  36. {
  37. var customerId = txtSearchData.Value;
  38. var confimCardNumber = Request.Form["confirmCardNumber"];
  39. var cardNo = Request.Form["cardNumber"];
  40. if (string.IsNullOrEmpty(customerId))
  41. {
  42. GetStatic.AlertMessage(this, "Please select a customer");
  43. }
  44. if (string.IsNullOrEmpty(confimCardNumber))
  45. {
  46. GetStatic.AlertMessage(this, "Please select a customer");
  47. }
  48. var dbResult = _cd.AssignLawsonCard(GetStatic.GetUser(), customerId, cardNo);
  49. //if(dbResult.ErrorCode == "0")
  50. //{
  51. GetStatic.AlertMessage(this, dbResult.Msg);
  52. txtSearchData.Value = "";
  53. txtSearchData.Text = "";
  54. confirmCardNumber.Text = "";
  55. cardNumber.Text = "";
  56. //}
  57. //else
  58. //{
  59. // GetStatic.AlertMessage(this, dbResult.Msg);
  60. //}
  61. }
  62. }
  63. }