private void AddMember() { this.memberFlp.Controls.Clear(); listNameUser = userBLL.GetListNameUserWorkingFor(_cardId); foreach (String name in listNameUser) { MemIcon member = new MemIcon(name); this.memberFlp.Controls.Add(member); } }
//==================================================== //[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; } }
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); } }
private void CardEdit_Activated(object sender, EventArgs e) { cardInfoDTO = cardInfoBLL.CardInfo(_cardId); cardDTO = cardInfoDTO.Card; 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; } this.flowLayoutPanel2.Controls.Clear(); foreach (string name in listNameUser) { MemIcon member = new MemIcon(name); this.flowLayoutPanel2.Controls.Add(member); } }