public void LoadRelatedProduct()
 {
     if (hdnPKID.Value != "")
     {
         tblRelatedProduct objRelatedProduct = new tblRelatedProduct();
         objDataTable = objRelatedProduct.LoadRelatedProduct(hdnPKID.Value);
         if (objDataTable.Rows.Count <= 0)
         {
             divRelatedProduct.Style.Add("display", "none");
         }
         RepRelatedProduct.DataSource = objDataTable;
         RepRelatedProduct.DataBind();
         objRelatedProduct = null;
     }
 }
Пример #2
0
    private void SetValuesToControls()
    {
        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            tblProduct objproduct = new tblProduct();
            if (objproduct.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)))
            {
                lblProductCode.Text      = objproduct.AppProductCode;
                lblProductName.Text      = objproduct.AppProductName;
                lblProductTag.Text       = objproduct.AppProductTag;
                divDescription.InnerHtml = objproduct.AppDescription;
                if (objproduct.s_AppIsColor != "")
                {
                    if (objproduct.AppIsColor)
                    {
                        lblIsColor.Text = "Yes";
                    }
                }

                if (objproduct.s_AppIsSize != "")
                {
                    if (objproduct.AppIsSize)
                    {
                        lblIsSize.Text = "Yes";
                    }
                }


                divMetaKeyWord.InnerHtml     = objproduct.AppMetaKeyWord;
                divMetaDescription.InnerHtml = objproduct.AppMetaDescription;


                tblSubCategory objSubCategory = new tblSubCategory();
                objDataTable           = objSubCategory.GetAllCategoryProductWise(objproduct.s_AppProductID);
                dgvCategory.DataSource = null;
                dgvCategory.DataBind();
                if (objDataTable.Rows.Count > 0)
                {
                    divCategory.Style.Add("display", "block");
                    dgvCategory.DataSource = objDataTable;
                    dgvCategory.DataBind();
                }
                else
                {
                    divCategory.Style.Add("display", "none");
                }
                objSubCategory = null;

                tblProductColor objProductColor = new tblProductColor();
                objDataTable        = objProductColor.LoadGridData(objproduct.s_AppProductID, "0");
                dgvColor.DataSource = null;
                dgvColor.DataBind();
                if (objDataTable.Rows.Count > 0)
                {
                    divColor.Style.Add("display", "block");
                    dgvColor.DataSource = objDataTable;
                    dgvColor.DataBind();
                }
                else
                {
                    divColor.Style.Add("display", "none");
                }
                objProductColor = null;

                tblRelatedProduct objRelatedProduct = new tblRelatedProduct();
                objDataTable = objRelatedProduct.LoadRelatedProduct(objproduct.s_AppProductID);
                dgvRelatedProduct.DataSource = null;
                dgvRelatedProduct.DataBind();
                if (objDataTable.Rows.Count > 0)
                {
                    divRelatedProduct.Style.Add("display", "block");
                    dgvRelatedProduct.DataSource = objDataTable;
                    dgvRelatedProduct.DataBind();
                }
                else
                {
                    divRelatedProduct.Style.Add("display", "none");
                }
                objRelatedProduct = null;

                tblProductProperty objProductProperty = new tblProductProperty();

                objDataTable           = objProductProperty.LoadGridData(hdnPKID.Value);
                dgvProperty.DataSource = null;
                dgvProperty.DataBind();
                if (objDataTable.Rows.Count > 0)
                {
                    divProperty.Style.Add("display", "block");
                    dgvProperty.DataSource = objDataTable;
                    dgvProperty.DataBind();
                }
                else
                {
                    divProperty.Style.Add("display", "none");
                }
                objProductProperty = null;
            }
            objproduct = null;
        }
    }