Exemple #1
0
    protected void ProjectRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        int projectId = 0;

        try
        {
            projectId = Convert.ToInt32(e.CommandArgument);
        }
        catch (Exception ex)
        {
            log.Error("Error getting object id", ex);
        }
        if (projectId <= 0)
        {
            SystemMessages.DisplaySystemErrorMessage(Resources.Organization.MessageNoComplete);
            return;
        }

        if (e.CommandName == "Restore")
        {
            try
            {
                TrashBLL.RestoreTrash(ProjectHF.Value, projectId);
            }
            catch (Exception ex)
            {
                SystemMessages.DisplaySystemErrorMessage(ex.Message);
                return;
            }
            ProjectRepeater.DataBind();
        }
        if (e.CommandName == "DeleteProject")
        {
            try
            {
                ProjectBLL.DeletePermanently(projectId);
            }
            catch (Exception ex)
            {
                SystemMessages.DisplaySystemErrorMessage(ex.Message);
                return;
            }
            ProjectRepeater.DataBind();
        }
    }