private static ProductBoard WorkSeller(string sel) // Продавец { var seller = new ProductBoard { Markets = sel.Substrings("\"", "\"")[0], Id = sel.Substrings("\"", "\"")[0], Name = sel.Substrings("Local Name</td><td>", "</td>")[0], Class = sel.Substrings("Local Class</td><td>", "</td>")[0], SettlementMethod = sel.Substrings("Settlement Method</td><td>", "</td>")[0], ExchangeWebsite = sel.ContainsIgnoreCase("Exchange Website</td><td><a href=\"") ? sel.Substrings("Exchange Website</td><td><a href=\"", "\"")[0] : string.Empty, TradingHours = sel.Substrings("Sat</th></tr><tr>", "</tr>")[0].Substrings("<td>", "</td>") }; var range1 = sel.Substrings("Increment</th></tr><tr align=\"center\">", "</tr></table>")[0]; var range2 = sel.Substrings("Increment</th></tr><tr align=\"center\">", "</tr></table>")[1]; seller.PriceRange1 = range1.Substrings("<td>", "</td>")[0]; seller.PriceRange2 = range1.Substrings("<td>", "</td>")[2]; seller.PriceRange3 = range2.Substrings("<td>", "</td>")[0]; CultureInfo.InvariantCulture.DoInCulture(() => { seller.VolumeRange1 = range1.Substrings("<td>", "</td>")[1].To <decimal>(); seller.VolumeRange2 = range1.Substrings("<td>", "</td>")[3].To <decimal>(); seller.VolumeRange3 = range2.Substrings("<td>", "</td>")[1].To <decimal>(); }); return(seller); }
private static ProductBoard WorkSeller(string sel) // Продавец { var seller = new ProductBoard { Markets = sel.Substrings("\"", "\"")[0], Id = sel.Substrings("\"", "\"")[0], Name = sel.Substrings("Local Name</td><td>", "</td>")[0], Class = sel.Substrings("Local Class</td><td>", "</td>")[0], SettlementMethod = sel.Substrings("Settlement Method</td><td>", "</td>")[0], ExchangeWebsite = sel.ContainsIgnoreCase("Exchange Website</td><td><a href=\"") ? sel.Substrings("Exchange Website</td><td><a href=\"", "\"")[0] : string.Empty, TradingHours = sel.Substrings("Sat</th></tr><tr>", "</tr>")[0].Substrings("<td>", "</td>") }; var range1 = sel.Substrings("Increment</th></tr><tr align=\"center\">", "</tr></table>")[0]; var range2 = sel.Substrings("Increment</th></tr><tr align=\"center\">", "</tr></table>")[1]; seller.PriceRange1 = range1.Substrings("<td>", "</td>")[0]; seller.PriceRange2 = range1.Substrings("<td>", "</td>")[2]; seller.PriceRange3 = range2.Substrings("<td>", "</td>")[0]; CultureInfo.InvariantCulture.DoInCulture(() => { seller.VolumeRange1 = range1.Substrings("<td>", "</td>")[1].To<decimal>(); seller.VolumeRange2 = range1.Substrings("<td>", "</td>")[3].To<decimal>(); seller.VolumeRange3 = range2.Substrings("<td>", "</td>")[1].To<decimal>(); }); return seller; }