コード例 #1
0
        public List <TransactionHistoryModel> GetTransactionHistory(long checkingAccountNum)
        {
            List <TransactionHistoryModel> THList = null;


            try
            {
                CacheAbstraction cabs = new CacheAbstraction();
                THList = cabs.Retrieve <List <TransactionHistoryModel> >("TRHISTORY" + ":" + checkingAccountNum);
                if (THList != null)
                {
                    return(THList);
                }
                string sql = "select th.*, trt.TransactionTypeName from TransactionHistories th "
                             + "inner join TransactionTypes trt on th.TransactionTypeId=trt.TransactionTypeId "
                             + "where CheckingAccountNumber=@CheckingAccountNumber";
                List <DbParameter> ParamList = new List <DbParameter>();
                SqlParameter       p1        = new SqlParameter("@CheckingAccountNumber", SqlDbType.BigInt);
                p1.Value = checkingAccountNum;
                ParamList.Add(p1);
                DataTable dt = _idac.GetManyRowsCols(sql, ParamList);

                //if (dt.Rows[0]["Amount"].ToString() != null)
                //{
                //    string amt = dt.Rows[0]["Amount"].ToString();
                //}
                THList = DBList.ToList <TransactionHistoryModel>(dt);
                cabs.Insert("TRHISTORY" + ":" + checkingAccountNum, THList);
            }
            catch (Exception)
            {
                throw;
            }
            return(THList);
        }
コード例 #2
0
        public Loan getLoan(int loanid)
        {
            string      sql      = "select * from Loan where LoanId = @loanid";
            List <Loan> loanlist = new List <Loan>();
            Loan        loan     = null;

            try
            {
                List <DbParameter> paramList = new List <DbParameter>();
                SqlParameter       p1        = new SqlParameter("@loanid", SqlDbType.Int);
                p1.Value = loanid;
                paramList.Add(p1);
                DataTable dt = _idac.GetManyRowsCols(sql, paramList);
                loanlist = DBList.ToList <Loan>(dt);
                if (loanlist.Count > 0)
                {
                    loan = loanlist[0];
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(loan);
        }
コード例 #3
0
        public List <Loan> getAllLoans()
        {
            string      sql      = "select * from Loan";
            List <Loan> loanList = new List <Loan>();

            try
            {
                DataTable dt = _idac.GetManyRowsCols(sql);
                loanList = DBList.ToList <Loan>(dt);
            }
            catch (Exception)
            {
                throw;
            }

            return(loanList);
        }
コード例 #4
0
        public List <Loan> getAllLoansForUser(string username)
        {
            string      sql      = "select * from Loan where UserName = @Username";
            List <Loan> loanList = new List <Loan>();

            try
            {
                List <DbParameter> paramList = new List <DbParameter>();
                SqlParameter       p1        = new SqlParameter("@Username", SqlDbType.VarChar, 50);
                p1.Value = username;
                paramList.Add(p1);
                DataTable dt = _idac.GetManyRowsCols(sql, paramList);
                loanList = DBList.ToList <Loan>(dt);
            }
            catch (Exception)
            {
                throw;
            }

            return(loanList);
        }
コード例 #5
0
        public List <BillPayment> GetUnPaidBills(string username)
        {
            string             sql          = "select * from BillPayment where Username=@Username and Status = 'UNPAID'";
            List <BillPayment> billPayments = new List <BillPayment>();

            try
            {
                List <DbParameter> paramList = new List <DbParameter>();
                SqlParameter       p1        = new SqlParameter("@Username", SqlDbType.VarChar, 50);
                p1.Value = username;
                paramList.Add(p1);
                DataTable dt = _idac.GetManyRowsCols(sql, paramList);
                billPayments = DBList.ToList <BillPayment>(dt);
            }
            catch (Exception)
            {
                throw;
            }

            return(billPayments);
        }