示例#1
0
        private void btnAddAccount_Click(object sender, EventArgs e)
        {
            K2DS.K2AccountDS svc = new K2DS.K2AccountDS();
            K2DataObjects.Account account = new K2DataObjects.Account();
            account.FirmCode="ZZZZ";
            account.AccountCode="acme";
            account.LongName="Some very long name";
            account.VenueCode="super";

            svc.Insert(account,true);
        }
示例#2
0
        public void AddAccountTest()
        {
            K2DS.K2AccountDS svc = new K2DS.K2AccountDS();
            K2DataObjects.Account account = new K2DataObjects.Account();
            account.FirmCode = "ZZZZ";
            account.AccountCode = "ZZ01";
            account.LongName = DateTime.Now.Ticks.ToString();
            account.VenueCode = "V001";
            svc.Insert(account, true);

            var accountResult = svc.GetAccount("ZZ01");
            Assert.AreEqual(accountResult.AccountCode, account.AccountCode);

            Assert.AreEqual(accountResult.LongName, account.LongName);
        }
示例#3
0
        /// <summary>
        /// Add an account to the KaiTrade Account manager
        /// </summary>
        /// <param name="myAccountCode">Brokers account code (this will be used on orders</param>
        /// <param name="myLongName">Descriptive name</param>
        /// <param name="myFirmCode">Free format test - Code of the broker firm</param>
        protected void AddAccount(string myAccountCode, string myLongName, string myFirmCode)
        {
            K2DataObjects.Account account = new K2DataObjects.Account();
            account.LongName = myLongName;
            // use the descriptive name for the ID since we use that as the lookup on orders
            account.AccountCode = myAccountCode;
            account.VenueCode = m_ID;
            account.FirmCode = myFirmCode;

            // send an account update message to all clients;
            this.sendResponse("AccountUpdate", JsonConvert.SerializeObject(account));
        }