123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EmisTerminal.EIF;
- using System.Threading;
- using System.Runtime.InteropServices;
- namespace EmisTerminal.Controllers
- {
- public class HomeController : Controller
- {
- public ActionResult screensaver()
- {
- return View();
- }
- public ActionResult screensaverTwo()
- {
- return View();
- }
- public ActionResult Index()
- {
- return View();
- }
- public ActionResult IDCertView()
- {
- return View();
- }
- public ActionResult Preview(Guid userID, string idNum)
- {
- return View();
- }
- public ActionResult PrintView(Guid userID, string idNum)
- {
- return View();
- }
- public ActionResult Message(string message)
- {
- ViewBag.Message = message;
- return View();
- }
- [HttpPost]
- public ActionResult Check()
- {
- return Json(IDCert.Check());
- }
- [HttpPost]
- public ActionResult StopCheck()
- {
- IDCert.isStop = true;
- return Json(new ResultMessage<String> { IsSuccess = true, Message = "成功" });
- }
- [HttpPost]
- public ActionResult Print(string pdfFile, Guid userID)
- {
- try
- {
- Report.PrintFile(pdfFile, userID);
- return RedirectToAction("Message", new { message = "打印完成,请取走您的成绩单。" });
- }
- catch (Exception ex)
- {
- return RedirectToAction("Message", new { message = "打印失败:" + ex.Message + "请联系管理员。" });
- }
- return Json(new ResultMessage<String> { IsSuccess = true, Message = "成功" });
- }
- [HttpPost]
- public ActionResult GetPreview(Guid userID, string idNum)
- {
- var fileName = Report.GenerateStudentScore(userID, idNum);
-
- return Json(new ResultMessage<String> { IsSuccess = true, Message = "成功", Data = Url.Content(fileName) });
- }
- }
- }
|