ConverterExtension.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Com.FirmLib.Entity;
  2. using Com.FirmLib.UI.Common;
  3. using Com.FirmLib.UI.Common.Model;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace Com.FirmLib.UI
  10. {
  11. public static class ConverterExtension
  12. {
  13. public static ProductTypeShowItem ConverterTypeShowItem(this ProductTypeDetailItem detailItem)
  14. {
  15. var productTypeShowItem = new ProductTypeShowItem();
  16. productTypeShowItem.BrandId = detailItem.BrandId;
  17. productTypeShowItem.BrandName = detailItem.BrandName;
  18. productTypeShowItem.ProductId = detailItem.ProductId;
  19. productTypeShowItem.ProductName = detailItem.ProductName;
  20. productTypeShowItem.ProductTypeId = detailItem.ProductTypeId;
  21. productTypeShowItem.ProductTypeName = detailItem.ProductTypeName;
  22. return productTypeShowItem;
  23. }
  24. public static ProductTypeShowItem ConverterTypeShowItemByAsset(this AssetShowItem assetItem)
  25. {
  26. var productTypeShowItem = new ProductTypeShowItem();
  27. productTypeShowItem.BrandId = assetItem.Brand;
  28. productTypeShowItem.BrandName = assetItem.Brand;
  29. productTypeShowItem.ProductId = assetItem.Product;
  30. productTypeShowItem.ProductName = assetItem.Product;
  31. productTypeShowItem.ProductTypeId = assetItem.TypeId;
  32. productTypeShowItem.ProductTypeName = assetItem.Type;
  33. return productTypeShowItem;
  34. }
  35. }
  36. }