Exemplo n.º 1
0
 public void AddListSpace(ListSpace lspace)
 {
     this.listSpace          = lspace;
     this.listSpace.TopLevel = false;
 }
Exemplo n.º 2
0
        public CardDetail(int id, ListSpace listSpace)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
            _cardId            = id;
            _listSpace         = listSpace;
            cardDTO            = cardBLL.GetCard(_cardId);

            switch (cardDTO.Label)
            {
            case 1:
                this.cardLabel.BackColor = Color.Red;
                break;

            case 2:
                this.cardLabel.BackColor = Color.Yellow;
                break;

            case 3:
                this.cardLabel.BackColor = Color.Green;
                break;

            case 4:
                this.cardLabel.BackColor = Color.Orange;
                break;

            case 5:
                this.cardLabel.BackColor = Color.Blue;
                break;

            case 6:
                this.cardLabel.BackColor = Color.Fuchsia;
                break;

            default:
                this.cardLabel.BackColor = Color.Transparent;
                break;
            }
            this.CardName.Text        = cardDTO.Title;
            this.descriptionText.Text = cardDTO.Description;
            this.checkDueDate.Text    = cardDTO.DueDate.Date.ToString();

            AddMember();


            this.descriptionText.LostFocus += DescriptionText_LostFocus;
            this.commentText.LostFocus     += CommentText_LostFocus;

            listDTO        = listBLL.GetList(cardDTO.ListId);
            this.List.Text = listDTO.Title;
            //_boardId = listDTO.BoardId;

            commentDTOs = commentBLL.GetAllComments(_cardId);
            foreach (CommentDTO comment in commentDTOs)
            {
                UserComment userComment = new UserComment(userBLL.GetUser(comment.UserId).Name.Substring(0, 1), comment.Content);
                cmtPanel.Controls.Add(userComment);
            }

            activityPanel.Controls.Clear();
        }
Exemplo n.º 3
0
        //====================================================

        //[DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
        //private static extern IntPtr CreateRoundRectRgn
        //(
        //    int nLeftRect, // x-coordinate of upper-left corner
        //    int nTopRect, // y-coordinate of upper-left corner
        //    int nRightRect, // x-coordinate of lower-right corner
        //    int nBottomRect, // y-coordinate of lower-right corner
        //    int nWidthEllipse, // height of ellipse
        //    int nHeightEllipse // width of ellipse
        //);

        //public static System.Drawing.Region GetRoundedRegion(int controlWidth, int controlHeight)
        //{
        //    return System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, controlWidth - 2, controlHeight - 2, 10, 10));
        //}

        public Card(int X, int cardId, int index, ListSpace listSpace)
        {
            InitializeComponent();
            _cardId    = cardId;
            oX         = X;
            oY         = 3 + (index + 3) * this.Height;
            _listSpace = listSpace;
            //this.Region = GetRoundedRegion(this.Width, this.Height);

            cardInfoBLL = new CardInfoBLL();
            cardInfoDTO = cardInfoBLL.CardInfo(_cardId);
            cardDTO     = cardInfoDTO.Card;

            listNameUser  = cardInfoDTO.ListNameUser;
            CardName.Text = cardDTO.Title;
            dateCard.Text = cardDTO.DueDate.ToShortDateString();

            if (cardInfoDTO.CountCmt != 0)
            {
                panel2.Visible = true;
                label3.Text    = cardInfoDTO.CountCmt.ToString();
            }
            else
            {
                panel2.Visible = false;
            }
            if (cardDTO.Description == null || cardDTO.Description == "")
            {
                this.desPicture.Visible = false;
            }
            else
            {
                this.desPicture.Visible = true;
            }

            foreach (string name in listNameUser)
            {
                MemIcon member = new MemIcon(name, 25, 25);
                this.flowLayoutPanel3.Controls.Add(member);
            }

            if (cardDTO.Description.Equals(""))
            {
                this.desPicture.Visible = false;
            }
            else
            {
                this.desPicture.Visible = true;
            }
            switch (cardDTO.Label)
            {
            case 1:
                this.CardLabel.BackColor = Color.Red;
                break;

            case 2:
                this.CardLabel.BackColor = Color.Yellow;
                break;

            case 3:
                this.CardLabel.BackColor = Color.Green;
                break;

            case 4:
                this.CardLabel.BackColor = Color.Orange;
                break;

            case 5:
                this.CardLabel.BackColor = Color.Blue;
                break;

            case 6:
                this.CardLabel.BackColor = Color.Fuchsia;
                break;

            default:
                this.CardLabel.BackColor = Color.Transparent;
                break;
            }
            if (cardInfoDTO.CountChecklist != 0)
            {
                checkBox1.Visible = true;
                checkBox1.Text    = cardInfoDTO.CountCheckedlist + "/" + cardInfoDTO.CountChecklist;
            }
            else
            {
                checkBox1.Visible = false;
            }
        }
Exemplo n.º 4
0
        public CardEdit(int X, int Y, int cardId, ListSpace listSpace)
        {
            InitializeComponent();
            _cardId            = cardId;
            _listSpace         = listSpace;
            cardDTO            = cardBLL.GetCard(_cardId);
            cardInfoBLL        = new CardInfoBLL();
            commentBLL         = new CommentBLL();
            cardInfoDTO        = cardInfoBLL.CardInfo(_cardId);
            listNameUser       = cardInfoDTO.ListNameUser;
            this.Location      = new Point(X, Y);
            this.StartPosition = FormStartPosition.CenterScreen;

            switch (cardDTO.Label)
            {
            case 1:
                this.CardLabel.BackColor = Color.Red;
                break;

            case 2:
                this.CardLabel.BackColor = Color.Yellow;
                break;

            case 3:
                this.CardLabel.BackColor = Color.Green;
                break;

            case 4:
                this.CardLabel.BackColor = Color.Orange;
                break;

            case 5:
                this.CardLabel.BackColor = Color.Blue;
                break;

            case 6:
                this.CardLabel.BackColor = Color.Fuchsia;
                break;

            default:
                this.CardLabel.BackColor = Color.Transparent;
                break;
            }
            this.cardName.Text = cardDTO.Title;
            this.dateTime.Text = cardDTO.DueDate.ToShortDateString();
            if (cardDTO.Description == null || cardDTO.Description == "")
            {
                this.desPic.Visible = false;
            }
            else
            {
                this.desPic.Visible = true;
            }
            if (commentBLL.GetAllComments(_cardId).Count() != 0)
            {
                panel2.Visible = true;
                cmtNum.Text    = commentBLL.GetAllComments(_cardId).Count().ToString();
            }
            else
            {
                panel2.Visible = false;
            }
            if (cardInfoDTO.CountChecklist != 0)
            {
                this.checkList.Visible = true;
                this.checkList.Text    = cardInfoDTO.CountCheckedlist + "/" + cardInfoDTO.CountChecklist;
            }
            else
            {
                this.checkList.Visible = false;
            }
            foreach (string name in listNameUser)
            {
                MemIcon member = new MemIcon(name, 25, 25);
                this.flowLayoutPanel2.Controls.Add(member);
            }
        }