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.

49 lines
1.5 KiB

  1. using Swift.DAL.VoucherReport;
  2. using Swift.web.Library;
  3. using System;
  4. namespace Swift.web.BillVoucher.VoucherSetting
  5. {
  6. public partial class Manage : System.Web.UI.Page
  7. {
  8. private SwiftLibrary _sl = new SwiftLibrary();
  9. private VoucherReportDAO _vrdao = new VoucherReportDAO();
  10. protected void Page_Load(object sender, EventArgs e)
  11. {
  12. _sl.CheckSession();
  13. if (!IsPostBack)
  14. {
  15. if (!string.IsNullOrWhiteSpace(GetId()))
  16. {
  17. PopulateData();
  18. }
  19. }
  20. }
  21. private void PopulateData()
  22. {
  23. var dr = _vrdao.getVoucherSettingData(GetId());
  24. voucherType.Text = dr["V_TYPE"].ToString();
  25. approvalMode.Text = dr["Approval_mode"].ToString();
  26. createdBy.Text = dr["created_by"].ToString();
  27. createdDate.Text = dr["created_date"].ToString();
  28. modifiedBy.Text = dr["modified_by"].ToString();
  29. modifiedDate.Text = dr["modified_date"].ToString();
  30. }
  31. private string GetId()
  32. {
  33. return GetStatic.ReadQueryString("id", "");
  34. }
  35. protected void btnSave_Click(object sender, EventArgs e)
  36. {
  37. var res = _vrdao.updateVoucherSetting(GetId(), approvalMode.SelectedValue, GetStatic.GetUser());
  38. if (res.ErrorCode == "0")
  39. {
  40. GetStatic.SetMessage(res);
  41. Response.Redirect("List.aspx");
  42. }
  43. }
  44. }
  45. }