Example #1
0
    protected void GetProductsByOrgId()
    {
        try
        {
            chkSelectedProducts.DataSource = Product.GetProductNames();
            chkSelectedProducts.DataBind();

            DataSet ds = OrganizationInfo.GetProductCategoryByOrgId(UserOrganizationId);

            if (chkSelectedProducts.Items.Count > 0 && ds != null && ds.Tables[0].Rows.Count > 0)
            {
                foreach (ListItem chkbox in chkSelectedProducts.Items)
                {
                    for (int index = 0; index < ds.Tables[0].Rows.Count; index++)
                    {
                        if (chkbox.Text.ToString().Trim().ToLower() == ds.Tables[0].Rows[index][1].ToString().Trim().ToLower())
                        {
                            chkbox.Selected = true;
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            new SqlLog().InsertSqlLog(0, "ProductSelection GetProductsByOrgId", ex);
        }
    }