public PriceValues DownloadPrice(PriceId priceId) { string script = DownloadString(MagiccardsUrl + "/tcgplayer/hl?sid=" + priceId.Sid); var result = new PriceValues { Sid = priceId.Sid }; if (script == null) { return(result); } var priceMatch = _priceRegex.Match(script); if (!priceMatch.Success) { return(result); } result.Low = parsePrice(priceMatch.Groups["low"].Value); result.Mid = parsePrice(priceMatch.Groups["mid"].Value); result.High = parsePrice(priceMatch.Groups["hig"].Value); return(result); }
public override bool Equals(object obj) { var same = base.Equals(obj); if (same) { return(true); } if (obj is Price) { var price = obj as Price; if ( List.Equals(price.List) && Sale.Equals(price.Sale) && PriceId.Equals(price.PriceId) && MinQuantity.Equals(price.MinQuantity) && PricelistId.Equals(price.PricelistId) ) { return(true); } } return(false); }
private uint BuildOrder() { var offers = service.GetPrices(false, false, new[] { "OriginalName", "PriceCode" }, new[] { "*", PriceId.ToString() }, null, null, 100, 0); var offer = offers.Tables[0].Rows[0]; var orderIds = service.PostOrder(new[] { Convert.ToUInt64(offer["OrderID"]) }, new[] { 1u }, new[] { "Тестовое сообщение" }, new[] { Convert.ToUInt32(offer["OrderCode1"]) }, new[] { Convert.ToUInt32(offer["OrderCode2"]) }, new[] { false }); var orderId = Convert.ToUInt32(orderIds.Tables[0].Rows[0]["OrderID"]); session.CreateSQLQuery(String.Format(@" update orders.ordershead set Submited = 1 where RowId = {0}", orderId)).ExecuteUpdate(); return(orderId); }
public override int GetHashCode() { unchecked { int hashCode = Id; hashCode = (hashCode * 397) ^ (ServiceEntry != null ? ServiceEntry.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PriceId != null ? PriceId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AlgoName != null ? AlgoName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ UseWindow.GetHashCode(); hashCode = (hashCode * 397) ^ MinProfit.GetHashCode(); hashCode = (hashCode * 397) ^ Hashrate.GetHashCode(); hashCode = (hashCode * 397) ^ Power.GetHashCode(); hashCode = (hashCode * 397) ^ (Priority != null ? Priority.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Affinity; hashCode = (hashCode * 397) ^ (Folder != null ? Folder.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Command != null ? Command.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Arguments != null ? Arguments.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DonationFolder != null ? DonationFolder.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DonationCommand != null ? DonationCommand.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DonationArguments != null ? DonationArguments.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { return(PriceId.GetHashCode()); }