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.

80 lines
2.1 KiB

4 days ago
  1. using NFine.Application.SRM;
  2. using NFine.Code;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace NFine.Web.Areas.SRM.Controllers
  10. {
  11. public class InvAddController : ControllerBase
  12. {
  13. // GET: SRM/InvAdd
  14. RFQManagerApp app = new RFQManagerApp();
  15. public ActionResult Index()
  16. {
  17. return View();
  18. }
  19. public ActionResult Invmes() {
  20. return View();
  21. }
  22. [HttpGet]
  23. public ActionResult GetINv(string invcode,Pagination pagination,string workpoint, string InvName) {
  24. DataTable ListData = app.Getinv(invcode, ref pagination,workpoint, InvName);
  25. var JsonData = new
  26. {
  27. total = pagination.total,
  28. page = pagination.page,
  29. records = pagination.records,
  30. rows = ListData,
  31. };
  32. return Content(JsonData.ToJson());
  33. }
  34. public void AddInvtoTemp(string json) {
  35. app.AddinvtoTemp(json);
  36. }
  37. [HttpGet]
  38. public ActionResult GetInvTab(string rfqno,Pagination pagination) {
  39. DataTable table=app.GetInvTable(rfqno);
  40. var JsonData = new
  41. {
  42. total = pagination.total,
  43. page = pagination.page,
  44. records = pagination.records,
  45. rows = table
  46. };
  47. return Content(JsonData.ToJson());
  48. }
  49. public void ClearInvTemp() {
  50. app.ClearTempTab();
  51. }
  52. public ActionResult GetInvRow(string id) {
  53. return Content(app.GetInvRow(id).ToJson());
  54. }
  55. public ActionResult DeleteInvRow(string keyValue) {
  56. string msg = app.DeleteInvTab(keyValue);
  57. if (string.IsNullOrEmpty(msg))
  58. {
  59. return Success("删除成功!");
  60. }
  61. else
  62. {
  63. return Error(msg);
  64. }
  65. //return Content(app.DeleteInvTab(json));
  66. }
  67. }
  68. }