/// <summary>
 /// Injection constructor
 /// </summary>
 /// <param name="_userlogicInstance">User Business layer instance</param>
 /// <param name="logInstance">logger instance</param>
 /// <param name="_projectLogicInstance">Project business layer</param>
 /// <param name="_taskLogicInstance">Task Logic instance</param>
 public UsersController(IUserLogic _userlogicInstance, ILogger <UsersController> logInstance, IProjectLogic _projectLogicInstance, ITaskLogic _taskLogicInstance)
 {
     _userOrchestrator = _userlogicInstance;
     projOrchestrator  = _projectLogicInstance;
     taskOrchestrator  = _taskLogicInstance;
     _logger           = logInstance;
 }
Example #2
0
        public Func <string> GetUserId; // Replaceable in testing

        public ProjectsController(IProjectLogic logic, IUserLogic userLogic, ISparkLogic sparkLogic)
        {
            _logic      = logic;
            _userLogic  = userLogic;
            _sparkLogic = sparkLogic;
            GetUserId   = () => this.User.FindFirstValue(ClaimTypes.NameIdentifier);
        }
Example #3
0
        public ProjectController(IProjectLogic projectService, IOptions <AppSettings> appSettings)
        {
            this._projectService = projectService;
            this._appSettings    = appSettings.Value;

            this._projectService.ConnectionString = this._appSettings.ConString;
        }
 public ProjectManagementLogic(IEfRepository repository, IProjectLogic profileLogic, ICategoryLogic categoryLogic, IUserLogic userLogic)
 {
     _repository    = repository;
     _projectLogic  = profileLogic;
     _categoryLogic = categoryLogic;
     _userLogic     = userLogic;
 }
Example #5
0
 public AdminLogic(IProjectLogic projectLogic, ICommentLogic commentLogic, ICategoryLogic categoryLogic, IEfRepository efRepository)
 {
     _projectLogic  = projectLogic;
     _commentLogic  = commentLogic;
     _categoryLogic = categoryLogic;
     _efRepository  = efRepository;
 }
 public NoteController(
     ITokenHelper tokenHelper,
     INoteLogic NoteLogic,
     IProjectLogic projectLogic)
 {
     _tokenHelper  = tokenHelper;
     _NoteLogic    = NoteLogic;
     _projectLogic = projectLogic;
 }
 public MaterialController(
     ITokenHelper tokenHelper,
     IMaterialLogic materialLogic,
     IProjectLogic projectLogic)
 {
     _tokenHelper = tokenHelper;
     _materialLogic = materialLogic;
     _projectLogic = projectLogic;
 }
Example #8
0
 public EquipmentController(
     ITokenHelper tokenHelper,
     IEquipmentLogic equipmentLogic,
     IProjectLogic projectLogic)
 {
     _tokenHelper    = tokenHelper;
     _equipmentLogic = equipmentLogic;
     _projectLogic   = projectLogic;
 }
 public DailyActivityController(
     ITokenHelper tokenHelper,
     IDailyActivityLogic dailyActivityLogic,
     IProjectLogic projectLogic)
 {
     _tokenHelper        = tokenHelper;
     _dailyActivityLogic = dailyActivityLogic;
     _projectLogic       = projectLogic;
 }
Example #10
0
 public void SetUp()
 {
     _projectRepository = new Mock <IProjectRepository>();
     _inviteRepository  = new Mock <IInviteRepository>();
     _unitOfWorkFactory = new Mock <IUnitOfWorkFactory>();
     _uniteOfWorkMock   = new Mock <IUnitOfWork>();
     _projectLogic      = new ProjectLogic(_projectRepository.Object, _unitOfWorkFactory.Object, _inviteRepository.Object);
     _unitOfWorkFactory.Setup(x => x.GetCurrentUnitOfWork()).Returns(_uniteOfWorkMock.Object);
 }
Example #11
0
 public BugController(ICookieHelper cookieHelper, IProjectLogic projectLogic, IBugLogic bugLogic, IBugStatusLogic bugStatusLogic, IUserProjectRoleRelationLogic userProjectRoleRelationLogic, IUserLogic userLogic, IBugCommentLogic bugCommentLogic)
 {
     _cookieHelper = cookieHelper;
     _projectLogic = projectLogic;
     _bugLogic = bugLogic;
     _bugStatusLogic = bugStatusLogic;
     _userProjectRoleRelationLogic = userProjectRoleRelationLogic;
     _userLogic = userLogic;
     _bugCommentLogic = bugCommentLogic;
 }
Example #12
0
 public CvLogic(IMapper mapper, IProjectLogic projectLogic, ITechnologyLogic technologyLogic, IAchievementLogic achievementLogic, IExtraInformationLogic extraInformationLogic, IEducationLogic educationLogic, IEmploymentHistoryLogic employmentHistoryLogic)
 {
     _mapper                 = mapper;
     _projectLogic           = projectLogic;
     _technologyLogic        = technologyLogic;
     _achievementLogic       = achievementLogic;
     _extraInformationLogic  = extraInformationLogic;
     _educationLogic         = educationLogic;
     _employmentHistoryLogic = employmentHistoryLogic;
 }
 public ProjectController(
     IProjectLogic projectLogic,
     ITokenHelper tokenHelper,
     IAccountLogic accountLogic,
     IProjectTeamLogic projectTeamLogic)
 {
     _projectLogic     = projectLogic;
     _tokenHelper      = tokenHelper;
     _accountLogic     = accountLogic;
     _projectTeamLogic = projectTeamLogic;
 }
 public ApplicationType(IStudentLogic studentLogic, IProjectLogic projectLogic)
 {
     Field(x => x.ProjectID);
     Field(x => x.StudentID);
     Field(x => x.Accepted);
     Field(x => x.StartDate, nullable: true);
     Field(x => x.EndDate, nullable: true);
     Field(x => x.ExperienceInPreviousProjects);
     Field(x => x.Reason);
     FieldAsync <StudentType>("student", resolve: async context => { return(await studentLogic.GetById(context.Source.StudentID)); });
     FieldAsync <ProjectType>("project", resolve: async context => { return(await projectLogic.GetById(context.Source.ProjectID)); });
 }
Example #15
0
 public ProjectController(
         IUserLogic userLogic,
         IProjectLogic projectLogic, 
         ICookieHelper cookieHelper,
         IUserProjectRoleRelationLogic userProjectRoleRelationLogic,
         IRoleLogic roleLogic
     )
 {
     _userLogic = userLogic;
     _projectLogic = projectLogic;
     _cookieHelper = cookieHelper;
     _userProjectRoleRelationLogic = userProjectRoleRelationLogic;
     _roleLogic = roleLogic;
 }
Example #16
0
 public ReportController(
     IDailyActivityLogic dailyActivityLogic,
     IMaterialLogic materialLogic,
     IEquipmentLogic equipmentLogic,
     IProjectLogic projectLogic,
     IAccountLogic accountLogic,
     INoteLogic noteLogic)
 {
     _dailyActivityLogic = dailyActivityLogic;
     _materialLogic      = materialLogic;
     _equipmentLogic     = equipmentLogic;
     _projectLogic       = projectLogic;
     _accountLogic       = accountLogic;
     _noteLogic          = noteLogic;
 }
 public ProjectPlanType2(IPhaseLogic phaseLogic, IStudentLogic studentLogic, IProjectLogic projectLogic, IProjectPlanLogic projectPlanLogic)
 {
     Field(x => x.ProjectID);
     //Field(x => x.DocumentID);
     //Field(x => x.Title);
     //Field(x => x.Note);
     //Field(x => x.EstimatedStartDate);
     //Field(x => x.Duration);
     //Field(x => x.DateOfCompilation);
     FieldAsync <ProjectPlanType>("projectPlan", resolve: async context => { return(await projectPlanLogic.GetByProject(context.Source.ProjectID)); });
     FieldAsync <ProjectType>("project", resolve: async context => { return(await projectLogic.GetById(context.Source.ProjectID)); });
     //Field<EmployeeType>("employee", resolve: context => { return employeeLogic.GetByID(context.Source.ComposedBy.EmployeeID); }); //IZMENI, nema objekat composed by
     FieldAsync <ListGraphType <PhaseType> >("phases", resolve: async context => { return(await phaseLogic.GetByProjectPlan(context.Source.DocumentID)); });
     FieldAsync <ListGraphType <StudentType> >("students", resolve: async context => { return(await studentLogic.GetAcceptedByProject(context.Source.ProjectID)); });
 }
 public ProjectController(IProjectLogic projectLogic, IDeveloperLogic developerLogic)
 {
     _projectLogic   = projectLogic;
     _developerLogic = developerLogic;
     AutoMapper.Mapper.CreateMap <Project, ProjectViewModel>();
     AutoMapper.Mapper.CreateMap <AddDeveloperViewModel, ProjectDeveloper>();
     AutoMapper.Mapper.CreateMap <ProjectViewModel, Project>();
     AutoMapper.Mapper.CreateMap <Developer, AddDeveloperViewModel>()
     .ForMember(dest => dest.FirstName, opts => opts.MapFrom(src => src.Account.FirstName))
     .ForMember(dest => dest.LastName, opts => opts.MapFrom(src => src.Account.LastName))
     .ForMember(dest => dest.DeveloperId, opts => opts.MapFrom(src => src.DeveloperId));
     AutoMapper.Mapper.CreateMap <Developer, DeveloperViewModel>()
     .ForMember(dest => dest.FirstName, opts => opts.MapFrom(src => src.Account.FirstName))
     .ForMember(dest => dest.LastName, opts => opts.MapFrom(src => src.Account.LastName))
     .ForMember(dest => dest.Email, opts => opts.MapFrom(src => src.Account.Email));
 }
Example #19
0
        public ActionResult Create(Project collection)
        {
            try
            {
                if (User.Identity.IsAuthenticated)
                {
                    IProjectLogic logic = container.Resolve <IProjectLogic>();
                    logic.HandleProjectAdd(collection, User.Identity.Name);

                    return(Json(new JsonDataHandler(httpCode: HttpCodeEnum.Created, message: "Project successfully created!").getInfo(), JsonRequestBehavior.AllowGet));
                }
                return(Json(new JsonDataHandler(httpCode: HttpCodeEnum.Forbidden).getWarning(), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new JsonDataHandler(ex).getError(), JsonRequestBehavior.AllowGet));
            }
        }
Example #20
0
        public ActionResult Edit(int id)
        {
            try
            {
                if (User.Identity.IsAuthenticated)
                {
                    IProjectLogic logic     = container.Resolve <IProjectLogic>();
                    var           viewmodel = new ProjectViewModel(logic.HandleProjectGet(id));

                    return(Json(viewmodel, JsonRequestBehavior.AllowGet));
                }
                return(Json(new JsonDataHandler(httpCode: HttpCodeEnum.Forbidden).getWarning(), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new JsonDataHandler(ex).getError(), JsonRequestBehavior.AllowGet));
            }
        }
Example #21
0
        public ActionResult Index()
        {
            try
            {
                if (User.Identity.IsAuthenticated)
                {
                    IProjectLogic logic     = container.Resolve <IProjectLogic>();
                    var           model     = logic.GetAllProjectsForCurrentUser(User.Identity.Name);
                    var           viewModel = new ProjectsViewModel(model.ToList());

                    return(Json(viewModel, JsonRequestBehavior.AllowGet));
                }
                return(Json(new JsonDataHandler(httpCode: HttpCodeEnum.Forbidden).getWarning(), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new JsonDataHandler(ex).getError(), JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult UsersByProject(int projectId)
        {
            try
            {
                if (User.Identity.IsAuthenticated)
                {
                    IProjectLogic        logic    = container.Resolve <IProjectLogic>();
                    IEnumerable <string> usersIds = logic.GetProjectUsers(projectId);
                    UsersViewModel       users    = getUsersQueryHelper(usersIds);

                    return(Json(users, JsonRequestBehavior.AllowGet));
                }
                return(Json(new JsonDataHandler(httpCode: HttpCodeEnum.Forbidden).getWarning(), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new JsonDataHandler(ex).getError(), JsonRequestBehavior.AllowGet));
            }
        }
Example #23
0
 public ProjectQuery(IProjectLogic projectLogic)
 {
     FieldAsync <ProjectType>(
         "projectById",
         arguments: new QueryArguments(new QueryArgument <LongGraphType>
     {
         Name = "projectID"
     }),
         resolve: async context => { return(await projectLogic.GetById(context.GetArgument <long>("projectID"))); }
         );
     FieldAsync <ListGraphType <ProjectType> >("projects", resolve: async context => { return(await projectLogic.GetAll()); });
     //FieldAsync<ListGraphType<ProjectType>>("projects", resolve: async context =>
     //{
     //    using (var dc = dataContext())
     //        return await dc
     //            .Projects
     //            .Include(x => x.ProjectProposal)
     //            .ToListAsync();
     //});
 }
Example #24
0
 public ProjectController(IProjectLogic projectLogic)
 {
     ProjectLogic = projectLogic;
 }
Example #25
0
 public ProjectsController(IProjectLogic projectOrhestrator, ILogger <ProjectsController> _logInstance)
 {
     _projectOrhestrator = projectOrhestrator;
     logger = _logInstance;
 }
Example #26
0
 public ApplicationLogic(FPISContext context, IStudentLogic studentLogic, IProjectLogic projectLogic) : base(context)
 {
 }
Example #27
0
 public FeedController(IFeedLogic feedLogic, IProjectLogic projectLogic)
 {
     FeedLogic = feedLogic;
     ProjectLogic = projectLogic;
 }
Example #28
0
 //private readonly IMapper _mapper;
 public ProjectController(IProjectLogic logic)
 {
     _logic = logic;
     //_mapper = mapper;
 }
 public ProjectController(IProjectLogic logic)
 {
     _logic = logic;
 }
Example #30
0
 public HomeController(IProjectLogic projectLogic)
 {
     _projectLogic = projectLogic;
 }
 public ProjectController(IProjectLogic projectLogic)
 {
     ProjectLogic = projectLogic;
 }
Example #32
0
 public BoardLogic(IProjectLogic projectLogic, IUserLogic userLogic, INotificationLogic notificationLogic)
 {
     _projectLogic      = projectLogic;
     _userLogic         = userLogic;
     _notificationLogic = notificationLogic;
 }
Example #33
0
        public ProjectsModule(IProjectLogic projectLogic) : base("projects")
        {
            Get["/"] = parameters =>
            {
                var result = projectLogic.GetProjects();
                return(CreateResponse(result));
            };

            Get["/{projectId}"] = parameters =>
            {
                var projectId = Guid.Parse(parameters.projectId);
                var result    = projectLogic.GetProjectDetail(projectId);
                return(CreateResponse(result));
            };

            Get["getMemberList/{projectId}"] = parameters =>
            {
                var projectId = Guid.Parse(parameters.projectId);
                var result    = projectLogic.GetAllEmployeeInProject(projectId);
                return(CreateResponse(result));
            };

            Get["getSessionPlanList/{projectId}"] = parameters =>
            {
                var projectId = Guid.Parse(parameters.projectId);
                var result    = projectLogic.GetAllSessionPlanList(projectId);
                return(CreateResponse(result));
            };

            Get["getRequestList/{sessionPlanId}"] = parameters =>
            {
                var sessionPlanId = Guid.Parse(parameters.sessionPlanId);
                var result        = projectLogic.GetAllRequestList(sessionPlanId);
                return(CreateResponse(result));
            };

            Get["/count"] = _ =>
            {
                return($"There are {projectLogic.CountProjects()} projects");
            };

            Get["/sessionPlan/{sessionPlanId}"] = _ =>
            {
                return(CreateResponse(projectLogic.FindSessionPlan(_.sessionPlanId)));
            };

            Get["/request/{requestId}"] = _ =>
            {
                return(CreateResponse(projectLogic.FindRequest(_.requestId)));
            };

            Get["/arrange"] = _ =>
            {
                return(CreateResponse(projectLogic.Arrange(Guid.Parse(Request.Query.PlanId)).Result != null ? "Yes" : "No"));
            };

            Post["/arrange"] = _ =>
            {
                var sessionPlan = this.Bind <SessionPlan>();

                return(CreateResponse(projectLogic.Arrange(sessionPlan)));
            };

            Post["/findEmployeesForRequest"] = _ =>
            {
                var request = this.Bind <Core.Model.Request>();

                return(CreateResponse(projectLogic.FindEmployeesForRequest(request)));
            };
        }
 public ProjectsController(IProjectLogic projectLogic)
 {
     _projectLogic = projectLogic;
 }