コード例 #1
0
    /// <summary>
    /// Resets all parameters. Used on first time page load or when user wants to clear everything
    /// </summary>
    private void resetParameters()
    {
        //Clear all Text Fields
        clearTextFields();
        //Local Time format
        txtParamDTEnd.Text = DateTime.Now.AddMinutes(-1).ToString("yyyy-MM-dd HH:mm:ss");

        //Rebuild the dictionaries
        clearDictionaries();
        buildDictionaries();

        //Clear the ListView and rebuild it.
        ListView_Alarms.DataSource = "";
        ListView_Alarms.DataBind();
        List <String> siteList = new List <string>();

        foreach (SiteStructure site in SiteFactory.getSiteList())
        {
            if (!siteList.Contains(site.siteName))
            {
                siteList.Add(site.siteName);
            }
        }

        //Add the filters
        foreach (KeyValuePair <string, string> filter in SiteFactory.getFilters())
        {
            siteList.Add(filter.Key);
        }

        siteList.Sort();

        //Rebind the siteList to the dropdown list
        SiteDropDownList.DataSource = siteList;
        //Set the txtParamLogList textfield to the first item in the siteList
        txtParamLogList.Text = siteList[0];
        SiteDropDownList.DataBind();
    }