Esempio n. 1
0
 /// <summary>
 /// 删除活动
 /// </summary>
 /// <param name="context"></param>
 /// <param name="id"></param>
 private void DeleteActivity(HttpContext context, long id)
 {
     context.Response.Write(new Tools.Serialize().SerializeJson(bll.DeleteActivity(id, LoginUserId, LoginUser.security_Level_id)));
 }
Esempio n. 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");
        }
    }