Пример #1
0
        public void SaveProject()
        {
            var creatorId = WebSecurity.CurrentUserId;

            ProjectManagementService.SaveProject(new Project
            {
                Title        = Title,
                CreatorId    = creatorId,
                CreationDate = DateTime.Today
            });
        }
Пример #2
0
        public void Save(int creatorId)
        {
            var project = new Project
            {
                Id           = ProjectId,
                Title        = Title,
                Details      = Details,
                CreatorId    = creatorId,
                DateOfChange = DateTime.Today
            };

            //if (project.Id == 0)
            //{
            //    if (new ProjectManagementService().GetProjects().Count(e => e.Title == project.Title) != 0)
            //    {
            //    }
            //}
            //else
            //{
            //    if (
            //        new ProjectManagementService().GetProjects()
            //            .Count(e => e.Title == project.Title && e.Id != project.Id) != 0)
            //    {
            //    }
            //    else
            //    {
            ProjectManagementService.SaveProject(project);

            if (ProjectId == 0)
            {
                ProjectManagementService.AssingRole(new ProjectUser
                {
                    UserId        = creatorId,
                    ProjectId     = project.Id,
                    ProjectRoleId = 3
                });
            }

            //    }
            //}
        }
        public void Save(int creatorId)
        {
            var project = new Project
            {
                Id           = ProjectId,
                Title        = Title,
                Details      = Details,
                CreatorId    = creatorId,
                DateOfChange = DateTime.Today
            };

            ProjectManagementService.SaveProject(project);

            if (ProjectId == 0)
            {
                ProjectManagementService.AssingRole(new ProjectUser
                {
                    UserId        = creatorId,
                    ProjectId     = project.Id,
                    ProjectRoleId = 3
                });
            }
        }