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.

82 lines
2.1 KiB

4 days ago
  1. using Newtonsoft.Json;
  2. using NFine.Application.SRM;
  3. using NFine.Code;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Web;
  9. using System.Web.Mvc;
  10. namespace NFine.Web.Areas.SRM.Controllers
  11. {
  12. public class SupplierAddController : ControllerBase
  13. {
  14. // GET: SRM/SupplierAdd
  15. RFQManagerApp app = new RFQManagerApp();
  16. public ActionResult Index()
  17. {
  18. return View();
  19. }
  20. public ActionResult CustomerMes() {
  21. return View();
  22. }
  23. public ActionResult GetSupplier(string queryJson, Pagination pagination)
  24. {
  25. DataTable ListData = app.GetSup(queryJson, ref pagination);
  26. var JsonData = new
  27. {
  28. total = pagination.total,
  29. page = pagination.page,
  30. records = pagination.records,
  31. rows = ListData,
  32. };
  33. return Content(JsonData.ToJson());
  34. }
  35. public void AddSuptoTemp(string json) {
  36. app.AddSuptoTemp(json);
  37. }
  38. [HttpGet]
  39. public ActionResult GetSupTable(string rfqno, Pagination pagination) {
  40. DataTable table = app.GetSupTable(rfqno);
  41. var JsonData = new
  42. {
  43. total = pagination.total,
  44. page = pagination.page,
  45. records = pagination.records,
  46. rows = table
  47. };
  48. return Content(JsonData.ToJson());
  49. }
  50. public ActionResult Delete(string keyValue) {
  51. string msg = app.DeleteSupTab(keyValue);
  52. if (string.IsNullOrEmpty(msg))
  53. {
  54. return Success("删除成功!");
  55. }
  56. else
  57. {
  58. return Error(msg);
  59. }
  60. //return Content(app.DeleteSupTab(json));
  61. }
  62. public ActionResult GetSupRow(string Id) {
  63. return Content(app.GetSuprow(Id).ToJson());
  64. }
  65. public ActionResult GetCurrency()
  66. {
  67. return Content(JsonConvert.SerializeObject(app.GetCurrencty()));
  68. }
  69. }
  70. }