Esempio n. 1
0
    private void BindList()
    {
        DListFilterMultiOrganizations.DataSource = DALC.GetOrganizations();
        DListFilterMultiOrganizations.DataBind();
        for (int i = 0; i < DListFilterMultiOrganizations.Items.Count; i++)
        {
            DListFilterMultiOrganizations.Items[i].Selected = true;
        }
        PnlOrganizations.Visible = DListFilterMultiOrganizations.Items.Count > 1;


        DListFilterReportsTypes.DataSource = DALC.GetList(Tools.Table.ReportsTypes);
        DListFilterReportsTypes.DataBind();
        DListFilterReportsTypes_SelectedIndexChanged(null, null);

        DListFilterMultiYears.DataSource =
            DListFilterYears.DataSource  = DALC.GetYearsByTableName();
        DListFilterMultiYears.DataBind();
        DListFilterYears.DataBind();

        if (DListFilterYears.Items.Count > 0)
        {
            DListFilterYears.SelectedIndex = DListFilterYears.Items.Count - 1;
            DListFilterYears_SelectedIndexChanged(null, null);
        }
    }
Esempio n. 2
0
    protected void DListFilterDownloadsTypes_SelectedIndexChanged(object sender, EventArgs e)
    {
        DListFilterYears.DataSource = DALC.GetDataTableBySqlCommand("GetYearsFromDownloads",
                                                                    new string[] { "OrganizationsID", "DownloadsTypesID" },
                                                                    new object[] { int.Parse(DListFilterOrganizations.SelectedValue), int.Parse(DListFilterDownloadsTypes.SelectedValue) },
                                                                    System.Data.CommandType.StoredProcedure);
        DListFilterYears.DataBind();

        if (DListFilterYears.Items.Count > 1)
        {
            DListFilterYears.Items.Insert(0, new ListItem("--", "-1"));
        }
        DListFilterYears_SelectedIndexChanged(null, null);
    }