Exemplo n.º 1
0
        private static ProjectManagerService IProjectManagerService()
        {
            var projectManager = new ProjectManagerService();

            IoC.Resolve <IServiceBus>().Register <IProjectManagerService>(projectManager);
            return(projectManager);
        }
Exemplo n.º 2
0
        public static void Main()
        {
            var undoServiceFactory = new UndoServiceFactory();
            var undoService        = undoServiceFactory.Create();
            var clientStateService = new ClientIdLookup();
            var undoManagerCache   = new UndoManagerCache(undoService);

            var projectManagerService = new ProjectManagerService();


            var connectionFactory = new ConnectionFactory(undoService);
            var connectorFactory  = new ConnectorFactory(undoService, connectionFactory);

            connectionFactory.ConnectorFactory = connectorFactory; //Make sure to inject the connectorFactory.

            var blockSymbolFactory = new BlockSymbolFactory(undoService, connectorFactory);
            var sheetFactory       = new SheetFactory(undoService, connectionFactory, blockSymbolFactory, connectorFactory);

            connectionFactory.SheetFactory  = sheetFactory;
            blockSymbolFactory.SheetFactory = sheetFactory;
            connectorFactory.SheetFactory   = sheetFactory;

            var projectManager = new ProjectManagerFactory(projectManagerService, undoService, undoManagerCache,
                                                           connectorFactory, connectionFactory, blockSymbolFactory, sheetFactory);

            var server = new APlayServer(Int32.Parse(Properties.Settings.Default.ServerPort), projectManager,
                                         clientStateService);
        }
        public IHttpActionResult SearchProjects(string searchKeyWord, string sortBy)
        {
            return(tryCatchWebMethod(() =>
            {
                var project = new ProjectManagerService().SearchProjects(searchKeyWord, sortBy);

                return Json(project);
            }));
        }
        public IHttpActionResult Search(int projectID)
        {
            return(tryCatchWebMethod(() =>
            {
                var project = new ProjectManagerService().GetProject(projectID);

                return Json(project);
            }));
        }
        public IHttpActionResult Delete(int projectID)
        {
            return(tryCatchWebMethod(() =>
            {
                var isSuccess = new ProjectManagerService().DeleteProject(projectID);

                return Json(isSuccess);
            }));
        }
        public IHttpActionResult Get()
        {
            return(tryCatchWebMethod(() =>
            {
                var projects = new ProjectManagerService().GetProjects();

                return Json(projects);
            }));
        }
        public IHttpActionResult Search(int taskID)
        {
            return(tryCatchWebMethod(() =>
            {
                var task = new ProjectManagerService().GetTask(taskID);

                return Json(task);
            }));
        }
        public IHttpActionResult Search(int userID)
        {
            return(tryCatchWebMethod(() =>
            {
                var user = new ProjectManagerService().GetUser(userID);

                return Json(user);
            }));
        }
Exemplo n.º 9
0
 public RoomController(RoomService roomService, TeamService teamService, UserService getUserService, ProjectManagerService projectManagerService, ProjectService projectService, IMapper mapper)
 {
     this.roomService           = roomService;
     this.teamService           = teamService;
     UserService                = getUserService;
     this.projectManagerService = projectManagerService;
     this.projectService        = projectService;
     this.mapper                = mapper;
 }
        public IHttpActionResult Put([FromBody] ProjectModel projectModel)
        {
            return(tryCatchWebMethod(() =>
            {
                var isSuccess = new ProjectManagerService().UpdateProject(projectModel);

                return Json(isSuccess);
            }));
        }
        public IHttpActionResult Post([FromBody] UserModel userModel)
        {
            return(tryCatchWebMethod(() =>
            {
                var isSuccess = new ProjectManagerService().AddUser(userModel);

                return Json(isSuccess);
            }));
        }
 public UserController(UserService userService, TeamService teamService, TaskService taskService, NotificationService notificationService, IHubContext <NotificationHub> hub, TeamChatService teamChatService, IHubContext <ChatHub> chatHub, IHubContext <NotificationHub> notificationHub, SessionService sessionService, ProjectManagerService projectManagerService)
 {
     this.userService           = userService;
     this.teamService           = teamService;
     this.taskService           = taskService;
     this.notificationService   = notificationService;
     this.teamChatService       = teamChatService;
     this.chatHub               = chatHub;
     this.notificationHub       = notificationHub;
     this.sessionService        = sessionService;
     this.projectManagerService = projectManagerService;
 }
        public IHttpActionResult GetUsers()
        {
            return(tryCatchWebMethod(() =>
            {
                var users = new ProjectManagerService().GetUsers();
                var userList = new List <object>();
                foreach (var user in users)
                {
                    userList.Add(new { id = user.User_ID, text = user.FirstName + " " + user.LastName });
                }

                return Json(userList);
            }));
        }
        public IHttpActionResult GetParentTasks()
        {
            return(tryCatchWebMethod(() =>
            {
                var parentTasks = new ProjectManagerService().GetParentTasks();
                var parentTaskList = new List <object>();
                foreach (var parentTask in parentTasks)
                {
                    parentTaskList.Add(new { id = parentTask.Parent_ID, text = parentTask.ParentTaskName });
                }

                return Json(parentTaskList);
            }));
        }
        public IHttpActionResult GetProjects()
        {
            return(tryCatchWebMethod(() =>
            {
                var projects = new ProjectManagerService().GetProjects();

                var projectList = new List <object>();
                foreach (var project in projects)
                {
                    projectList.Add(new { id = project.Project_ID, text = project.ProjectName });
                }

                return Json(projectList);
            }));
        }
        public IHttpActionResult Post([FromBody] TaskModel taskModel)
        {
            return(tryCatchWebMethod(() =>
            {
                var isSuccess = false;
                if (taskModel.SetAsParent)
                {
                    var parentTaskModel = new ParentTaskModel()
                    {
                        ParentTaskName = taskModel.TaskName
                    };
                    isSuccess = new ProjectManagerService().AddParentTask(parentTaskModel);
                }
                else
                {
                    isSuccess = new ProjectManagerService().AddTask(taskModel);
                }

                return Json(isSuccess);
            }));
        }
Exemplo n.º 17
0
 public ProjectManagerServiceTests()
 {
     _projectManagerService = new ProjectManagerService();
 }