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); }
public List <TransferHistory> GetTransferHistory(string chkAcctNum) { List <TransferHistory> TList = null; try { string key = String.Format("TransferHistory_{0}", chkAcctNum); TList = webCache.Retrieve <List <TransferHistory> >(key); if (TList == null) { //TList = new List<TransferHistory>(); DataTable dt = GetTransferHistoryDB(chkAcctNum); TList = RepositoryHelper.ConvertDataTableToList <TransferHistory>(dt); //foreach (DataRow dr in dt.Rows) //{ // TransferHistory the = new TransferHistory(); // the.SetFields(dr); // TList.Add(the); //} webCache.Insert(key, TList); } } catch (Exception ex) { throw ex; }; return(TList); }
public void OnPost() { // read data from cache UserInfo u1 = _cabs.Retrieve <UserInfo>("USER1"); if (u1 != null) { Message = "Data Read from Cache = " + u1.UserName + " " + u1.CheckingAccountNumber; } else { Message = "No Data found in Cache"; } }
public RegistrationModel GetCustomerInfo(string userName) { RegistrationModel Customer = null; List <RegistrationModel> TList = null; try { string key = String.Format("Customer_{0}", userName); Customer = cache.Retrieve <RegistrationModel>(key); if (Customer == null) { DataTable dataTable = GetCustomerDB(userName); TList = RepositoryHelper.ConvertToList <RegistrationModel>(dataTable); Customer = TList.First <RegistrationModel>(); cache.Insert(key, Customer); } } catch (Exception) { throw; } return(Customer); }