protected void uxDeleteButton_Click(object sender, EventArgs e)
    {
        bool deleted = false;

        foreach (GridViewRow row in uxGrid.Rows)
        {
            CheckBox deleteCheck = (CheckBox)row.FindControl("uxCheck");
            if (deleteCheck != null &&
                deleteCheck.Checked)
            {
                string cultureID = uxGrid.DataKeys[row.RowIndex]["CultureID"].ToString();
                string keyName   = uxGrid.DataKeys[row.RowIndex]["KeyName"].ToString();

                LanguageTextAccess.Delete(CurrentPageID, cultureID, keyName);
                deleted = true;
            }
        }
        uxGrid.EditIndex = -1;

        if (deleted)
        {
            uxMessage.DisplayMessage(Resources.LanguagePageMessages.KeywordDeleteSuccess);
        }

        RefreshGrid();
        AdminUtilities.ClearLanguageCache();
        uxStatusHidden.Value = "Deleted";
    }
Exemplo n.º 2
0
    protected void uxDeleteButton_Click(object sender, EventArgs e)
    {
        bool deleted = false;

        foreach (GridViewRow row in uxSearchGrid.Rows)
        {
            CheckBox deleteCheck = (CheckBox)row.FindControl("uxCheck");
            if (deleteCheck != null &&
                deleteCheck.Checked)
            {
                string pageID    = ((HiddenField)row.FindControl("uxPageIDHidden")).Value;
                string cultureID = ((HiddenField)row.FindControl("uxOldCultureIDHidden")).Value;
                string keyName   = ((HiddenField)row.FindControl("uxOldKeyNameHidden")).Value;

                LanguageTextAccess.Delete(pageID, cultureID, keyName);
                deleted = true;
            }
        }
        uxSearchGrid.EditIndex = -1;

        if (deleted)
        {
            uxMessage.DisplayMessage(Resources.LanguagePageMessages.KeywordDeleteSuccess);
        }

        RefreshGrid();
        AdminUtilities.ClearLanguageCache();
    }