コード例 #1
0
    private void loadProducts()
    {
        IProductBussinessService productBussinessService = null;
        DataTable productTable = null;

        try
        {
            if (Cache["Products"] == null)
            {
                productBussinessService = BizDelegateFactory.Current.ProductBussinessService;
                productTable            = productBussinessService.RetreiveAllProducts();
                SqlCacheDependency productCache = new SqlCacheDependency("SpencersDB", "Products");
                Cache.Insert("Products", productTable, productCache);
            }
        }
        catch (Exception ex)
        {
            CommonLabel.Text      = ex.Message;
            CommonLabel.ForeColor = Color.Red;
        }
        finally
        {
            productBussinessService = null;
        }
    }
コード例 #2
0
ファイル: Products.aspx.cs プロジェクト: shyam2293/spencers
    public static string[] GetCompletionList(string prefixText, int count)
    {
        IProductBussinessService productBussinessService = null;

        try
        {
            productBussinessService = BizDelegateFactory.Current.ProductBussinessService;
            return(productBussinessService.RetreiveAllProduct(prefixText, count));
        }
        catch (Exception ex)
        {
            throw;
        }
        finally
        {
            productBussinessService = null;
        }
    }