Example #1
0
    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);
    }
Example #2
0
    public List <Products> GetProductsByCategory(string catId)
    {
        List <Products> Plist = null;

        try
        {
            if (Plist == null)
            {
                DataTable dt = GetProductsByCategoryDB(catId);
                Plist = RepositoryHelper.ConvertDataTableToList <Products>(dt);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return(Plist);
    }
Example #3
0
    public List <Products> GetProductsBySearch(string ProdName)
    {
        DataTable       dt    = null;
        List <Products> Plist = null;

        try
        {
            if (Plist == null)
            {
                string sql = "Select * from Products where ProductSDesc LIKE '%" + ProdName + "%'";
                dt    = _idataAccess.GetDataTable(sql);
                Plist = RepositoryHelper.ConvertDataTableToList <Products>(dt);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return(Plist);
    }