Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 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
     });
 }
Exemplo n.º 3
0
 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
                };
 }