Example #1
0
        public void AddOptional(string contractid)
        {
            if (string.IsNullOrEmpty(UserInfoHelper.UserId))
            {
                MessageBox.Show("登录之后才能加入自选!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            string msg = "{\"cmdcode\":2246,\"content\":{\"user_id\":\"" + UserInfoHelper.UserId + "\",\"contract_id\":\"" + contractid + "\"}}";

            scoketManager.SendTradeWSInfo(msg);
        }
Example #2
0
        public void SendLoginInfo(string username, string pwd, string mac, string ip)
        {
            string time  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string token = MD5Helper.EncryptWithMD5(time);
            string msg   = "{\"cmdcode\":2235,\"content\":{\"login_name\":\"" + username + "\",\"password\":\"" + pwd + "\",\"resource\":0,\"mac_address\":\"" + mac + "\",\"ip_address\":\"" + ip + "\",\"time\":\"" + time + "\",\"token\":\"" + time + "\"}}";

            scoketManager.SendTradeWSInfo(msg);
        }
        public void DelOptional(string serialnumber)
        {
            scoketManager = ScoketManager.GetInstance();
            if (string.IsNullOrEmpty(serialnumber))
            {
                return;
            }
            string msg = "{\"cmdcode\":2248,\"content\":{\"serial_number\":\"" + serialnumber + "\"}}";

            scoketManager.SendTradeWSInfo(msg);
        }
        public void AddOptional(string contractid)
        {
            scoketManager = ScoketManager.GetInstance();
            if (string.IsNullOrEmpty(UserInfoHelper.UserId))
            {
                return;
            }
            string msg = "{\"cmdcode\":2246,\"content\":{\"user_id\":\"" + UserInfoHelper.UserId + "\",\"contract_id\":\"" + contractid + "\"}}";

            scoketManager.SendTradeWSInfo(msg);
        }
        public void ReqTcp(int cmdcode, string userid)
        {
            ReqPotion trm = new ReqPotion();

            trm.cmdcode         = cmdcode;
            trm.content         = new ReqLoginName();
            trm.content.user_id = userid;
            string msg = JsonConvert.SerializeObject(trm);

            _scoketManager.SendTradeWSInfo(msg);
        }