GTImport.cshtml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. @using EMIS.Web.Controls;
  2. @using Bowin.Web.Controls.Mvc;
  3. @{
  4. Guid finalExaminationID = new Guid(Request["finalExaminationID"]);
  5. Guid scoreFormulaID = new Guid(Request["scoreFormulaID"]);
  6. Guid creditFormulaID = new Guid(Request["creditFormulaID"]);
  7. Guid gradePointFormulaID = new Guid(Request["gradePointFormulaID"]);
  8. string errorFile = Request["errorFile"];
  9. ViewBag.Title = "Import";
  10. }
  11. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  12. @using (Html.BeginForm("GTImport", "Score", new { MNU = Request["MNU"], WindowID = Request["WindowID"] }, FormMethod.Post, new { enctype = "multipart/form-data" }))
  13. {
  14. @Html.Hidden("hid_FinalExaminationID", finalExaminationID)
  15. @Html.Hidden("hid_ScoreFormulaID", scoreFormulaID)
  16. @Html.Hidden("hid_CreditFormulaID", creditFormulaID)
  17. @Html.Hidden("hid_GradePointFormulaID", gradePointFormulaID)
  18. @Html.Hidden("hid_State", 1)
  19. <div class="p_title">
  20. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  21. 学生成绩导入</div>
  22. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("GTImport")</div>
  23. </div>
  24. <div class="search_list">
  25. <table cellpadding="0" cellspacing="1">
  26. <tr>
  27. <td>
  28. <label>
  29. 导入文件:</label>
  30. </td>
  31. <td>
  32. <input type="file" name="file" id="file" accept="*.xls" value=" " />
  33. </td>
  34. </tr>
  35. <tr>
  36. <td colspan="2" style="text-align: center;">
  37. @if (!string.IsNullOrEmpty(errorFile))
  38. {
  39. <span id="error">&nbsp;&nbsp;<a href="@errorFile" target="_blank" style=" color:Red;">错误数据下载</a></span>
  40. }
  41. </td>
  42. </tr>
  43. </table>
  44. </div>
  45. }
  46. </div>
  47. <script type="text/javascript">
  48. function Score_ExcelImport() {
  49. var obj = $("#file").val();
  50. $("#hid_State").val("2");
  51. if (obj == "") {
  52. $.messager.alert("系统提示", "请选择您要导入的文件。");
  53. return;
  54. }
  55. $(document.forms[0]).submit();
  56. }
  57. function Score_ExcelExport() {
  58. $("#hid_State").val("1");
  59. var finalExaminationID = $("#hid_FinalExaminationID").val();
  60. $(document.forms[0]).submit();
  61. }
  62. $(function () {
  63. var errorFile = '@ViewBag.ErrorFile';
  64. if (errorFile != '') {
  65. $('#error').show();
  66. }
  67. });
  68. </script>