WarehouseController.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using LeaRun.Application.Busines.WarehouseManage;
  2. using LeaRun.Util;
  3. using LeaRun.Util.WebControl;
  4. using Newtonsoft.Json;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Web;
  9. using System.Web.Mvc;
  10. namespace LeaRun.Application.Web.Areas.WarehouseManage.Controllers
  11. {
  12. public class WarehouseController : MvcControllerBase
  13. {
  14. //
  15. // GET: /WarehouseManage/Warehouse/
  16. private WMWarehousBLL bll = new WMWarehousBLL();
  17. #region 视图
  18. public ActionResult Index()
  19. {
  20. return View();
  21. }
  22. public ActionResult Form()
  23. {
  24. return View();
  25. }
  26. #endregion
  27. #region 数据
  28. public ActionResult GetListJson(Pagination pagination)
  29. {
  30. var data = bll.getWarehouseList(pagination);
  31. var watch = CommonHelper.TimerStart();
  32. var JsonData = new
  33. {
  34. rows = JsonConvert.DeserializeObject(data),
  35. total = pagination.total,
  36. page = pagination.page,
  37. records = pagination.records,
  38. costtime = CommonHelper.TimerEnd(watch)
  39. };
  40. return Content(JsonData.ToJson());
  41. }
  42. public ActionResult SaveFrom(String Code, String WarehouseName)
  43. {
  44. bll.SaveFrom(Code, WarehouseName);
  45. return Success("操作成功。");
  46. }
  47. #endregion
  48. }
  49. }