private void ReloadTable()
        {
            var groupName = GroupName;
            var matchId   = MatchId;

            LockControl();

            var everyGroupNum = MatchGroupTableDAL.GetFinalColumnCountSelected(matchId, GroupName, SexName);

            if (string.IsNullOrWhiteSpace(everyGroupNum))
            {
                // 初始化每组人数
                this.cbEveryGroupNum.SelectedItem = "4";

                this.menDataView.DataSource = null;
                UnLockControl();
                return;
            }

            var columnCount = 0;

            columnCount = Convert.ToInt32(everyGroupNum);

            // 获取选择组别、项目下的所有运动员信息
            var allAthletes = Athletes.Select(x => new MatchGroupTableAthleteModel()
            {
                Name = x.Name, TeamName = x.TeamName, TeamShortName = x.TeamShortName
            }).ToList();
            // 设置分组,同单位的不同列,不同行,只参加个人赛的需要标注
            var rowCount = (int)Math.Ceiling(allAthletes.Count / (decimal)columnCount); // 需要的组数

            var table = MatchGroupTableDAL.GetFinalEveryGroupTable(matchId, groupName, SexName);

            DisplayInScreen(rowCount, columnCount, table);
        }
        private void lbPrintMatchGroup_Click(object sender, EventArgs e)
        {
            // 生成报表
            var fileName = $"{MatchName}-{GroupName}-{Project}-决赛竞赛分组表-{DateTime.Now.ToString("yyyyMMddHHmmss")}";
            var table    = MatchGroupTableDAL.GetFinalEveryGroupTable(MatchId, GroupName, SexName);

            ExcelHelperMatchGroup.GenerateOneSexMatchGroup(fileName, MatchId, MatchName, GroupName, SexName, table);
        }
        private void lbGenerateRecordCard_Click(object sender, EventArgs e)
        {
            var groupName = GroupName;
            var matchId   = MatchId;
            var matchName = MatchName;
            var allSex    = MatchGroupTableDAL.GetAllProjectsByGroup(matchId, groupName); // 男,女,男男,女女,男女
                                                                                          // 不同性别打印不同的记杆卡,同一性别打印在一个Excle中
            var table = MatchGroupTableDAL.GetFinalEveryGroupTable(matchId, groupName, SexName);

            var gName    = SwitchSexName(SexName);
            var fileName = $"{matchName}-{groupName}-{gName}-记杆卡-{DateTime.Now.ToString("yyyyMMddHHmmss")}";

            ExcelHelperMatchGroup.GenerateRecoredCard(fileName, matchId, matchName, groupName, SexName, table);
        }