Exemplo n.º 1
0
        public int Login(string Name, string Pwd = "123456")
        {
            var     str = HttpExecutor.Get(string.Format(bs + login, Name, Pwd));
            JObject j   = JObject.Parse(str);
            var     n   = (int)j.Property("Result").Value;

            return(n);
        }
Exemplo n.º 2
0
        public override Result OrderIt(string who, decimal count, decimal price, int dir, params string[] append)
        {
            if (uid == null)
            {
                uid = new LoginHelper().Login(this.Name, this.Pwd);
            }
            var r = HttpExecutor.Get(string.Format(bs + order, (int)uid,
                                                   who, 1, price, count, dir, 2, 1));

            return(new Result {
                Code = 0, Desc = "", Thing = r
            });
        }
Exemplo n.º 3
0
        public void Refresh()
        {
            var     n    = new LoginHelper().Login("hello1", "123456");
            var     str2 = HttpExecutor.Get(string.Format(bs + contracts, n));
            JObject cs   = JObject.Parse(str2);
            var     cs2  = (JArray)cs.Property("Result").Value;
            var     csr  = cs2.Children();

            foreach (JObject v in csr)
            {
                ContractList.Add(Tuple.Create(
                                     (string)v.Property("Id").Value,
                                     (string)v.Property("Code").Value,
                                     (string)v.Property("Name").Value
                                     ));
            }
        }