Beispiel #1
0
    /// <summary>
    /// Deletes timezone. Called when the "Delete timezone" button is pressed.
    /// Expects the CreateTimezone method to be run first.
    /// </summary>
    private bool DeleteTimezone()
    {
        // Get the timezone
        TimeZoneInfo deleteTimezone = TimeZoneInfoProvider.GetTimeZoneInfo("MyNewTimezone");

        // Delete the timezone
        TimeZoneInfoProvider.DeleteTimeZoneInfo(deleteTimezone);

        return(deleteTimezone != null);
    }
    /// <summary>
    /// Handles the UniGrid's OnAction event.
    /// </summary>
    /// <param name="actionName">Name of item (button) that throws event</param>
    /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param>
    protected void uniGrid_OnAction(string actionName, object actionArgument)
    {
        switch (actionName)
        {
        case "edit":
            URLHelper.Redirect("TimeZone_Edit.aspx?zoneid=" + Convert.ToString(actionArgument));
            break;

        case "delete":
            TimeZoneInfoProvider.DeleteTimeZoneInfo(Convert.ToInt32(actionArgument));
            break;
        }
    }