예제 #1
0
        public InterfaceLayerBoard GetBoard(string boardId, string name)
        {
            try
            {
                List <InterfaceLayerColumn> columns = new List <InterfaceLayerColumn>();


                List <Board>       boards = Board.getListBoardById(name);
                InterfaceLayerUser author = new InterfaceLayerUser(name);
                foreach (Board board in boards)
                {
                    foreach (Column c in board.getColumns)
                    {
                        if (c.getBoardId() == boardId)
                        {
                            List <InterfaceLayerTask> tasks = new List <InterfaceLayerTask>();
                            foreach (Task t in c.getTasks)
                            {
                                tasks.Add(new InterfaceLayerTask(author, t.getTitle(), t.getColumnId(), t.getDueDate(), t.getDescription(), t.getTaskId(), t.getCreationTime()));
                            }
                            columns.Add(new InterfaceLayerColumn(c.getColumnId(), c.getMaxTasks(), tasks));
                        }
                    }
                }
                return(new InterfaceLayerBoard(name, columns));
            }
            catch (Exception)
            {
                return(null);
            }
        }
예제 #2
0
        public TaskContext(string user)
        {
            UserService service = new UserService();

            this.user     = service.GetUser(user);
            this.username = user;
        }
예제 #3
0
        public BoardWindowDataContext(string user)
        {
            UserService service = new UserService();

            this.user     = service.GetUser(user);
            this.username = user;
            ShowTheard(this.user);
        }
예제 #4
0
        public void SortByDueDate(string userName)
        {
            UserService        serv    = new UserService();
            InterfaceLayerUser user    = serv.GetUser(userName);
            ColumnService      colserv = new ColumnService();

            colserv.SortByDueDate(userName);
            ShowTheard(user);
        }
예제 #5
0
        public KanbanWindow(string user)
        {
            InitializeComponent();

            VM = new BoardWindowDataContext(user);
            this.DataContext = VM;
            UserService service = new UserService();

            this.user  = service.GetUser(user);
            this.email = user;
        }
예제 #6
0
        public NewTask(string user)
        {
            InitializeComponent();

            UserService service = new UserService();

            this.user        = service.GetUser(user);
            this.VM          = new TaskContext(user); //format the VM
            this.DataContext = this.VM;
            this.email       = user;
        }
예제 #7
0
        public TaskWindow(InterfaceLayerTask task, string user)
        {
            InitializeComponent();

            this.task = task;
            UserService service = new UserService();

            this.user        = service.GetUser(user);
            this.VM          = new TaskContext(task, user); //format the VM
            this.email       = user;
            this.DataContext = this.VM;
        }
예제 #8
0
        public TaskContext(InterfaceLayerTask task, string user)
        {
            this.Title        = task.Title;
            this.Column       = task.CurrCol;
            this.DueDate      = task.DueDate;
            this.CreationTime = task.CreationTime;
            this.Description  = task.Description;
            UserService service = new UserService();

            this.user     = service.GetUser(user);
            this.username = user;
        }
예제 #9
0
        public void RemoveColumn(string x)
        {
            UserService ser = new UserService();
            bool        b   = ser.RemoveColumn(username, x);

            if (b)
            {
                this.user = ser.GetUser(username);
                ShowTheard(user);
            }
            else
            {
                MessageBox.Show("something went wrong");
            }
        }
예제 #10
0
    public InterfaceLayerUser Login()
    {
        UserService auth = new UserService();
        bool        b    = auth.login(email, pwd);

        if (b)
        {
            InterfaceLayerUser user = auth.GetUser(email);
            return(user);
        }
        else
        {
            return(null);
        }
    }
예제 #11
0
        public void ShowTheard(InterfaceLayerUser user)
        {
            BindableCollection <BoardWindowTask> tasks = new BindableCollection <BoardWindowTask>();
            InterfaceLayerBoard board = user.Board;

            foreach (InterfaceLayerColumn col in user.Board.boardColumns.Values)
            {
                foreach (InterfaceLayerTask t in col.tasks)
                {
                    if (t != null)
                    {
                        tasks.Add(new BoardWindowTask(t));
                    }
                }
            }
            Tasks = tasks;
        }
예제 #12
0
        public bool CreateColumn()
        {
            Validation  val     = new Validation();
            UserService service = new UserService();

            if (val.validateColumnInfo(Column, service.GetBoard(username)))
            {
                if (service.CreateColumn(username, Column, PrevColumn))
                {
                    this.user = service.GetUser(username);
                    ShowTheard(user);
                    return(true);
                }

                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }