Example #1
0
        public static string Details(int boardId)
        {
            Server Server = Server.Instance;
            var    query  = new Query.Boards();

            try
            {
                var board = query.GetDetails(boardId);
                return(Serializer.WriteObjectToString(
                           new Dictionary <string, Dictionary <string, string> >()
                {
                    {
                        "board", new Dictionary <string, string>()
                        {
                            { "name", board.name },
                            { "color", "#" + board.color },
                            { "teamId", board.teamId.ToString() }
                        }
                    }
                }
                           ));
            }
            catch (Exception)
            {
                throw new ServiceErrorException("Error displaying board details");
            }
        }
Example #2
0
        public string Create(int boardId, int listId, string name, string description = "", DateTime?dateDue = null, string colors = "")
        {
            if (!User.CheckSecurity(boardId))
            {
                return(AccessDenied());
            }
            Query.Models.Card card;
            try
            {
                card = Common.Platform.Cards.Create(boardId, listId, name, description, dateDue, colors);
            }catch (ServiceErrorException ex)
            {
                return(Error(ex.Message));
            }

            //load Card html
            try
            {
                var boards = new Query.Boards();
                var board  = boards.GetDetails(boardId);
                card.boardType = board.type;
                return(GetCard(boardId, card));
            }
            catch (ServiceErrorException ex)
            {
                return(Error(ex.Message));
            }
        }
Example #3
0
        public string Create(int boardId, string name, int sort = 0)
        {
            //check security
            if (!User.CheckSecurity(boardId))
            {
                return(AccessDenied());
            }

            var boards = new Query.Boards();
            var board  = boards.GetDetails(boardId);
            int id;

            try
            {
                id = Common.Platform.Lists.Create(boardId, name, sort);
            }catch (ServiceErrorException ex)
            {
                return(Error(ex.Message));
            }
            switch (board.type)
            {
            case 0:     //Kanban;
                return(Common.Platform.List.Kanban.RenderList(
                           new Query.Models.List()
                {
                    boardId = boardId, name = name, sort = sort, listId = id
                },
                           new List <Query.Models.Card>()
                           ));
            }
            return(Error());
        }