WL_SyncServiceModel.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Xml.Linq;
  7. namespace HH.YiDaSyncNC.Models
  8. {
  9. class WL_SyncServiceModel
  10. {
  11. public class DataModel
  12. {
  13. public string pk_group { get; set; }
  14. public string pk_org { get; set; }
  15. public string code { get; set; }
  16. public string name { get; set; }
  17. public string ename { get; set; }
  18. public string pk_marbasclass { get; set; }
  19. public string pk_measdoc { get; set; }
  20. public string pk_mattaxes { get; set; }
  21. public string materialshortname { get; set; }
  22. public string materialspec { get; set; }
  23. public string materialtype { get; set; }
  24. public string ematerialspec { get; set; }
  25. public string pk_brand { get; set; }
  26. public string materialmnecode { get; set; }
  27. public string enablestate { get; set; }
  28. }
  29. public class ImportXml
  30. {
  31. /// <summary>
  32. /// 模板头部份
  33. /// </summary>
  34. /// <returns></returns>
  35. public static XElement TemplateHeade()
  36. {
  37. return new XElement(new XElement("ufinterface", new object[]
  38. {
  39. new XAttribute("sender","dingding"),
  40. new XAttribute("roottag",""),
  41. new XAttribute("replace","Y"),
  42. new XAttribute("isexchange","Y"),
  43. new XAttribute("groupcode","0"),
  44. new XAttribute("filename",""),
  45. new XAttribute("billtype","material"),
  46. new XAttribute("proc","add"),
  47. new XAttribute("account","develop")
  48. }));
  49. }
  50. /// <summary>
  51. /// 组建表头xml
  52. /// </summary>
  53. /// <param name="item">表头参数</param>
  54. /// <returns></returns>
  55. public static XElement Header(DataModel item, string id)
  56. {
  57. return new XElement("bill", new object[]
  58. {
  59. "",
  60. new XAttribute("id",id),
  61. new XElement("billhead", new object[]
  62. {
  63. new XElement("pk_group",item.pk_group),
  64. new XElement("pk_org",item.pk_org),
  65. //new XElement("pk_source",item.pk_source),
  66. new XElement("code",item.code),
  67. new XElement("name",item.name),
  68. new XElement("ename",item.ename),
  69. new XElement("pk_marbasclass",item.pk_marbasclass),
  70. new XElement("pk_measdoc",item.pk_measdoc),
  71. new XElement("pk_mattaxes",item.pk_mattaxes),
  72. new XElement("materialshortname",item.materialshortname),
  73. new XElement("materialspec",item.materialspec),
  74. new XElement("materialtype",item.materialtype),
  75. new XElement("ematerialspec",item.ematerialspec),
  76. new XElement("pk_brand",item.pk_brand),
  77. new XElement("materialmnecode",item.materialmnecode),
  78. new XElement("productfamily","N"),
  79. new XElement("intolerance","0"),
  80. new XElement("outtolerance","0"),
  81. new XElement("outcloselowerlimit","0"),
  82. new XElement("enablestate",item.enablestate),
  83. //new XElement("materialconvert",new object[]{ }),
  84. //new XElement("materialtaxtype",new object[]{ }),
  85. }),
  86. });
  87. }
  88. }
  89. }
  90. }