/// <summary> /// Мапинг объекта "группа счетов" в объект Entity FW. Изменяется переданный объект. /// </summary> /// <param name="dest"></param> /// <param name="src"></param> public static void UndecorateAccountGroup(ACCOUNT_GROUP dest, AccountGroup src) { dest.Code = src.Code; dest.Name = src.Name; dest.IsReal = src.IsReal; dest.BrokerLeverage = (decimal)src.BrokerLeverage; dest.MarginCallPercentLevel = (decimal)src.MarginCallPercentLevel; dest.StopoutPercentLevel = (decimal)src.StopoutPercentLevel; dest.DefaultMarkupPoints = src.DefaultMarkupPoints; dest.DefaultVirtualDepo = src.DefaultVirtualDepo; dest.MarkupType = (int)src.Markup; dest.SwapFree = src.SwapFree; }
public static AccountGroup DecorateAccountGroup(ACCOUNT_GROUP ag) { var group = new AccountGroup { Code = ag.Code, BrokerLeverage = (float)ag.BrokerLeverage, DefaultVirtualDepo = ag.DefaultVirtualDepo ?? 0, IsReal = ag.IsReal, MarginCallPercentLevel = (float)ag.MarginCallPercentLevel, Name = ag.Name, StopoutPercentLevel = (float)ag.StopoutPercentLevel, Markup = (AccountGroup.MarkupType)ag.MarkupType, DefaultMarkupPoints = (float)ag.DefaultMarkupPoints }; return(group); }
/// <summary> /// Мапинг объекта "группа счетов" в объект Entity FW. Возвращает новый объект ACCOUNT_GROUP /// </summary> /// <param name="src"></param> /// <returns></returns> public static ACCOUNT_GROUP UndecorateAccountGroup(AccountGroup src) { var result = new ACCOUNT_GROUP { Code = src.Code, Name = src.Name, IsReal = src.IsReal, BrokerLeverage = (decimal)src.BrokerLeverage, MarginCallPercentLevel = (decimal)src.MarginCallPercentLevel, StopoutPercentLevel = (decimal)src.StopoutPercentLevel, DefaultMarkupPoints = src.DefaultMarkupPoints, DefaultVirtualDepo = src.DefaultVirtualDepo, MarkupType = (int)src.Markup, SwapFree = src.SwapFree }; return(result); }
public static AccountGroup DecorateAccountGroup(ACCOUNT_GROUP ag, DEALER_GROUP dealerGroup) { var group = DecorateAccountGroup(ag); if (dealerGroup == null) { return(group); } group.MessageQueue = dealerGroup.MessageQueue; group.SessionName = dealerGroup.SessionName; group.HedgingAccount = dealerGroup.HedgingAccount; group.SenderCompId = dealerGroup.SenderCompId; group.Markup = (AccountGroup.MarkupType)ag.MarkupType; group.DefaultMarkupPoints = (float)ag.DefaultMarkupPoints; group.Dealer = new DealerDescription { Code = dealerGroup.Dealer }; return(group); }