private void loadTeamList() { frm_attendance.pn_TeamList.Controls.Clear(); frm_attendance.lb_DSThanhVien.Text = "Danh sách thành viên"; string sqlquery = "select (HoThanhVien + ' ' + TenThanhVien) as HoTen,IDNhom, TenNhom from Nhom,ThanhVien where NgungHD is null and Nhom.NhomTruong = ThanhVien.IDThanhVien"; DataTable dtlist = dal_Attendance.getData(sqlquery); for (int i = 0; i < dtlist.Rows.Count; i++) { teams = new GUI.uc_team(); teams.Dock = System.Windows.Forms.DockStyle.Top; teams.Location = new System.Drawing.Point(0, 0); teams.Name = "uc_team1" + i; teams.Size = new System.Drawing.Size(310, 63); teams.Cursor = System.Windows.Forms.Cursors.Hand; teams.Tag = dtlist.Rows[i]["IDNhom"].ToString(); teams.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; teams.lb_TenNhomTuong.Text = "Nhóm trưởng: " + dtlist.Rows[i]["HoTen"].ToString(); teams.lb_TenNhom.Text = dtlist.Rows[i]["TenNhom"].ToString(); teams.TabIndex = 0; teams.Click += new EventHandler(teamClick); frm_attendance.pn_TeamList.Controls.Add(teams); } }
private void loadTeamList() { frmtemlist.pn_TeamList.Controls.Clear(); string sqlquery = "select (HoThanhVien + ' ' + TenThanhVien) as HoTen,IDNhom, TenNhom from Nhom,ThanhVien where Nhom.NhomTruong = ThanhVien.IDThanhVien"; DataTable dtlist = dalteam.getDatabase(sqlquery); for (int i = 0; i < dtlist.Rows.Count; i++) { teams[i] = new GUI.uc_team(); teams[i].Dock = System.Windows.Forms.DockStyle.Top; teams[i].Location = new System.Drawing.Point(0, 0); teams[i].Name = "uc_team1"; teams[i].Size = new System.Drawing.Size(310, 63); teams[i].Cursor = System.Windows.Forms.Cursors.Hand; teams[i].Tag = dtlist.Rows[i]["IDNhom"].ToString(); teams[i].BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; teams[i].lb_TenNhomTuong.Text = "Nhóm trưởng: " + dtlist.Rows[i]["HoTen"].ToString(); teams[i].lb_TenNhom.Text = dtlist.Rows[i]["TenNhom"].ToString(); teams[i].TabIndex = 0; teams[i].Click += new EventHandler(teamClick); frmtemlist.pn_TeamList.Controls.Add(teams[i]); } frmtemlist.pn_InfoTeam.Hide(); frmtemlist.lb_TeamName.Hide(); }