Exemplo n.º 1
0
    private void LoadSubCategories()
    {
        Product prod = new Product();
        prod.ProductId = int.Parse(Request.QueryString["ProductId"]);

        ProcessGetProductByProductId getProduct = new ProcessGetProductByProductId();
        getProduct.Product = prod;
        getProduct.Invoke();

        SubCategory subCategory = new SubCategory();
        subCategory.ProductCategoryId = getProduct.Product.ProductCategoryId;

        ProcessGetSubCategoryByProductCategoryId processGetSubCategory = new ProcessGetSubCategoryByProductCategoryId();
        processGetSubCategory.SubCategory = subCategory;

        try
        {
            processGetSubCategory.Invoke();
        }
        catch (Exception ex)
        {
            Response.Redirect("~/ErrorPage.aspx");
        }

        ddlSubCategory.DataTextField = "SubCategoryDisplayName";
        ddlSubCategory.DataValueField = "SubCategoryId";
        ddlSubCategory.DataSource = processGetSubCategory.ResultSet;
        ddlSubCategory.DataBind();
    }
Exemplo n.º 2
0
    private void LoadChangedSubCategories(int categoryId)
    {
        SubCategory subCategory = new SubCategory();
        subCategory.ProductCategoryId = categoryId;

        ProcessGetSubCategoryByProductCategoryId processGetSubCategory = new ProcessGetSubCategoryByProductCategoryId();
        processGetSubCategory.SubCategory = subCategory;

        try
        {
            processGetSubCategory.Invoke();
        }
        catch (Exception ex)
        {
            Response.Redirect("~/ErrorPage.aspx");
        }

        ddlSubCategory.DataTextField = "SubCategoryDisplayName";
        ddlSubCategory.DataValueField = "SubCategoryId";
        ddlSubCategory.DataSource = processGetSubCategory.ResultSet;
        ddlSubCategory.DataBind();
    }