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.

50 lines
1.4 KiB

  1. using NFine.Application.Encrypt;
  2. using NFine.Code;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Mvc;
  8. namespace NFine.Web.Areas.Encrypt.Controllers
  9. {
  10. public class EnciphermentController : Controller
  11. {
  12. EnciphermentApp App = new EnciphermentApp();
  13. // GET: Encrypt/ncrypt
  14. public ActionResult Encrypt()
  15. {
  16. return View();
  17. }
  18. [HttpPost]
  19. [HandlerAjaxOnly]
  20. public ActionResult Encryption(string ICSInspections)
  21. {
  22. try
  23. {
  24. App.Encryption(ICSInspections);
  25. return Success("加密成功");
  26. }
  27. catch (Exception ex)
  28. {
  29. return Error(ex.Message);
  30. }
  31. }
  32. protected virtual ActionResult Success(string message)
  33. {
  34. return Content(new AjaxResult { state = ResultType.success.ToString(), message = message }.ToJson());
  35. }
  36. protected virtual ActionResult Success(string message, object data)
  37. {
  38. return Content(new AjaxResult { state = ResultType.success.ToString(), message = message, data = data }.ToJson());
  39. }
  40. protected virtual ActionResult Error(string message)
  41. {
  42. return Content(new AjaxResult { state = ResultType.error.ToString(), message = message }.ToJson());
  43. }
  44. }
  45. }