public string AddNewSpotItem(TradeSharpConnection context, SpotModel model) { var result = string.Empty; var newContext = EnsureContext(ref context); try { var spot = new SPOT { ComBase = model.ComBase, ComCounter = model.ComCounter, Title = model.Title, CodeFXI = model.CodeFXI, MinVolume = model.MinVolume, MinStepVolume = model.MinStepVolume, Precise = model.Precise, SwapBuy = model.SwapBuy, SwapSell = model.SwapSell, Description = model.Description }; context.SPOT.Add(spot); context.SaveChanges(); } catch (Exception ex) { Logger.Error("AddNewSpotItem()", ex); result = ex.Message; } finally { if (newContext != null) newContext.Dispose(); } return result; }
public static TradeTicker DecorateTicker(SPOT spot) { return(new TradeTicker { ActiveBase = spot.ComBase, ActiveCounter = spot.ComCounter, CodeFXI = spot.CodeFXI, Description = spot.Description, Precision = spot.Precise, SwapBuy = spot.SwapBuy, SwapSell = spot.SwapSell, Title = spot.Title }); }
public static TradeTicker DecorateTicker(SPOT spot) { return new TradeTicker { ActiveBase = spot.ComBase, ActiveCounter = spot.ComCounter, CodeFXI = spot.CodeFXI, Description = spot.Description, Precision = spot.Precise, SwapBuy = spot.SwapBuy, SwapSell = spot.SwapSell, Title = spot.Title }; }