Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 14.02 KB | None | 0 0
  1. private Product ReadProductLine(int row)
  2.         {
  3.             var product = new Product();
  4.             var productAdd = new ProductAdditionalData();
  5.             product.ProductAdditionalData = productAdd;
  6.             productAdd.Product = product;
  7.  
  8.             product.ShouldBeRemoved = TakeCheckBoxValue(row, 0, "keep");
  9.  
  10.             product.Pid = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(1).ToString();
  11.             product.ProductName = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(2).ToString();
  12.             product.SapProductNumber = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(3).ToString();
  13.             product.ProductDescription = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(4).ToString();
  14.  
  15.             product.ProductDescriptionLong = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(5).ToString();
  16.             product.Language = GetValue(_languageService, row, 6);
  17.             product.Category = GetValue(_categoryService, row, 7);
  18.             product.CategoryId = product.Category.Id;
  19.  
  20.             product.Category2 = GetValue(_categoryService, row, 8);
  21.             product.Category2Id = product.Category2?.Id;
  22.             product.Category3 = GetValue(_categoryService, row, 9);
  23.             product.Category3Id = product.Category3?.Id;
  24.  
  25.             product.ProductAdditionalData.WarrantyDescription = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(10).ToString();
  26.             product.ProductAdditionalData.Modified = TakeDateFromCell(row, 11);
  27.             product.ProductAdditionalData.ModifiedBy = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(12).ToString();
  28.  
  29.             product.ProductAdditionalData.Created = TakeDateFromCell(row, 13);
  30.             product.ProductAdditionalData.CreatedBy = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(14).ToString();
  31.             product.ProductAdditionalData.ComPortBluetooth = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(15).ToString();
  32.             product.ProductAdditionalData.CpuComplete = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(16).ToString();
  33.  
  34.             product.ProductAdditionalData.DatasheetLink = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(17).ToString();
  35.             product.ProductAdditionalData.Facette01 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(18).ToString();
  36.             product.ProductAdditionalData.Facette02 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(19).ToString();
  37.             product.ProductAdditionalData.Facette03 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(20).ToString();
  38.  
  39.             product.ProductAdditionalData.Facette04 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(21).ToString();
  40.             product.ProductAdditionalData.Facette05 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(22).ToString();
  41.             product.ProductAdditionalData.Facette06 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(23).ToString();
  42.             product.ProductAdditionalData.Facette07 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(24).ToString();
  43.  
  44.             product.ProductAdditionalData.Facette08 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(25).ToString();
  45.             product.ProductAdditionalData.Facette09 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(26).ToString();
  46.             product.ProductAdditionalData.Facette10 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(27).ToString();
  47.             product.ProductAdditionalData.Facette11 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(28).ToString();
  48.  
  49.             product.ProductAdditionalData.Facette12 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(29).ToString();
  50.             product.ProductAdditionalData.Facette13 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(30).ToString();
  51.             product.ProductAdditionalData.Facette14 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(31).ToString();
  52.             product.ProductAdditionalData.Facette15 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(32).ToString();
  53.  
  54.             product.ProductAdditionalData.ImageURL1 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(33).ToString();
  55.             product.ProductAdditionalData.ImageURL2 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(34).ToString();
  56.             product.ProductAdditionalData.ImageURL3 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(35).ToString();
  57.             product.ProductAdditionalData.ImageURL4 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(36).ToString();
  58.  
  59.             product.ProductAdditionalData.ImageURL5 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(37).ToString();
  60.             product.ProductAdditionalData.ImageURL6 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(38).ToString();
  61.             product.ProductAdditionalData.ImageURL7 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(39).ToString();
  62.             product.ProductAdditionalData.ImageURL8 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(40).ToString();
  63.  
  64.             product.ProductAdditionalData.ImageURL9 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(41).ToString();
  65.             product.ProductAdditionalData.OsDescription = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(42).ToString();
  66.             product.ProductAdditionalData.PowerSupply1 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(43).ToString();
  67.             product.ProductAdditionalData.PowerSupply2 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(44).ToString();
  68.  
  69.             product.ProductAdditionalData.ProductOverview1 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(45).ToString();
  70.             product.ProductAdditionalData.ProductOverview2 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(46).ToString();
  71.             product.ProductAdditionalData.ProductOverview3 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(47).ToString();
  72.             product.ProductAdditionalData.ProductOverview4 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(48).ToString();
  73.  
  74.             product.ProductAdditionalData.ReferencedProduct01 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(49).ToString();
  75.             product.ProductAdditionalData.ReferencedProduct02 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(50).ToString();
  76.             product.ProductAdditionalData.ReferencedProduct03 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(51).ToString();
  77.             product.ProductAdditionalData.ReferencedProduct04 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(52).ToString();
  78.  
  79.             product.ProductAdditionalData.ReferencedProduct05 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(53).ToString();
  80.             product.ProductAdditionalData.ReferencedProduct06 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(54).ToString();
  81.             product.ProductAdditionalData.ReferencedProduct07 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(55).ToString();
  82.             product.ProductAdditionalData.ReferencedProduct08 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(56).ToString();
  83.  
  84.             product.ProductAdditionalData.ReferencedProduct09 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(57).ToString();
  85.             product.ProductAdditionalData.ReferencedProduct10 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(58).ToString();
  86.             product.ProductAdditionalData.CpuChipset = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(59).ToString();
  87.             product.ProductAdditionalData.Gpu1MemoryDescription = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(60).ToString();
  88.  
  89.             product.ProductAdditionalData.Gpu2MemoryDescription = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(61).ToString();
  90.             product.ProductAdditionalData.GpuSliCrossfireText = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(62).ToString();
  91.             product.ProductAdditionalData.MemoryComplete = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(63).ToString();
  92.             product.ProductAdditionalData.ScopeOfDelivery = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(64).ToString();
  93.  
  94.             product.ProductAdditionalData.Colour = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(65).ToString();
  95.             product.ProductAdditionalData.ScreenComplete = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(66).ToString();
  96.             product.ProductAdditionalData.MemoryCardsSlots = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(67).ToString();
  97.             product.ProductAdditionalData.OsCompatible = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(68).ToString();
  98.  
  99.             product.ProductAdditionalData.SoftwareSalesText = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(69).ToString();
  100.             product.ProductAdditionalData.Usb20Total = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(70).ToString();
  101.             product.ProductAdditionalData.Vga = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(71).ToString();
  102.             product.ProductAdditionalData.KeyFeature1 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(72).ToString();
  103.  
  104.             product.ProductAdditionalData.KeyFeature2 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(73).ToString();
  105.             product.ProductAdditionalData.KeyFeature3 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(74).ToString();
  106.             product.ProductAdditionalData.ComPortUtms = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(75).ToString();
  107.             product.ProductAdditionalData.InterfaceType4 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(76).ToString();
  108.  
  109.             product.ProductAdditionalData.MicrophonesIntegrated = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(77).ToString();
  110.             product.ProductAdditionalData.WebCamDescription = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(78).ToString();
  111.             product.ProductAdditionalData.Nic2Type = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(79).ToString();
  112.             product.ProductAdditionalData.OddComplete = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(80).ToString();
  113.  
  114.             product.ProductAdditionalData.Material = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(81).ToString();
  115.             product.ProductAdditionalData.SmartCardSlots = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(82).ToString();
  116.             product.ProductAdditionalData.ArticleDimensions1 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(83).ToString();
  117.             product.ProductAdditionalData.ArticleWeight = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(84).ToString();
  118.  
  119.             product.ProductAdditionalData.AudioLineIn = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(85).ToString();
  120.             product.ProductAdditionalData.AudioLineOut = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(86).ToString();
  121.             product.ProductAdditionalData.AudioType = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(87).ToString();
  122.             product.ProductAdditionalData.DockingConnectorForPortReplicator = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(88).ToString();
  123.  
  124.             product.ProductAdditionalData.Dvi = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(89).ToString();
  125.             product.ProductAdditionalData.ESata = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(90).ToString();
  126.             product.ProductAdditionalData.HddComplete = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(91).ToString();
  127.             product.ProductAdditionalData.Hdmi = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(92).ToString();
  128.  
  129.             product.ProductAdditionalData.InterfaceType2 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(93).ToString();
  130.             product.ProductAdditionalData.KensingtonLockSupport = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(94).ToString();
  131.             product.ProductAdditionalData.MemoryCapacityTotal = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(95).ToString();
  132.             product.ProductAdditionalData.MemoryTechnology = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(96).ToString();
  133.  
  134.             product.ProductAdditionalData.ModemType = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(97).ToString();
  135.             product.ProductAdditionalData.ScreenSize = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(98).ToString();
  136.             product.ProductAdditionalData.ScreenSizeIntegrated = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(99).ToString();
  137.             product.ProductAdditionalData.ScreenTypeIntegrated = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(100).ToString();
  138.  
  139.             product.ProductAdditionalData.SerialRs232 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(101).ToString();
  140.             product.ProductAdditionalData.SimCardSlots = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(102).ToString();
  141.             product.ProductAdditionalData.AwardPicture1 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(103).ToString();
  142.             product.ProductAdditionalData.AwardPicture2 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(104).ToString();
  143.  
  144.             product.ProductAdditionalData.AwardPicture3 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(105).ToString();
  145.             product.ProductAdditionalData.AwardPicture4 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(106).ToString();
  146.             product.ProductAdditionalData.AwardPicture5 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(107).ToString();
  147.             product.ProductAdditionalData.AwardUrl1 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(108).ToString();
  148.  
  149.             product.ProductAdditionalData.AwardUrl2 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(109).ToString();
  150.             product.ProductAdditionalData.AwardUrl3 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(110).ToString();
  151.             product.ProductAdditionalData.AwardUrl4 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(111).ToString();
  152.             product.ProductAdditionalData.AwardUrl5 = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(112).ToString();
  153.  
  154.             product.ProductAdditionalData.ScreenResponseTime = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(113).ToString();
  155.             product.ProductAdditionalData.Nic1Type = _xlWorksheet.GetOrCreateRow(row).GetOrCreateCell(114).ToString();
  156.             product.Id = TakeLongFromCell(row, 115);
  157.  
  158.             return product;
  159.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement