Exemple #1
0
        //private void BindMerchandisingGroupList()
        //{
        //    DropDownListMerchandisingGroupList.DataSource = SPARInsightManagement.Web.Code.InsightSupplierMerchandising.GetMerchandisingGroupList();
        //    DropDownListMerchandisingGroupList.DataTextField = "MerchandisingGroup";
        //    DropDownListMerchandisingGroupList.DataValueField = "GroupId";
        //    DropDownListMerchandisingGroupList.DataBind();

        //    if (DropDownListMerchandisingGroupList.Items.Count > 1)
        //    {
        //        DropDownListMerchandisingGroupList.Items.Insert(0, new ListItem("Please select", "0"));
        //    }
        //}

        private void BindGridViewResultList()
        {
            GridViewResultSupplierGroup.DataSource = null;
            GridViewResultSupplierGroup.DataBind();

            GridViewResultSupplier.DataSource = null;
            GridViewResultSupplier.DataBind();

            GridViewResultCustom.DataSource = null;
            GridViewResultCustom.DataBind();

            switch (this.supplierTypeId)
            {
            case 1:     //Supplier Group
                GridViewResultSupplierGroup.DataSource = InsightSupplierMerchandising.GetSupplierMerchandisingListBySupplierGroup(Convert.ToInt32(DropDownListSupplierParentList.SelectedValue), this.insightSupplierId);
                GridViewResultSupplierGroup.DataBind();
                ButtonSave.Visible = GridViewResultSupplierGroup.Rows.Count > 0;
                break;

            case 2:     //Supplier
                GridViewResultSupplier.DataSource = InsightSupplierMerchandising.GetSupplierMerchandisingListBySupplierId(Convert.ToInt32(DropDownListSupplierList.SelectedValue), this.insightSupplierId);
                GridViewResultSupplier.DataBind();
                ButtonSave.Visible = GridViewResultSupplier.Rows.Count > 0;

                BindDropDownListSupplierListDiscontinuedColour();
                break;

            case 3:     //Custom
                GridViewResultCustom.DataSource = InsightSupplierMerchandising.GetSupplierMerchandisingListByCustom(/*Convert.ToInt32(DropDownListMerchandisingGroupList.SelectedValue)*/ this.insightSupplierId);
                GridViewResultCustom.DataBind();
                ButtonSave.Visible = GridViewResultCustom.Rows.Count > 0;
                break;
            }
        }
        private void BindSupplierMerchandisingGridView()
        {
            InsightSupplierMerchandising ism = InsightSupplierMerchandising.GetInsightSupplierMerchandisingBySupplierId(Convert.ToInt32(ViewState["SupplierId"]), Convert.ToInt32(ViewState["InsightSupplierId"]));

            //if (ism.IsIncluded == 1)
            //{
            //    RadioButtonInclusion.Checked = true;
            //    RadioButtonExclusion.Checked = false;
            //}
            //else
            //{
            //    RadioButtonInclusion.Checked = false;
            //    RadioButtonExclusion.Checked = true;
            //}


            GridViewResultSupplier.DataSource = InsightSupplierMerchandising.GetSupplierMerchandisingListBySupplierId(Convert.ToInt32(ViewState["SupplierId"]), Convert.ToInt32(ViewState["InsightSupplierId"]));
            GridViewResultSupplier.DataBind();

            PanelSupplierMerchandising.Visible = GridViewResultSupplier.Rows.Count > 0;
        }