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.

63 lines
2.1 KiB

  1. using Newtonsoft.Json;
  2. using Swift.DAL.JMEFundTransfer;
  3. using Swift.DAL.SwiftDAL;
  4. using Swift.DAL.Treasury;
  5. using Swift.web.Library;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Data;
  9. using System.Linq;
  10. using System.Web;
  11. using System.Web.Script.Serialization;
  12. using System.Web.UI;
  13. using System.Web.UI.WebControls;
  14. namespace Swift.web.BillVoucher.JMEFundTransfer
  15. {
  16. public partial class FundTransfer : System.Web.UI.Page
  17. {
  18. RemittanceLibrary rl = new RemittanceLibrary();
  19. SwiftLibrary sl = new SwiftLibrary();
  20. JmeFundTransferDao fdo = new JmeFundTransferDao();
  21. private string ViewFunctionId = "20153000";
  22. protected void Page_Load(object sender, EventArgs e)
  23. {
  24. Authenticate();
  25. if (!IsPostBack)
  26. {
  27. date.Text = DateTime.Now.ToString("yyyy/MM/dd");
  28. Misc.MakeNumericTextbox( ref amount);
  29. PopulateDdl();
  30. string MethodName = Request.Form["MethodName"];
  31. switch (MethodName)
  32. {
  33. case "SaveTransfer":
  34. SaveTransfer();
  35. break;
  36. }
  37. }
  38. }
  39. private void Authenticate()
  40. {
  41. rl.HasRight(ViewFunctionId);
  42. rl.CheckSession();
  43. }
  44. private void PopulateDdl()
  45. {
  46. rl.SetDDL(ref currency, "Exec proc_dropDownLists @flag = 'JpyOnly'", "currencyCode", "currencyCode","","");
  47. sl.SetDDL(ref description, "Exec PROC_FUNDTRANSFER @flag = 'descriptionDdl'", "valueField", "textField", "", "");
  48. }
  49. private void SaveTransfer()
  50. {
  51. var date = Request.Form["Date"];
  52. var descritpion = Request.Form["Description"];
  53. var currency = Request.Form["Currency"];
  54. var amount = Request.Form["Amount"];
  55. DbResult res = fdo.SaveFundTranfer(GetStatic.GetUser(), date, descritpion, currency, amount);
  56. Response.ContentType = "text/plain";
  57. Response.Write(JsonConvert.SerializeObject(res));
  58. Response.End();
  59. }
  60. }
  61. }