Пример #1
0
        public float GetMoneyAmountByAccountId(int accountId)
        {
            var reader = new AccountGateway().GetMoneyAmountByAccountId(accountId);

            var   list   = new List <object>();
            float amount = 0;

            while (reader.Read())
            {
                amount = float.Parse(reader.GetValue(0).ToString());
            }

            return(amount);
        }
Пример #2
0
        public IList <object> GetAccountsByClientId(int id)
        {
            var reader = new AccountGateway().GetClientAccounts(id);

            var accountsList = new List <object>();

            while (reader.Read())
            {
                accountsList.Add(new
                {
                    Id           = Convert.ToInt32(reader.GetValue(0)),
                    Type         = reader.GetValue(1).ToString(),
                    Money        = float.Parse(reader.GetValue(2).ToString()),
                    CreationDate = Convert.ToDateTime(reader.GetValue(3).ToString())
                });
            }

            return(accountsList);
        }