Beispiel #1
0
        private string run_calc_commission(accountList account)
        {
            string clientlist = "";
            //foreach(clientList List in account.clientList)
            //{
            //    clientlist = clientlist + List.client_mt4_login + ",";
            //}
            string     Api_Url      = "http://mt4api.4webdemo.com/";
            HttpClient client       = new HttpClient();
            var        json_content = new Dictionary <string, string>
            {
                ["servername"]       = account.broker_productList.servername,
                ["broker_mt4_login"] = account.ib_mt4_login.ToString(),
                ["broker_mt4_commission_percent"] = account.broker_productList.mt4_commission_percent.ToString(),
                ["lot_commission"] = account.broker_productList.lot_commission.ToString(),
                ["ib_mt4_login"]   = account.ib_mt4_login.ToString(),
                ["clientlist"]     = clientlist
            };
            var    postData     = new FormUrlEncodedContent(json_content);
            var    post         = client.PostAsync(Api_Url + "Webapi/CalculationLot", postData).Result;
            string responseBody = post.Content.ReadAsStringAsync().Result;
            var    responseList = JsonConvert.DeserializeObject <dynamic>(responseBody); //memberId,account,password

            return(responseList);
        }
Beispiel #2
0
        private static void listAccount()
        {
            Console.WriteLine("Account list");

            if (accountList.Count == 0)
            {
                Console.WriteLine("No account registered.");
                return;
            }

            for (int i = 0; i < accountList.Count; i++)
            {
                accountList account = accountList[i];
                Console.Write("#{0} - ", i);
                Console.WriteLine(account);
            }
        }