protected void btnUpdateVersion_Click(object sender, EventArgs e)
        {
            SystemParameter.UpdateBlacklistVersion();

            BlackTableHelper.Update();

            this.JscriptMsg("版本更新成功,新版本号:{0}".FormatWith(SystemParameter.BlacklistVersion), null, "Success");
        }
Ejemplo n.º 2
0
        void Application_Start(object sender, EventArgs e)
        {
            DeviceCache.Current.Init();
            BlackTableHelper.Load();

            SystemParameter.Refresh();

            RequestPageTask.PagePath = ApplicationHelper.GetDomain(true, true) + "App_Page/Public/Default.aspx";
        }
Ejemplo n.º 3
0
        public void GetCurrencyNumberBytesTest()
        {
            CurrencyBlacklist item = new CurrencyBlacklist()
            {
                CurrencyKindCode = 0,
                FaceAmount       = 100,
                CurrencyVersion  = 2005,
                CurrencyNumber   = "HD12345678"
            };

            byte[] actual;
            actual = BlackTableHelper.GetCurrencyNumberBytes(item);
            var temp = Unity.GetCurrencyNo(actual, 5);

            Assert.IsTrue(temp == item.CurrencyNumber);
        }
Ejemplo n.º 4
0
        public void Start()
        {
            DeviceCache.Current.Init();
            BlackTableHelper.Load();
            ServerInstrumentation.Current.Init();

            if (File.Exists("data.txt"))
            {
                File.Delete("data.txt");
            }

            var port  = CurrencyStoreSection.Instance.Server.Port;
            var queue = CurrencyStoreSection.Instance.Server.Backlog;

            socketListener = new TcpSocketListener(IPAddress.Any, port, queue);
            socketListener.SocketConnected += new EventHandler <SocketEventArgs>(SocketConnected);
            socketListener.Start();
            //processor.Start();
        }
Ejemplo n.º 5
0
        protected void btnClear_Click(object sender, EventArgs e)
        {
            if (this.cbCurrencyInfo.Checked)
            {
                var service = ServiceFactory.GetService <ICurrencyService>();

                service.DeleteAll_Info();
            }

            if (this.cbBlackList.Checked)
            {
                var service = ServiceFactory.GetService <ICurrencyService>();

                service.Delete_Blacklist(0);

                SystemParameter.UpdateBlacklistVersion();

                BlackTableHelper.Update();
            }

            if (this.cbDeviceInfo.Checked)
            {
                var service = ServiceFactory.GetService <IDeviceService>();

                service.Delete_Info(0);
            }

            if (this.cbOrg.Checked)
            {
                var service = ServiceFactory.GetService <IBasicService>();

                service.Delete_Organization(0, null);
            }

            if (this.cbUserlogin.Checked)
            {
                var service = ServiceFactory.GetService <IUserService>();

                service.Delete_Login(0);
            }

            this.JscriptMsg("数据删除成功", null, "Success");
        }
Ejemplo n.º 6
0
        public byte[] GetBytes(byte flag)
        {
            byte[]       buff = null;
            BinaryWriter sw   = null;// new BinaryWriter(stream);

            //Int16 val = 0xAA + 0xBB;
            if (Type == (int)MessageType.Beep)
            {
                buff = new byte[8];
                sw   = GetWriter(buff);
                sw.WriteShort((short)buff.Length);
                WriteCommand(sw);
            }

            else if (Type == (int)MessageType.Login)
            {
                buff = new byte[16];
                sw   = GetWriter(buff);
                sw.WriteShort((short)buff.Length);
                WriteCommand(sw);
                sw.Write(Key);
                var tmp = DateTime.Now.GetBytes();
                sw.Write(tmp);
                sw.Write(flag);//注册标志;
            }

            else if (Type == (int)MessageType.Detail)
            {
                buff = new byte[9];
                sw   = GetWriter(buff);
                sw.WriteShort((short)buff.Length);
                WriteCommand(sw);

                if (Datas != null)
                {
                    sw.Write(flag);
                }
            }

            else if (Type == (int)MessageType.BlackTable)
            {
                buff = new byte[13];
                sw   = GetWriter(buff);
                sw.WriteShort((short)buff.Length);
                WriteCommand(sw);
                var table   = BlackTableHelper.GetBlackTable();
                var version = BlackTableHelper.GetBlackTableVersion(table);
                sw.Write(version);
                var len = (short)BlackTableHelper.GetBlackTable().CurrenciesNumber.Count;
                sw.WriteShort(len);
            }

            else if (Type == (int)MessageType.DownLoadBlackTable)
            {
                buff = new byte[26];
                sw   = GetWriter(buff);
                sw.WriteShort((short)buff.Length);
                WriteCommand(sw);
                var index = Datas.ReadShort(0);
                var lst   = BlackTableHelper.GetBlackTable().CurrenciesNumber;
                if (index > lst.Count)
                {
                    sw.Write(BlackTable.Blank);
                }

                else
                {
                    var item = lst[index - 1];
                    sw.Write(item);
                }
            }

            if (sw != null)
            {
                var count = Sum(buff);
                sw.WriteShort(count);
                sw.Close();
            }

            return(buff);
        }