示例#1
0
        public string Login(string uname, string pword)
        {
            string result = diginoteSystem.Login(uname, pword);

            username = result;

            if (username != null)
            {
                isLoggedIn = true;

                mSellOrders = diginoteSystem.GetPendingSellOrders(username);
                clientForm.UpdateSellOrders(mSellOrders);

                mPurchaseOrders = diginoteSystem.GetPendingPurchaseOrders(username);
                clientForm.UpdatePurchaseOrders(mPurchaseOrders);

                int sellTotal = 0;
                foreach (var order in mSellOrders)
                {
                    sellTotal += order.quantity;
                }

                mWallet = diginoteSystem.GetDiginotes(username);
                clientForm.UpdateDiginotes((mWallet.Count - sellTotal).ToString() + " (" + sellTotal.ToString() + ")");

                mTransactions = diginoteSystem.GetTransactions(username);
                clientForm.UpdateMyTransactions(mTransactions);

                mGlobalTransactions = diginoteSystem.GetRecentTransactions();
                clientForm.UpdateGlobalTransactions(mGlobalTransactions);
            }

            return(username);
        }