Beispiel #1
0
    protected void KpiRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        int kpiId = 0;

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

        if (e.CommandName == "Restore")
        {
            try
            {
                TrashBLL.RestoreTrash(KpiHF.Value, kpiId);
            }
            catch (Exception ex)
            {
                SystemMessages.DisplaySystemErrorMessage(ex.Message);
                return;
            }
            KpiRepeater.DataBind();
        }
        if (e.CommandName == "DeleteKpi")
        {
            try
            {
                KPIBLL.DeletePermanentlyKPI(kpiId);
            }
            catch (Exception ex)
            {
                SystemMessages.DisplaySystemErrorMessage(ex.Message);
                return;
            }
            KpiRepeater.DataBind();
        }
    }