Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            // in order to simplify this example we are hard coding a user name
            var id = 1784;

            using (var unitOfWork = new UnitOfWork())
            {
                var model = unitOfWork.CollaborationSpaceRepository.GetCollaborationSpacesForArtist(id);

                if (list.Count > 0)
                {
                    ProjectsRepeater.DataSource = list;
                    ProjectsRepeater.DataBind();
                }
                else
                {
                    noWorkspaces.Visible = true;
                }
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (UserID == Guid.Empty)
            {
                UserID = SecurityContext.CurrentAccount.ID;
            }


            var filter = new TaskFilter {
                ParticipantId = UserID, MyProjects = true
            };
            var tasks    = Global.EngineFactory.GetTaskEngine().GetByFilter(filter);
            var projects = Global.EngineFactory.GetProjectEngine().GetByParticipant(UserID).Select(prj => new ProjectVm(prj)).OrderBy(r => r.ProjectTitle).ToList();

            foreach (var project in projects)
            {
                project.OpenedTasksCount = tasks.Count(t => t.Project.ID == project.ProjectId && t.Status == TaskStatus.Open);
                project.ClosedTasksCount = tasks.Count(t => t.Project.ID == project.ProjectId && t.Status == TaskStatus.Closed);
            }

            ProjectsRepeater.DataSource = projects;
            ProjectsRepeater.DataBind();

            //load user activity
            //
            var activities = UserActivityManager.GetUserActivities(
                TenantProvider.CurrentTenantID,
                UserID,
                ProductEntryPoint.ID,
                new[] { ProductEntryPoint.ID },
                UserActivityConstants.AllActionType,
                null,
                0, 10);

            LastActivityRepeater.DataSource = activities.ConvertAll(a => new ActivityVm(a));
            LastActivityRepeater.DataBind();
        }
Beispiel #3
0
    protected void ProjectsRepeater_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 == "EditProject")
        {
            Session["ProjectId"]  = projectId;
            Session["ParentPage"] = "~/Project/ProjectList.aspx";
            Response.Redirect("~/Project/ProjectForm.aspx");
            return;
        }

        if (e.CommandName == "ViewProject")
        {
            Session["ProjectId"] = projectId;
            Response.Redirect("~/Project/ProjectDetails.aspx");
            return;
        }

        if (e.CommandName == "DeleteProject")
        {
            try
            {
                ProjectBLL.DeleteProject(projectId);
            }
            catch (Exception ex)
            {
                SystemMessages.DisplaySystemErrorMessage(ex.Message);
                return;
            }

            SystemMessages.DisplaySystemMessage(Resources.Organization.MessageDeleteProjectOK);
            ProjectsRepeater.DataBind();
            return;
        }
        if (e.CommandName == "ViewActivities")
        {
            Session["SEARCH_PARAMETER"] = "@projectID " + projectId.ToString();
            Response.Redirect("~/Activity/ActivitiesList.aspx");
            return;
        }
        if (e.CommandName == "ViewKPIs")
        {
            Session["SEARCH_PARAMETER"] = "@projectID " + projectId.ToString();
            Response.Redirect("~/Kpi/KpiList.aspx");
            return;
        }
        if (e.CommandName == "ViewOrganization")
        {
            Session["SEARCH_PARAMETER"] = "@organizationID " + projectId.ToString();
            Response.Redirect("~/Organization/ListOrganizations.aspx");
            return;
        }
        if (e.CommandName == "ViewArea")
        {
            Session["OrganizationId"] = projectId.ToString();
            Response.Redirect("~/Organization/EditOrganization.aspx");
            return;
        }
        if (e.CommandName.Equals("ShareProject"))
        {
            Session["PROJECTID"] = projectId.ToString();
            Response.Redirect("~/Project/ShareProject.aspx");
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     ProjectsRepeater.DataSource = projectRepository.GetProjects;
     ProjectsRepeater.DataBind();
 }