示例#1
0
        private void btnRemoveFromPatrol_Click(object sender, System.EventArgs e)
        {
            Trace.WriteLine("FPatrol: btnRemoveFromPatrol_Click started on thread \"" +
                            Thread.CurrentThread.Name + "\" ( " +
                            Thread.CurrentThread.ManagedThreadId.ToString() + " )");

            ArrayList competitorIds = new ArrayList();

            foreach (DatasetPatrol.shootersRow row in this.datasetPatrol.shooters)
            {
                if (row.Move)
                {
                    competitorIds.Add(row.competitorId);
                }
            }

            int[] competitorIdInts = (int[])competitorIds.ToArray(0.GetType());
            foreach (int thisCompId in competitorIdInts)
            {
                Structs.Competitor comp = CommonCode.GetCompetitor(thisCompId);
                comp.PatrolId = -1;
                comp.Lane     = -1;

                CommonCode.UpdateCompetitor(comp);
            }

            Trace.WriteLine("FPatrol: btnRemoveFromPatrol_Click ended.");
        }
        private void printTeamMembersResults(PrintPageEventArgs ev, ref float yPos, ResultsReturnTeam result)
        {
            Structs.Team team = CommonCode.GetTeam(result.TeamId);

            foreach (int compid in (int[])team.CompetitorIds.ToArray(typeof(int)))
            {
                Structs.Competitor comp = CommonCode.GetCompetitor(compid);
                printTeamMemberResults(ev, ref yPos, comp);
                yPos += printCompetitorFont.GetHeight();
            }
        }
示例#3
0
        private void printCompetitor(PrintPageEventArgs ev,
                                     Structs.Competitor competitor,
                                     PrintLabel label)
        {
            Trace.WriteLine("Competitor: " + competitor.CompetitorId);

            ResultsReturn result = CommonCode.ResultsGetCompetitor(competitor);

            float y = label.Y + label.MarginalTop;
            float x = label.X + label.MarginalLeft;

            string shooterClass = getShooterClassString(
                CommonCode.GetCompetitor(result.CompetitorId));

            ev.Graphics.DrawString(
                shooterClass,
                printFont, Brushes.Black,
                x, y, new StringFormat());

            float indent = ev.Graphics.MeasureString("RES", printFont).Width;

            x = x + indent;

            ev.Graphics.DrawString(
                result.ShooterName,
                printFont, Brushes.Black,
                x, y, new StringFormat());
            y += printFont.Height;

            Structs.Club club = CommonCode.GetClub(
                result.ClubId);

            ev.Graphics.DrawString(
                club.Name,
                printFont, Brushes.Black,
                x, y, new StringFormat());
            y += printFont.Height;

            string resultString = "";

            switch (CommonCode.CompetitionCurrent.Type)
            {
            case Structs.CompetitionTypeEnum.Field:
                resultString = getResultStringField(result);
                break;

            case Structs.CompetitionTypeEnum.MagnumField:
                resultString = getResultStringField(result);
                break;

            case Structs.CompetitionTypeEnum.Precision:
                resultString = result.HitsTotal.ToString() + " p";
                break;
            }

            ev.Graphics.DrawString(
                resultString,
                printFont, Brushes.Black,
                x, y, new StringFormat());

            y += printFont.Height;
        }