public override void CopyFrom(BinaryMetaInfo src) { base.CopyFrom(src); var posInfo = (PositionMetaInfo)src; BeginValue = Clone(posInfo.BeginValue); CurrentValue = Clone(posInfo.CurrentValue); BlockedValue = Clone(posInfo.BlockedValue); CurrentPrice = Clone(posInfo.CurrentPrice); AveragePrice = Clone(posInfo.AveragePrice); UnrealizedPnL = Clone(posInfo.UnrealizedPnL); RealizedPnL = Clone(posInfo.RealizedPnL); VariationMargin = Clone(posInfo.VariationMargin); Leverage = Clone(posInfo.Leverage); Commission = Clone(posInfo.Commission); CurrentValueInLots = Clone(posInfo.CurrentValueInLots); Portfolios.Clear(); Portfolios.AddRange(posInfo.Portfolios); ClientCodes.Clear(); ClientCodes.AddRange(posInfo.ClientCodes); DepoNames.Clear(); DepoNames.AddRange(posInfo.DepoNames); SettlementPrice = Clone(posInfo.SettlementPrice); }
public override void CopyFrom(PositionMetaInfo src) { base.CopyFrom(src); BeginValue = Clone(src.BeginValue); CurrentValue = Clone(src.CurrentValue); BlockedValue = Clone(src.BlockedValue); CurrentPrice = Clone(src.CurrentPrice); AveragePrice = Clone(src.AveragePrice); UnrealizedPnL = Clone(src.UnrealizedPnL); RealizedPnL = Clone(src.RealizedPnL); VariationMargin = Clone(src.VariationMargin); Leverage = Clone(src.Leverage); Commission = Clone(src.Commission); CurrentValueInLots = Clone(src.CurrentValueInLots); Portfolios.Clear(); Portfolios.AddRange(src.Portfolios); ClientCodes.Clear(); ClientCodes.AddRange(src.ClientCodes); DepoNames.Clear(); DepoNames.AddRange(src.DepoNames); }
public override void CopyFrom(BinaryMetaInfo src) { base.CopyFrom(src); var tsInfo = (TransactionSerializerMetaInfo)src; FirstOrderId = tsInfo.FirstOrderId; LastOrderId = tsInfo.LastOrderId; FirstTradeId = tsInfo.FirstTradeId; LastTradeId = tsInfo.LastTradeId; FirstTransactionId = tsInfo.FirstTransactionId; LastTransactionId = tsInfo.LastTransactionId; FirstOriginalTransactionId = tsInfo.FirstOriginalTransactionId; LastOriginalTransactionId = tsInfo.LastOriginalTransactionId; FirstCommission = tsInfo.FirstCommission; LastCommission = tsInfo.LastCommission; FirstPnL = tsInfo.FirstPnL; LastPnL = tsInfo.LastPnL; FirstPosition = tsInfo.FirstPosition; LastPosition = tsInfo.LastPosition; FirstSlippage = tsInfo.FirstSlippage; LastSlippage = tsInfo.LastSlippage; Portfolios.Clear(); Portfolios.AddRange(tsInfo.Portfolios); ClientCodes.Clear(); ClientCodes.AddRange(tsInfo.ClientCodes); BrokerCodes.Clear(); BrokerCodes.AddRange(tsInfo.BrokerCodes); DepoNames.Clear(); DepoNames.AddRange(tsInfo.DepoNames); UserOrderIds.Clear(); UserOrderIds.AddRange(tsInfo.UserOrderIds); Comments.Clear(); Comments.AddRange(tsInfo.Comments); SystemComments.Clear(); SystemComments.AddRange(tsInfo.SystemComments); Errors.Clear(); Errors.AddRange(tsInfo.Errors); StrategyIds.Clear(); StrategyIds.AddRange(tsInfo.StrategyIds); }
public async Task <ServiceResponse <int> > PutClientCodes(int id, ClientCodes clientCodes) { var response = new ServiceResponse <int>(); try { if (id != clientCodes.Id) { response.Success = false; response.Message = "Invalid Client"; return(response); } var item = _context.ClientCodes.Find(id); if (item == null) { response.Success = false; response.Message = "Client not found"; return(response); } clientCodes.modifiedDate = DateTime.UtcNow; clientCodes.modifiedBy = LoggedInUser; _context.Entry(item).CurrentValues.SetValues(clientCodes); await _context.SaveChangesAsync(); response.Success = true; response.Message = "Client updated successfully"; response.Data = clientCodes.Id; } catch (DbUpdateConcurrencyException ex) { if (!ClientCodesExists(id)) { response.Success = false; response.Message = "Client not found"; } else { response.Success = false; response.Message = await CustomLog.Log(ex, _context); } } catch (Exception ex) { response.Success = false; response.Message = await CustomLog.Log(ex, _context); } return(response); }
public override void CopyFrom(TransactionSerializerMetaInfo src) { base.CopyFrom(src); FirstOrderId = src.FirstOrderId; LastOrderId = src.LastOrderId; FirstTradeId = src.FirstTradeId; LastTradeId = src.LastTradeId; FirstTransactionId = src.FirstTransactionId; LastTransactionId = src.LastTransactionId; FirstOriginalTransactionId = src.FirstOriginalTransactionId; LastOriginalTransactionId = src.LastOriginalTransactionId; FirstPrice = src.FirstPrice; LastPrice = src.LastPrice; FirstCommission = src.FirstCommission; LastCommission = src.LastCommission; FirstPnL = src.FirstPnL; LastPnL = src.LastPnL; FirstPosition = src.FirstPosition; LastPosition = src.LastPosition; FirstSlippage = src.FirstSlippage; LastSlippage = src.LastSlippage; Portfolios.Clear(); Portfolios.AddRange(src.Portfolios); ClientCodes.Clear(); ClientCodes.AddRange(src.ClientCodes); BrokerCodes.Clear(); BrokerCodes.AddRange(src.BrokerCodes); DepoNames.Clear(); DepoNames.AddRange(src.DepoNames); UserOrderIds.Clear(); UserOrderIds.AddRange(src.UserOrderIds); Comments.Clear(); Comments.AddRange(src.Comments); SystemComments.Clear(); SystemComments.AddRange(src.SystemComments); Errors.Clear(); Errors.AddRange(src.Errors); }
public override void Read(Stream stream) { base.Read(stream); BeginValue = ReadInfo(stream); CurrentValue = ReadInfo(stream); BlockedValue = ReadInfo(stream); CurrentPrice = ReadInfo(stream); AveragePrice = ReadInfo(stream); UnrealizedPnL = ReadInfo(stream); RealizedPnL = ReadInfo(stream); VariationMargin = ReadInfo(stream); Leverage = ReadInfo(stream); Commission = ReadInfo(stream); CurrentValueInLots = ReadInfo(stream); var pfCount = stream.Read <int>(); for (var i = 0; i < pfCount; i++) { Portfolios.Add(stream.Read <string>()); } var ccCount = stream.Read <int>(); for (var i = 0; i < ccCount; i++) { ClientCodes.Add(stream.Read <string>()); } var dnCount = stream.Read <int>(); for (var i = 0; i < dnCount; i++) { DepoNames.Add(stream.Read <string>()); } if (Version < MarketDataVersions.Version33) { return; } SettlementPrice = ReadInfo(stream); }
public async Task <ServiceResponse <int> > PostClientCodes(ClientCodes clientCodes) { var response = new ServiceResponse <int>(); try { clientCodes.createdDate = DateTime.UtcNow; clientCodes.createdBy = LoggedInUser; _context.ClientCodes.Add(clientCodes); await _context.SaveChangesAsync(); response.Data = clientCodes.Id; response.Success = true; response.Message = "Master data type added successfully"; } catch (Exception ex) { response.Success = false; response.Message = await CustomLog.Log(ex, _context); } return(response); }
public ClientCommand(byte cmd) { byteCommand = cmd; opCode = (ClientCodes)cmd; }
public ClientCommand(ClientCodes cmd) { byteCommand = (byte)cmd; opCode = cmd; }