public override int GetHashCode() { unchecked { var hash = 17; hash = hash * 29 + Symbol.GetHashCode(); hash = hash * 29 + CorrectionType.GetHashCode(); hash = hash * 29 + TradeDate.GetHashCode(); hash = hash * 29 + TradeTime.GetHashCode(); hash = hash * 29 + TradePrice.GetHashCode(); hash = hash * 29 + TradeSize.GetHashCode(); hash = hash * 29 + TickId.GetHashCode(); hash = hash * 29 + TradeConditions.GetHashCode(); hash = hash * 29 + TradeMarketCentre.GetHashCode(); return(hash); } }
public override int GetHashCode() { unchecked { var hash = 17; hash = hash * 29 + RequestId != null?RequestId.GetHashCode() : 0; hash = hash * 29 + Symbol.GetHashCode(); hash = hash * 29 + ExchangeId.GetHashCode(); hash = hash * 29 + SecurityType.GetHashCode(); hash = hash * 29 + (Last.HasValue ? Last.GetHashCode() : 0); hash = hash * 29 + (TradeSize.HasValue ? TradeSize.GetHashCode() : 0); hash = hash * 29 + (TradedMarket.HasValue ? TradedMarket.GetHashCode() : 0); hash = hash * 29 + (TradeDate.HasValue ? TradeDate.GetHashCode() : 0); hash = hash * 29 + (TradeTime.HasValue ? TradeTime.GetHashCode() : 0); hash = hash * 29 + (Open.HasValue ? Open.GetHashCode() : 0); hash = hash * 29 + (High.HasValue ? High.GetHashCode() : 0); hash = hash * 29 + (Low.HasValue ? Low.GetHashCode() : 0); hash = hash * 29 + (Close.HasValue ? Close.GetHashCode() : 0); hash = hash * 29 + (Bid.HasValue ? Bid.GetHashCode() : 0); hash = hash * 29 + (BidMarket.HasValue ? BidMarket.GetHashCode() : 0); hash = hash * 29 + (BidSize.HasValue ? BidSize.GetHashCode() : 0); hash = hash * 29 + (Ask.HasValue ? Ask.GetHashCode() : 0); hash = hash * 29 + (AskMarket.HasValue ? AskMarket.GetHashCode() : 0); hash = hash * 29 + (AskSize.HasValue ? AskSize.GetHashCode() : 0); hash = hash * 29 + (Volume.HasValue ? Volume.GetHashCode() : 0); hash = hash * 29 + (PDayVolume.HasValue ? PDayVolume.GetHashCode() : 0); hash = hash * 29 + (UpVolume.HasValue ? UpVolume.GetHashCode() : 0); hash = hash * 29 + (DownVolume.HasValue ? DownVolume.GetHashCode() : 0); hash = hash * 29 + (NeutralVolume.HasValue ? NeutralVolume.GetHashCode() : 0); hash = hash * 29 + (TradeCount.HasValue ? TradeCount.GetHashCode() : 0); hash = hash * 29 + (UpTrades.HasValue ? UpTrades.GetHashCode() : 0); hash = hash * 29 + (DownTrades.HasValue ? DownTrades.GetHashCode() : 0); hash = hash * 29 + (NeutralTrades.HasValue ? NeutralTrades.GetHashCode() : 0); hash = hash * 29 + (VWAP.HasValue ? VWAP.GetHashCode() : 0); hash = hash * 29 + (MutualDiv.HasValue ? MutualDiv.GetHashCode() : 0); hash = hash * 29 + (SevenDayYield.HasValue ? SevenDayYield.GetHashCode() : 0); hash = hash * 29 + (OpenInterest.HasValue ? OpenInterest.GetHashCode() : 0); hash = hash * 29 + (Settlement.HasValue ? Settlement.GetHashCode() : 0); hash = hash * 29 + (SettlementDate.HasValue ? SettlementDate.GetHashCode() : 0); hash = hash * 29 + (ExpirationDate.HasValue ? ExpirationDate.GetHashCode() : 0); hash = hash * 29 + (Strike.HasValue ? Strike.GetHashCode() : 0); return(hash); } }
public string EditQuery() { roundParams(); int iTradeClosed = 0; if (TradeClosed == false) { iTradeClosed = 0; ClosingPrice = 0; Comission = 0; Taxes = 0; Profit = 0; } else { iTradeClosed = 1; } int iTradeType = 0; int iInstrumentType = 0; switch (InstrumentType.ToString()) { case "Валюта": iInstrumentType = 0; break; case "Акция": iInstrumentType = 1; break; case "Фьючерс": iInstrumentType = 2; break; } switch (TradeType.ToString()) { case "Long": iTradeType = 0; break; case "Short": iTradeType = 1; break; } //UPDATE `tradesassistant`.`trades` SET `trade_type`='0', `trade_sum`='2120.00' WHERE `id`='6'; string query = "UPDATE `" + Schema + "`.`" + Table + "` SET " + "`instrument_name`='" + InstrumentName + "', " + "`instrument_class`='" + iInstrumentType.ToString() + "', " + "`instrument_ticker`='" + Ticker + "', " + "`trade_type`='" + iTradeType.ToString() + "', " + "`opening_price`='" + OpeningPrice.ToString().Replace(",", ".") + "', " + "`trade_volume`='" + TradeSize.ToString() + "', " + "`trade_sum`='" + TradeSum.ToString().Replace(",", ".") + "', " + "`trade_closed`='" + iTradeClosed.ToString() + "', " + "`closing_price`='" + ClosingPrice.ToString().Replace(",", ".") + "', " + "`comissions`='" + Comission.ToString().Replace(",", ".") + "', " + "`taxes`='" + Taxes.ToString().Replace(",", ".") + "', " + "`profit`='" + Profit.ToString().Replace(",", ".") + "' " + "WHERE `id`='" + TradeId + "';"; return(query); }
//метод формирования строки удаления записи public string AddQuery() { roundParams(); int iTradeClosed = 0; if (TradeClosed == false) { iTradeClosed = 0; } else { iTradeClosed = 1; } int iTradeType = 0; int iInstrumentType = 0; switch (InstrumentType.ToString()) { case "Валюта": iInstrumentType = 0; break; case "Акция": iInstrumentType = 1; break; case "Фьючерс": iInstrumentType = 2; break; } switch (TradeType.ToString()) { case "Long": iTradeType = 0; break; case "Short": iTradeType = 1; break; } string query = "INSERT INTO `" + Schema + "`.`" + Table + "` " + "(`instrument_name`, " + "`instrument_class`, " + "`instrument_ticker`, " + "`trade_type`, " + "`opening_price`, " + "`trade_volume`, " + "`trade_sum`, " + "`trade_closed`, " + "`closing_price`, " + "`comissions`, " + "`taxes`, " + "`profit`) " + "VALUES ('" + InstrumentName + "', '" + iInstrumentType.ToString() + "', '" + Ticker + "', '" + iTradeType.ToString() + "', '" + OpeningPrice.ToString().Replace(",", ".") + "', '" + TradeSize.ToString() + "', '" + TradeSum.ToString().Replace(",", ".") + "', '" + iTradeClosed.ToString() + "', '" + ClosingPrice.ToString().Replace(",", ".") + "', '" + Comission.ToString().Replace(",", ".") + "', '" + Taxes.ToString().Replace(",", ".") + "', '" + Profit.ToString().Replace(",", ".") + "');"; return(query); }