Example #1
0
        public static BlackTable GetBlackTable()
        {
            _table = _client.Get<BlackTable>("BlackTable");

            if (_table == null)
            {
                lock (_sync)
                {
                    if (_table == null)
                    {
                        _table = Load();
                    }
                }
            }

            return _table;
        }
Example #2
0
        public static BlackTable GetBlackTable()
        {
            _table = _client.Get <BlackTable>("BlackTable");

            if (_table == null)
            {
                lock (_sync)
                {
                    if (_table == null)
                    {
                        _table = Load();
                    }
                }
            }

            return(_table);
        }
Example #3
0
        public static byte[] GetBlackTableVersion(BlackTable table)
        {
            var version = table.Version.ToString();

            if (version == "0")
            {
                version = "20000101";
            }

            var result = new byte[3];

            for (int i = 0; i < 3; i++)
            {
                var val = version.Substring(i * 2 + 2, 2);
                var j = Convert.ToInt16(val);
                result[i] = Convert.ToByte(j);
            }

            return result;
        }
Example #4
0
        public static byte[] GetBlackTableVersion(BlackTable table)
        {
            var version = table.Version.ToString();

            if (version == "0")
            {
                version = "20000101";
            }

            var result = new byte[3];

            for (int i = 0; i < 3; i++)
            {
                var val = version.Substring(i * 2 + 2, 2);
                var j   = Convert.ToInt16(val);
                result[i] = Convert.ToByte(j);
            }

            return(result);
        }
Example #5
0
        public static BlackTable Load()
        {
            var version = GetVersion();
            var service = ServiceFactory.GetService <ICurrencyService>();
            var lst     = service.GetList_Blacklist(null, null);
            var table   = new BlackTable();

            table.Version          = version;
            table.CurrenciesNumber = new List <byte[]>();
            foreach (var item in lst)
            {
                var val = GetCurrencyNumberBytes(item);
                table.CurrenciesNumber.Add(val);
            }
            string key = "BlackTable";

            _client.AddOrReplace(key, table);
            logger.Info("black table information updated.");
            return(table);
        }
Example #6
0
 public static BlackTable Load()
 {
     var version = GetVersion();
     var service = ServiceFactory.GetService<ICurrencyService>();
     var lst = service.GetList_Blacklist(null, null);
     var table = new BlackTable();
     table.Version = version;
     table.CurrenciesNumber = new List<byte[]>();
     foreach (var item in lst)
     {
         var val = GetCurrencyNumberBytes(item);
         table.CurrenciesNumber.Add(val);
     }
     string key = "BlackTable";
     _client.AddOrReplace(key, table);
     logger.Info("black table information updated.");
     return table;
 }