ProjectStatistic.js 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. $(function () {
  2. mnu = $.SystemGeneral.getUrlParam("MNU");
  3. var jsonString = "";
  4. var parameterString = "";
  5. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  6. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  7. if (parameterString != "") {
  8. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  9. $("#cgExaminationBatch").combogridX("reload", eval(jsonString));
  10. }
  11. })
  12. function schoolyearChange() {
  13. try {
  14. var examinationBatchUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationBatch/DropDownList?bindType=0';
  15. var schoolyearID = $("#ddlSchoolyear").combobox('getValue');
  16. if (schoolyearID != nonSelect) {
  17. examinationBatchUrl += "&schoolyearID=" + schoolyearID;
  18. }
  19. $("#ddlExaminationBatch").combobox('reload', examinationBatchUrl);
  20. } catch (e) {
  21. }
  22. }
  23. function examinationBatchChange() {
  24. try {
  25. var examinationTypeUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/TypeDropDownList?bindType=0';
  26. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  27. if (examinationBatchID != nonSelect) {
  28. examinationTypeUrl += "&examinationBatchID=" + examinationBatchID;
  29. }
  30. $("#ddlExaminationType").combobox('reload', examinationTypeUrl);
  31. } catch (e) {
  32. }
  33. }
  34. function examinationTypeChange() {
  35. try {
  36. var examinationProjectUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/DropDownList?bindType=0';
  37. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  38. var examinationTypeID = $("#ddlExaminationType").combobox('getValue');
  39. if (examinationBatchID != nonSelect) {
  40. examinationProjectUrl += "&examinationBatchID=" + examinationBatchID;
  41. }
  42. if (examinationTypeID != nonSelect) {
  43. examinationProjectUrl += "&examinationTypeID=" + examinationTypeID;
  44. }
  45. $("#ddlExaminationProject").combobox('reload', examinationProjectUrl);
  46. } catch (e) {
  47. }
  48. }
  49. function examinationProjectLoaded() {
  50. try {
  51. var collegeUrl = CMS_SystemConfig.VirtualDirectoryPath + '/College/CollegeDropdownListOnlyCollege?bindType=1';
  52. $("#ddlCollege").combobox('reload', collegeUrl);
  53. } catch (e) {
  54. }
  55. reload();
  56. }
  57. function querySchoolYear() {
  58. var jsonString = "";
  59. var parameterString = "";
  60. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  61. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  62. if (parameterString != "") {
  63. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  64. $("#cgExaminationBatch").combogridX("reload", eval(jsonString));
  65. }
  66. //reload();
  67. }
  68. function queryBatch() {
  69. var jsonString = "";
  70. var parameterString = "";
  71. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  72. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  73. if (examinationBatchID != nonSelect && examinationBatchID != "") parameterString += "cgExaminationBatch|*|" + examinationBatchID + "|@|";
  74. if (examinationTypeID != nonSelect && examinationTypeID != "") parameterString += "cgExaminationType|*|" + examinationTypeID + "|@|";
  75. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  76. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  77. if (parameterString != "") {
  78. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  79. $("#cgExaminationType").combogridX("reload", eval(jsonString));
  80. $("#cgExaminationProject").combogridX("reload", eval(jsonString));
  81. }
  82. //reload();
  83. }
  84. function queryType() {
  85. var jsonString = "";
  86. var parameterString = "";
  87. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  88. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  89. if (examinationBatchID != nonSelect && examinationBatchID != "") parameterString += "cgExaminationBatch|*|" + examinationBatchID + "|@|";
  90. if (examinationTypeID != nonSelect && examinationTypeID != "") parameterString += "cgExaminationType|*|" + examinationTypeID + "|@|";
  91. if (parameterString != "") {
  92. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  93. $("#cgExaminationProject").combogridX("reload", eval(jsonString));
  94. }
  95. //reload();
  96. }
  97. function collegeChange() {
  98. try {
  99. var jsonString = "";
  100. var parameterString = "";
  101. var collegeID = $("#ddlCollege").combobox('getValue');
  102. var yearID = $("#ddlYear").combobox("getValue");
  103. var schoolAreaID = $("#ddlSchoolArea").combobox("getValue");
  104. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  105. if (yearID != nonSelect) parameterString += "DictionarySchoolyear|*|" + yearID + "|@|";
  106. if (schoolAreaID != nonSelect) parameterString += "ddlSchoolArea|*|" + schoolAreaID + "|@|";
  107. if (parameterString != "") {
  108. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  109. $("#cgbStandard").combogridX("reload", eval(jsonString));
  110. } else {
  111. $("#cgbStandard").combogridX("reload");
  112. }
  113. } catch (e) {
  114. }
  115. }
  116. function standardChange() {
  117. try {
  118. var jsonString = "";
  119. var parameterString = "";
  120. var collegeID = $("#ddlCollege").combobox('getValue');
  121. var yearID = $("#ddlYear").combobox("getValue");
  122. var standardID = $("#cgbStandard").combogridX("getValue");
  123. //var schoolAreaID = $("#ddlSchoolArea").combobox("getValue");
  124. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  125. if (yearID != nonSelect) parameterString += "DictionarySchoolyear|*|" + yearID + "|@|";
  126. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  127. //if (schoolAreaID != nonSelect) parameterString += "ddlSchoolArea|*|" + schoolAreaID + "|@|";
  128. //if (parameterString != "") {
  129. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  130. $("#cgbClassmajor").combogridX("reload", eval(jsonString));
  131. //} else {
  132. // $("#cgbClassmajor").combogridX("reload", eval(jsonString));
  133. //}
  134. } catch (e) {
  135. }
  136. }
  137. function collegeSelect() {
  138. collegeChange();
  139. reload();
  140. }
  141. function standardSelect() {
  142. standardChange();
  143. reload();
  144. }
  145. function reload() {
  146. $("#dgStudentFeeProjectStatisticList").cmsXDataTable("load", $.getDataGridParams("dgStudentFeeProjectStatisticList"));
  147. }
  148. function gridLoaded(data) {
  149. if (data && data.total) {
  150. var rows = $("#dgStudentFeeProjectStatisticList").cmsXDataTable("getRows");
  151. if ($.grep(rows, function (x) { return x.ExaminationBatchID == null; }).length == 0) {
  152. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentFee/ProjectStatisticTotal', $.getDataGridParams("dgStudentFeeProjectStatisticList"),
  153. function (res) {
  154. if (res) {
  155. rows.push({
  156. ExaminationBatchID: null,
  157. ExaminationBatchName: null,
  158. ExaminationTypeID: null,
  159. ExaminationTypeName: null,
  160. ExaminationProjectID: null,
  161. ExaminationProjectName: null,
  162. FeeTypeID: null,
  163. FeeTypeName: null,
  164. TotalRegistCount: res.TotalRegistCount,
  165. TotalRegistAmount: res.TotalRegistAmount,
  166. TotalPaidCount: res.TotalPaidCount,
  167. TotalPaidAmount: res.TotalPaidAmount,
  168. TotalRefundCount: res.TotalRefundCount,
  169. TotalRefundAmount: res.TotalRefundAmount,
  170. TotalRefundApplyCount: res.TotalRefundApplyCount,
  171. TotalRefundApplyAmount: res.TotalRefundApplyAmount,
  172. TotalRefundingCount: res.TotalRefundingCount,
  173. TotalRefundingAmount: res.TotalRefundingAmount,
  174. });
  175. $("#dgStudentFeeProjectStatisticList").cmsXDataTable("loadCurPageData", { rows: rows, total: data.total });
  176. }
  177. });
  178. }
  179. }
  180. }
  181. function ProjectStatistic_Excel() {
  182. $("#formQuery").submit();
  183. }
  184. function startDateChanged(dp) {
  185. $("#StartDate").val($dp.cal.getNewDateStr());
  186. reload();
  187. }
  188. function endDateChanged(dp) {
  189. $("#EndDate").val($dp.cal.getNewDateStr());
  190. reload();
  191. }