示例#1
0
        /// <summary>
        /// Binds the transaction details.
        /// </summary>
        private void BindAccounts()
        {
            var accounts = TransactionDetailsState.ToList();

            gAccountsEdit.DataSource = accounts;
            gAccountsEdit.DataBind();
        }
示例#2
0
        /// <summary>
        /// Binds the transaction details.
        /// </summary>
        private void BindAccounts()
        {
            if (UseSimpleAccountMode && TransactionDetailsState.Count() == 1)
            {
                var txnDetail = TransactionDetailsState.First();
                tbSingleAccountAmount.Label = AccountName(txnDetail.AccountId);
                tbSingleAccountAmount.Text  = txnDetail.Amount.ToString("N2");
            }
            else
            {
                var accounts = TransactionDetailsState.ToList();
                accounts.Add(new FinancialTransactionDetail
                {
                    AccountId = int.MinValue,
                    Amount    = TransactionDetailsState.Sum(d => (decimal?)d.Amount) ?? 0.0M
                });

                gAccountsEdit.DataSource = accounts;
                gAccountsEdit.DataBind();
            }
        }