Beispiel #1
0
        public ActionResult Delete(string id)
        {
            var repo = new ProjectRepository();
            repo.Delete(new ObjectId(id));

            return JsonNet(new {success = true});
        }
 public void Init()
 {
     _taskRepository = new TaskRepository();
     _console = new RealConsole();
     _projectRepository = new ProjectRepository();
     _taskCommandFactory = new TaskCommandFactory(_console, _projectRepository, _taskRepository);
 }
 public static int AskForTheProject()
 {
     var projects = new ProjectRepository().GetAll();
     int newProjectId;
     string newProjectName;
     foreach (var project in projects)
     {
         if (project.id == 0)
         {
             newProjectId = 1;
             newProjectName = projectName + newProjectId.ToString();
             DateTime projectDeadLine = DateTime.Now;
             new ProjectRepository().Add(new Project(newProjectId, projectName, DateTime.Now.Add(TimeSpan.Parse(periodOfExecution))));
             return 1;
         }
     }
     try
     {
         newProjectId = projects.Last().id + 1;
     }
     catch
     {
         newProjectId = 1;
         newProjectName = projectName + newProjectId.ToString();
         DateTime projectDeadLine = DateTime.Now;
         new ProjectRepository().Add(new Project(newProjectId, projectName, DateTime.Now.Add(TimeSpan.Parse(periodOfExecution))));
         return 1;
     }
     new ProjectRepository().Add(new Project(newProjectId, projectName, DateTime.Now.Add(TimeSpan.Parse(periodOfExecution))));
     return newProjectId;
 }
Beispiel #4
0
 public void Init()
 {
     johnDoe = new Person { NickName = "JohnDoe", Password = "******" + DateTime.Now.Ticks.ToString(), PrimaryMail = "*****@*****.**", UserPhoto = null };
     repository = new ProjectRepository();
     stubProject = new Project { Name = "SuperDuper", Description = "Super-puper-giga-cool", License = "Beer license", SiteUrl = @"http://foo.site", Tags = "C Python HTML5 jQuery", TrackerUrl = @"http://tracker.foo.site" };
     johnDoe.Projects = new HashSet<Project>();
     johnDoe.Projects.Add(stubProject);
 }
        public DashboardViewModel()
        {
            _departmentRepository = new DepartmentRepository();
            _employeeRepository = new EmployeeRepository();
            _projectRepository = new ProjectRepository();

            RefreshAll();
        }
Beispiel #6
0
 public static void Main(string[] args)
 {
     var console = new RealConsole();
     var projectRepository = new ProjectRepository();
     var taskRepository = new TaskRepository();
     var taskList = new TaskList(console, projectRepository, taskRepository);
     taskList.Run();
 }
        public void LoadAll()
        {
            var repo = new ProjectRepository();
            var projects = repo.All().ToList();
            projects.Should().NotBeNull();


        }
        public void LoadSummary()
        {
            var repo = new ProjectRepository();
            var projects = repo.All().Where(p => p.Name.StartsWith("New")).Select(ProjectRepository.SelectSummary()).ToList();
            projects.Should().NotBeNull();


        }
        public void notify_that_project_was_not_found_when_trying_to_add_an_task_to_nonexistent_project()
        {
            var projectRepository = new ProjectRepository();
            projectRepository.Add(new Project("training"));

            _addTaskCommand.Execute();

            _console.Received().WriteLine("Could not find a project with the name \"{0}\".", "secrets");
        }
 public TaskCommandFactory(
     IConsole console, 
     ProjectRepository projectRepository, 
     TaskRepository taskRepository)
 {
     _console = console;
     _projectRepository = projectRepository;
     _taskRepository = taskRepository;
 }
        public void TestGetMethod()
        {
            //
            // Functional Test against Azure Emulator
            //

            var projectRepository = new ProjectRepository(CloudStorageAccount.DevelopmentStorageAccount,ProjectRepositoryTestConfig.StorageVersion);
            Project project = projectRepository.Get(ProjectRepositoryTestConfig.UserName, ProjectRepositoryTestConfig.ProjectId);
        }
        public NewProjectViewModel()
        {
            _repository = new ProjectRepository();
            Project = new Project();
            MainProperties = new ProjectMainPropertiesViewModel(Project);

            OkCommand = new Command(() => MainProperties.IsValid(), Save);
            CancelCommand = new Command(() => DialogResult = false);
        }
        public ProjectListViewModel()
        {
            _repository = new ProjectRepository();
            RefreshAll();

            AddProjectCommand = new Command(AddProject);
            EditProjectCommand = new Command<ProjectDto>(x => x != null, EditProject);
            DeleteProjectCommand = new Command<ProjectDto>(x => x != null, DeleteProject);
        }
        public void AddAProjectToRepository()
        {
            var projectRepository = new ProjectRepository();
            var project = new Project("secrets");
            var addProjectCommand = new AddProjectCommand(projectRepository, "secrets");

            addProjectCommand.Execute();

            Assert.That(projectRepository.AllProjects()[0], Is.EqualTo(project));
        }
        public void GetAllNamesReturnsCorrectNames()
        {
            // Arrange
            IProjectRepository repo = new ProjectRepository( Session );

            // Act
            string[] names = repo.GetAllNames().ToArray();

            // Assert
            CollectionAssert.AreEquivalent( TestData.Select( t => t.Name ).ToArray(), names );
        }
Beispiel #16
0
 public ProjectController(IUnitOfWork unitOfWork)
     : base(unitOfWork)
 {
     _projectRepository = new ProjectRepository(unitOfWork);
     _categoryRepostitory =new CategoryRepostitory(unitOfWork);
     _tasklogRepository = new TasklogRepository(unitOfWork);
     _documentRepository = new DocumentRepository(unitOfWork);
     _fileStore = new DiskFileStore();
     _feeRepository = new PaidFeeRepository(unitOfWork);
     _userRepository = new UserRepository(unitOfWork);
 }
        public static int AskForTheProject()
        {
            ProjectRepository projectRepository = new ProjectRepository();

            Project project = new Project();
            project.name = projectName;
            project.deadLine = DateTime.Now.Add(TimeSpan.Parse(periodOfExecution));

            projectRepository.Add(project);

            return projectRepository.GetAll().Last().id;
        }
        public SprintSelectorViewModel(Project project,
            Func<Project,Sprint,ProjectDetailsViewModel> projectDetailsFactory,
            ProjectRepository projectRepository,
            IShell shell)
        {
            _project = project;
            _projectDetailsFactory = projectDetailsFactory;
            _projectRepository = projectRepository;
            _shell = shell;

            _projectRepository.GetSprintsObservable(_project).ToProperty(this, t => t.AllSprints, out allSprints);
        }
        public NewEmployeeProjectViewModel(Employee employee)
        {
            _repository = new ProjectRepository();
            _employee = employee;

            Projects = _repository.GetProjectDtoList()
                .Where(x => !employee.Projects.Any(y => y.Id == x.Id))
                .ToList();

            OkCommand = new Command(IsValid, Save);
            CancelCommand = new Command(() => DialogResult = false);
        }
Beispiel #20
0
 public UnitOfWork()
 {
     _context = new ApplicationDbContext();
     Projects = new ProjectRepository(_context);
     Practices = new PracticeRepository(_context);
     Users = new UserRepository(_context);
     PracticeUsers = new PracticeUserRepository(_context);
     Features = new FeatureRepository(_context);
     FeatureUsers = new FeatureUserRepository(_context);
     Experiences = new ExperienceRepository(_context);
     Communications = new CommunicationRespository(_context);
     Countries = new CountryRepository(_context);
 }
        public ProjectSelectorViewModel(
            ProjectRepository projectRepository,
            Func<Project,SprintSelectorViewModel> sprintSelectorFactory,
            IShell shell
            
            )
        {
            _projectRepository = projectRepository;
            _sprintSelectorFactory = sprintSelectorFactory;
            _shell = shell;

            _projectRepository.GetAllObservable().
                ToProperty(this, t => t.AllProjects, out _allProjects);
        }
 public async Task<ActionResult> Create(string projectId)
 {
     if (!string.IsNullOrEmpty(projectId))
     {
         var projectRepo = new ProjectRepository();
         var project = await projectRepo.Get(projectId);
         if (project == null)
         {
             project = new Project();
         }
         return View(project);
     }
     return View(new Project());
 }
Beispiel #23
0
        public void ProjectToSummaryWithConfig()
        {
            var repo = new ProjectRepository();
            repo.Should().NotBeNull();

            var result = repo.All()
                .ToDataResult<Project, ProjectSummary>(config => config
                    .Page(1)
                    .PageSize(5)
                    .Selector(ProjectRepository.SelectSummary())
                );

            result.Should().NotBeNull();
            result.Data.Should().NotBeNull();
        }
        public ExistingProjectViewModel(Project project)
        {
            _repository = new ProjectRepository();
            Project = project;

            var mainProperties = new ProjectMainPropertiesViewModel(project);
            Tabs = new List<ViewModel>
            {
                mainProperties,
                new ProjectEmployeeListViewModel(project)
            };

            OkCommand = new Command(() => mainProperties.IsValid(), Save);
            CancelCommand = new Command(() => DialogResult = false);
        }
        public async Task<ActionResult> BuildAndroid(Project project)
        {
            var projectRepo = new ProjectRepository();
            var isNewProject = false;
            if (project.Id.ToString().Trim() == "000000000000000000000000")
            {
                isNewProject = true;
                project.DateCreated = Helper.SetDateForMongo(DateTime.Now);
                project.User = User.Identity.Name;
                await projectRepo.CreateSync(project);
            }

            var output = ProcessBuild(project, "android", User.Identity.Name);
            return Json(new { success = true, projectId = project.Id.ToString(), isNew = isNewProject }, JsonRequestBehavior.AllowGet);
        }
Beispiel #26
0
        public void ProjectToSummaryNoSelector()
        {
            var repo = new ProjectRepository();
            repo.Should().NotBeNull();

            QueryResult<ProjectSummary> result;

            Action act = () => result = repo.All()
                .ToDataResult<Project, ProjectSummary>(config => config
                    .Page(1)
                    .PageSize(5)
                );

            act.ShouldThrow<ArgumentNullException>();
        }
Beispiel #27
0
        public TaskRepositoryTests()
        {
            _configuration = new Configuration();
            _configuration.Configure();
            _configuration.AddAssembly(typeof(Project).Assembly);

            _sessionFactory = _configuration.BuildSessionFactory();

            _projectRepository = new ProjectRepository {SessionFactory = _sessionFactory};
            _taskRepository = new TaskRepository {SessionFactory = _sessionFactory};

            CurrentSessionContext.Bind(_sessionFactory.OpenSession());

            new SchemaExport(_configuration).Execute(false, true, false, false);

            CreateTestData();
        }
 static void ShowContracts()
 {
     var contracts = new ContractRepository().GetAll();
     ProjectRepository projectRepository = new ProjectRepository();
     Console.WriteLine("************************************");
     //Console.CursorLeft = 0;
     //Console.CursorTop = 0;
     foreach (var contract in contracts)
     {
         Console.WriteLine("Contract №{0}", contract.id);
         Console.WriteLine("  Client's name: {0}", new ClientRepository().GetItem(contract.clientId).name);
         Console.WriteLine("  Builder's name: {0}", new BuilderRepository().GetItem(contract.builderId).name);
         Console.WriteLine("  Agent's name: {0}", new AgentRepository().GetItem(contract.agentId).name);
         Console.WriteLine("  Project's name: {0}", projectRepository.GetItem(contract.projectId).name);
         Console.WriteLine("  Project's deadLine: {0}", projectRepository.GetItem(contract.projectId).deadLine);
     }
     Console.WriteLine(contracts.Count());
 }
        static void CheckContracts()
        {
            var projects = new ProjectRepository().GetAll();
            ContractRepository contractRepository = new ContractRepository();
            foreach (var project in projects)
            {
                if (project.id == 0)
                    return;

                if (project.deadLine < DateTime.Now)
                {
                    var contracts = contractRepository.GetAll().ToArray();
                    var variable = contracts.Where(contract => contract.project.id == project.id).First();
                    contractRepository.Delete(variable);
                    new ProjectRepository().Delete(project);
                }
            }
        }
        public void ProjectRepositoryTest()
        {
            ProjectRepository repository = new ProjectRepository();
            DateTime time = DateTime.MinValue;
            Project expectedProject = new Project(repository.GetAll().Count() + 1, "projectsomeproject", time);

            repository.Add(expectedProject);

            Project realProject = repository.GetItem(expectedProject.id);

            Assert.AreEqual(expectedProject, realProject);

            repository.Delete(expectedProject);

            realProject = repository.GetItem(expectedProject.id);

            Assert.AreEqual(null, realProject);
        }
Beispiel #31
0
 public void SaveProject(project project)
 {
     ProjectRepository.Save(project);
 }
        public async Task <ActionResult> Apis(int projectId)
        {
            var project = await ProjectRepository.GetProjectAsync(projectId);

            return(View(new ApisIndexViewModel(project, CurrentUserId)));
        }
Beispiel #33
0
        public async Task <ActionResult> Setup(int projectid)
        {
            var project = await ProjectRepository.GetProjectForFinanceSetup(projectid);

            return(View(new FinanceSetupViewModel(project, CurrentUserId)));
        }
Beispiel #34
0
 public ProjectController(ProjectRepository projectRepository)
 {
     ProjectRepository = projectRepository;
 }
Beispiel #35
0
 public RunBookService(ProjectDbContext dbContext)
 {
     Repository = new ProjectRepository <RunBook>(dbContext);
 }
 public ProjectController(ProjectRepository proj)
 {
     _projects = proj;
 }
        public ActionResult List()
        {
            var projects = ProjectRepository.GetAllProjects();

            return(View(projects));
        }
 public ProjectController()
 {
     _repository = new ProjectRepository();
 }
Beispiel #39
0
        public OctopusRepository(IOctopusClient client, RepositoryScope repositoryScope = null)
        {
#if FULL_FRAMEWORK
            LocationChecker.CheckAssemblyLocation();
#endif
            Client                     = client;
            Scope                      = repositoryScope ?? RepositoryScope.Unspecified();
            Accounts                   = new AccountRepository(this);
            ActionTemplates            = new ActionTemplateRepository(this);
            Artifacts                  = new ArtifactRepository(this);
            Backups                    = new BackupRepository(this);
            Beta                       = new OctopusSpaceBetaRepository(this);
            BuiltInPackageRepository   = new BuiltInPackageRepositoryRepository(this);
            BuildInformationRepository = new BuildInformationRepository(this);
            CertificateConfiguration   = new CertificateConfigurationRepository(this);
            Certificates               = new CertificateRepository(this);
            Channels                   = new ChannelRepository(this);
            CommunityActionTemplates   = new CommunityActionTemplateRepository(this);
            Configuration              = new ConfigurationRepository(this);
            DashboardConfigurations    = new DashboardConfigurationRepository(this);
            Dashboards                 = new DashboardRepository(this);
            Defects                    = new DefectsRepository(this);
            DeploymentProcesses        = new DeploymentProcessRepository(this);
            DeploymentSettings         = new DeploymentSettingsRepository(this);
            Deployments                = new DeploymentRepository(this);
            Environments               = new EnvironmentRepository(this);
            Events                     = new EventRepository(this);
            FeaturesConfiguration      = new FeaturesConfigurationRepository(this);
            Feeds                      = new FeedRepository(this);
            Interruptions              = new InterruptionRepository(this);
            LibraryVariableSets        = new LibraryVariableSetRepository(this);
            Lifecycles                 = new LifecyclesRepository(this);
            Licenses                   = new LicensesRepository(this);
            MachinePolicies            = new MachinePolicyRepository(this);
            MachineRoles               = new MachineRoleRepository(this);
            Machines                   = new MachineRepository(this);
            Migrations                 = new MigrationRepository(this);
            OctopusServerNodes         = new OctopusServerNodeRepository(this);
            PerformanceConfiguration   = new PerformanceConfigurationRepository(this);
            PackageMetadataRepository  = new PackageMetadataRepository(this);
            ProjectGroups              = new ProjectGroupRepository(this);
            Projects                   = new ProjectRepository(this);
            Runbooks                   = new RunbookRepository(this);
            RunbookProcesses           = new RunbookProcessRepository(this);
            RunbookSnapshots           = new RunbookSnapshotRepository(this);
            RunbookRuns                = new RunbookRunRepository(this);
            ProjectTriggers            = new ProjectTriggerRepository(this);
            Proxies                    = new ProxyRepository(this);
            Releases                   = new ReleaseRepository(this);
            RetentionPolicies          = new RetentionPolicyRepository(this);
            Schedulers                 = new SchedulerRepository(this);
            ServerStatus               = new ServerStatusRepository(this);
            Spaces                     = new SpaceRepository(this);
            Subscriptions              = new SubscriptionRepository(this);
            TagSets                    = new TagSetRepository(this);
            Tasks                      = new TaskRepository(this);
            Teams                      = new TeamsRepository(this);
            Tenants                    = new TenantRepository(this);
            TenantVariables            = new TenantVariablesRepository(this);
            UserRoles                  = new UserRolesRepository(this);
            Users                      = new UserRepository(this);
            VariableSets               = new VariableSetRepository(this);
            Workers                    = new WorkerRepository(this);
            WorkerPools                = new WorkerPoolRepository(this);
            ScopedUserRoles            = new ScopedUserRoleRepository(this);
            UserPermissions            = new UserPermissionsRepository(this);
            UserTeams                  = new UserTeamsRepository(this);
            UserInvites                = new UserInvitesRepository(this);
            UpgradeConfiguration       = new UpgradeConfigurationRepository(this);
            loadRootResource           = new Lazy <RootResource>(LoadRootDocumentInner, true);
            loadSpaceRootResource      = new Lazy <SpaceRootResource>(LoadSpaceRootDocumentInner, true);
        }
 public ProjectController(ProjectRepository projectRepository, EmployeeRepository employeeRepository)
 {
     _projectRepository  = projectRepository;
     _employeeRepository = employeeRepository;
 }
 public ActionResult Update(int id, string name, string outputdir, string outputfilename, string[] mylanguages)
 {
     ProjectRepository.Update(id, name, outputdir, outputfilename);
     LanguageRepository.UpdateProjectLanguages(id, mylanguages);
     return(Content(string.Format("updated: {0}", id)));
 }
 private void InitPorjects()
 {
     Projects = ProjectRepository.GetProjects();
 }
Beispiel #43
0
 public CreateProjectWork(ProjectRepository projectRepository, ProjectContract newData, int userId) : base(projectRepository.UnitOfWork)
 {
     m_projectRepository = projectRepository;
     m_newData           = newData;
     m_userId            = userId;
 }
Beispiel #44
0
        private async Task <int[]> GetChildrenGroupIds(int projectId, int characterGroupId)
        {
            var groups = await ProjectRepository.GetGroupAsync(projectId, characterGroupId);

            return(groups.GetChildrenGroups().Select(g => g.CharacterGroupId).Union(characterGroupId).ToArray());
        }
 public WeatherForecastController(ILogger <WeatherForecastController> logger, ProjectDbContext context)
 {
     _logger           = logger;
     projectRepository = new ProjectRepository(context);
 }
 public ProjectsController(ProjectsDatabaseContext context, FileService fileService)
 {
     projectRepository = new ProjectRepository(context);
     _fileService      = fileService;
 }
Beispiel #47
0
        static void Main()
        {
            var dbGenerator = new DbGenerator();

            var(typeLookup, entityUtils, connectionSettings, sqlExecutor) = dbGenerator.Generate();
            Console.WriteLine("Db Generated!");

            var organizationRepository = new OrganizationRepository(typeLookup, new PostgreSQLConstants <Organization>(entityUtils),
                                                                    entityUtils, new PostgreSQLExpressionUtils(), sqlExecutor, new List <string>());

            var projectRepository = new ProjectRepository(typeLookup, new PostgreSQLConstants <Project>(entityUtils),
                                                          entityUtils, new PostgreSQLExpressionUtils(), sqlExecutor, new List <string>());


            #region initial example
            var organization = new Organization
            {
                Name  = "test",
                Email = "*****@*****.**"
            };
            var orgId = organizationRepository.Insert(1, organization).Result;

            Console.WriteLine("Organization inserted, " + orgId);

            var project = new Project
            {
                Name        = "test",
                Description = "test description",
                Cost        = 1,
                IsActive    = false
            };
            var projectId = projectRepository.Insert(1, project).Result;

            Console.WriteLine("Project inserted, " + projectId);

            project.Name = "other test";
            projectRepository.Update(1, project).Wait();

            project.Name = "more other test";
            projectRepository.Update(1, project).Wait();

            var updatedProject = projectRepository.Select(x => x.Id == projectId).Result;

            Console.WriteLine("Project name updated to " + updatedProject.Name);

            Console.WriteLine("Project revisions;");
            var projectRevisions = projectRepository.SelectRevisions(projectId).Result;
            for (var i = 0; i < projectRevisions.Count; i++)
            {
                var projectRevision = projectRevisions[i];
                Console.WriteLine(projectRevision.Revision + " - " + projectRevision.Entity.Name);
            }

            try
            {
                var transactionalExecutor = new PostgreSQLTransactionalExecutor(new NpgsqlConnection(PostgreSQLConnectionFactory.GetConnectionString(connectionSettings)));
                var result = transactionalExecutor.ExecuteAsync <bool>(async cnn =>
                {
                    organizationRepository.SetSqlExecutorForTransaction(cnn);
                    projectRepository.SetSqlExecutorForTransaction(cnn);

                    var orgIdOther = organizationRepository.Insert(1, organization).Result;

                    project.OrganizationId   = orgIdOther;
                    project.OrganizationUid  = organization.Uid;
                    project.OrganizationName = organization.Name;

                    var projectIdOther = await projectRepository.Insert(1, project);

                    return(true);
                }).Result;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("project count " + projectRepository.Count().Result);
            Console.WriteLine("organization count " + organizationRepository.Count().Result);
            #endregion

            #region order by example

            for (var i = 0; i < 10; i++)
            {
                var organizationForOrderBy = new Organization
                {
                    Name        = "test " + i + 1,
                    Email       = "*****@*****.**" + (i - 10),
                    Description = "order by test"
                };
                organizationRepository.Insert(1, organizationForOrderBy).Wait();
            }

            var orderedItems = organizationRepository.SelectAll(x => x.Description == "order by test", false,
                                                                new List <OrderByInfo <Organization> > {
                new OrderByInfo <Organization>(y => y.Email, false)
            }).Result;

            Console.WriteLine("email desc ordered, first item > " + orderedItems.First().Email);

            orderedItems = organizationRepository.SelectAll(x => x.Description == "order by test", false,
                                                            new List <OrderByInfo <Organization> > {
                new OrderByInfo <Organization>(y => y.Name),
                new OrderByInfo <Organization>(y => y.Id, false),
            }).Result;

            Console.WriteLine("name asc ordered, first item > " + orderedItems.First().Name + " - " + orderedItems.First().Id);

            #endregion

            Console.Read();
        }
Beispiel #48
0
 public project GetProjectById(int id)
 {
     return(ProjectRepository.FindBy(p => p.project_id == id && p.status == 1).Include(p => p.project_content).Include(p => p.project_overview).Include(p => p.project_facility.Select(q => q.facility.facility_content)).FirstOrDefault());
 }
Beispiel #49
0
        public async Task <ActionResult> Setup(int projectId)
        {
            var project = await ProjectRepository.GetProjectAsync(projectId);

            return(View(new CheckInSetupModel(project)));
        }
Beispiel #50
0
 public List <project> SearchProjectList(string search)
 {
     return(ProjectRepository.FindBy(p => p.status == 1 && p.type != 2 && (Equals(search, null) || p.project_content.Any(q => q.name.Contains(search)))).Include(p => p.project_content).ToList());
 }
Beispiel #51
0
 public NfrCommandHandler(NfrRepository nfrRepository, IIssueFactory issueFactory, ProjectRepository projectRepository, ILabelsSearcher labelsSearcher, IMembershipService authorizationService, UserRepository userRepository, ISprintSearcher sprintSearcher, CallContext callContext)
 {
     this.nfrRepository        = nfrRepository;
     this.issueFactory         = issueFactory;
     this.projectRepository    = projectRepository;
     this.labelsSearcher       = labelsSearcher;
     this.authorizationService = authorizationService;
     this.userRepository       = userRepository;
     this.sprintSearcher       = sprintSearcher;
     this.callContext          = callContext;
 }
 public project GetProjectByName(string name)
 {
     return(ProjectRepository.FindBy(p => p.project_content.Any(q => q.name.ToLower() == name.ToLower()))
            .FirstOrDefault());
 }
Beispiel #53
0
 public ProjectCore(ProjectRepository ARepository)
 {
     Repository = ARepository;
 }
Beispiel #54
0
 public List <project> GetAllProject()
 {
     return(ProjectRepository.FindBy(p => p.status == 1 && p.type != 2).Include(p => p.project_content).ToList());
 }
 public ProjectService(IMapper mapper,
                       ProjectRepository projectRepository)
 {
     _mapper            = mapper;
     _projectRepository = projectRepository;
 }
Beispiel #56
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context   = context;
     Developers = new DeveloperRepository(_context);
     Projects   = new ProjectRepository(_context);
 }
 public ActionResult Delete(int id)
 {
     ProjectRepository.DeleteProject(id);
     return(Content(string.Format("deleted - {0}", id)));
 }
Beispiel #58
0
 public async Task <ActionResult> AddRoomType(int projectId)
 {
     return(View(new RoomTypeViewModel(
                     await ProjectRepository.GetProjectAsync(projectId), CurrentUserId)));
 }
Beispiel #59
0
 public ProjectService()
 {
     _mr = new ProjectRepository();
 }
Beispiel #60
0
 public DisplayProjectService()
 {
     context = new PortalEntities();
     db      = new ProjectRepository(context);
 }