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

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

        if (e.CommandName == "Restore")
        {
            try
            {
                TrashBLL.RestoreTrash(ActivityHF.Value, activityId);
            }
            catch (Exception ex)
            {
                SystemMessages.DisplaySystemErrorMessage(ex.Message);
                return;
            }
            ActivityRepeater.DataBind();
        }
        if (e.CommandName == "DeleteActivity")
        {
            try
            {
                ActivityBLL.DeletePermanently(activityId);
            }
            catch (Exception ex)
            {
                SystemMessages.DisplaySystemErrorMessage(ex.Message);
                return;
            }
            ActivityRepeater.DataBind();
        }
    }
Exemple #2
0
    protected void ActivityRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        int activityId = 0;

        try
        {
            activityId = Convert.ToInt32(e.CommandArgument);
        }
        catch (Exception ex)
        {
            log.Error("Error getting object id", ex);
        }
        if (activityId <= 0)
        {
            SystemMessages.DisplaySystemErrorMessage(Resources.Organization.MessageNoComplete);
            return;
        }
        if (e.CommandName == "EditActivity")
        {
            Session["ActivityId"] = activityId;
            Session["ParentPage"] = "~/Activity/ActivitiesList.aspx";
            Response.Redirect("~/Activity/AddActivity.aspx");
            return;
        }
        if (e.CommandName == "ViewActivity")
        {
            Session["ActivityId"] = activityId;
            Session["ParentPage"] = "~/Activity/ActivitiesList.aspx";
            Response.Redirect("~/Activity/ActivityDetails.aspx");
            return;
        }
        if (e.CommandName == "DeleteActivity")
        {
            try
            {
                ActivityBLL.DeleteActivity(activityId);
            }
            catch (Exception ex)
            {
                SystemMessages.DisplaySystemErrorMessage(ex.Message);
                return;
            }
            SystemMessages.DisplaySystemMessage(Resources.Activity.MessageDeleted);
            ActivityRepeater.DataBind();
        }
        if (e.CommandName == "ViewKPIs")
        {
            Session["SEARCH_PARAMETER"] = "@activityID " + activityId.ToString();
            Response.Redirect("~/Kpi/KpiList.aspx");
        }
        if (e.CommandName == "ViewOrganization")
        {
            Session["SEARCH_PARAMETER"] = "@organizationID " + activityId.ToString();
            Response.Redirect("~/Organization/ListOrganizations.aspx");
        }
        if (e.CommandName == "ViewProject")
        {
            Session["SEARCH_PARAMETER"] = "@projectID " + activityId.ToString();
            Response.Redirect("~/Project/ProjectList.aspx");
        }
        if (e.CommandName == "ViewArea")
        {
            Session["OrganizationId"] = activityId.ToString();
            Response.Redirect("~/Organization/EditOrganization.aspx");
        }
        if (e.CommandName.Equals("ShareActivity"))
        {
            Session["ACTIVITYID"] = activityId.ToString();
            Response.Redirect("~/Activity/ShareActivity.aspx");
        }
    }