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.

75 lines
3.4 KiB

  1. using Swift.DAL.ExchangeSystem.LedgerSetup;
  2. using Swift.web.Library;
  3. using System;
  4. using System.Data;
  5. using System.Text;
  6. namespace Swift.web.include
  7. {
  8. public partial class CreateGL : System.Web.UI.Page
  9. {
  10. private LedgerDao _obj = new LedgerDao();
  11. private StringBuilder _str = new StringBuilder();
  12. private SwiftLibrary _sl = new SwiftLibrary();
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. _sl.CheckSession();
  16. LoadGL();
  17. CreateNewGL();
  18. }
  19. private void LoadGL()
  20. {
  21. string pId = GetReportParentId();
  22. var dt = _obj.GetLedgerSubHeader(pId);
  23. _str.Append("<div class=\"row\">");
  24. _str.Append("<ul style='margin-bottom:-10px'>");
  25. if (dt == null || dt.Rows.Count == 0)
  26. {
  27. return;
  28. }
  29. foreach (DataRow dr in dt.Rows)
  30. {
  31. _str.Append("<li style='margin-bottom:-10px'>");
  32. _str.Append("<i class='fa fa-folder-open' alt='click' style='font-size:14px; color:#FFC300; padding:0 5px;'></i> &nbsp;");
  33. _str.Append("<label>" + dr["gl_code"] + "</label>");
  34. // _str.Append("
  35. // <label>
  36. // " +DropDownList[]+ "
  37. // </label>
  38. // ");
  39. _str.Append("<span class=\"action-icon\" onclick=\"ShowReportSubHead('" + dr["gl_code"] + "','tdshow" + dr["gl_code"] + "');\" style=\"cursor: pointer; font-size: 14px; padding:0 10px;\">" + dr["gl_code"] + "-" + dr["gl_desec"] + "(" + dr["tree_sape"] + ")");
  40. _str.Append("</span><a href=\"#\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Edit\" class=\"btn btn-xs btn-primary\" onclick=\"EditLedger('" + dr["gl_code"] + "','" + GetReportParentId() + "')\" style=\"text-decoration:none;font-size:12px;\"><i class=\"fa fa-pencil-square-o\"></i></a>&nbsp;&nbsp;&nbsp;<a href=\"#\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Delete\" class=\"btn btn-xs btn-danger\" onclick=\"DeleteLedger('" + dr["gl_code"] + "')\" style=\"text-decoration:none;font-size:12px;\"><i class=\"fa fa-trash-o\"></i></a>");
  41. _str.Append("</li>");
  42. _str.Append("<li>");
  43. _str.Append("<label id=\"tdshow" + dr["gl_code"] + "\" style=\"display:none\">&nbsp;</label>");
  44. _str.Append("</li>");
  45. //_str.Append("</div>");
  46. }
  47. _str.Append("</ul>");
  48. getLedgerGl.InnerHtml = _str.ToString();
  49. }
  50. private void CreateNewGL()
  51. {
  52. var str = new StringBuilder();
  53. str.Append("<div class=\"row\">");
  54. str.Append("<div class=\"col-md-12\">");
  55. str.Append("<i class='fa fa-files-o' alt='click' style='font-size:12; color:#fff;'></i>");
  56. str.Append("<a href=\"#\" onclick=\"ShowMessage('" + GetReportParentId() + "','" + GetReportParentId() + "')\" style=\"text-decoration:none;font-size:12px; padding:0 5px;\">New GL</a>");
  57. //str.Append("<a href=\"#\" onclick=\"ShowMessageSubcodeAccount('" + GetReportParentId() + "')\" > New AC</a>");
  58. str.Append("</div>");
  59. str.Append("</div>");
  60. _str.Append("</div>");
  61. newDL.InnerHtml = str.ToString();
  62. }
  63. private string GetReportParentId()
  64. {
  65. return GetStatic.ReadQueryString("q", "");
  66. }
  67. }
  68. }