private float PrintFollowUp(PrintPageEventArgs ev, Structs.FollowUpReturn followUp, float yPos)
        {
            // Print shooter name
            while (ev.Graphics.MeasureString(followUp.ShooterName, _printFont).Width > ShooterColumnWidth)
            {
                followUp.ShooterName = followUp.ShooterName.Substring(0, followUp.ShooterName.Length - 1);
            }
            ev.Graphics.DrawString(followUp.ShooterName, _printFont, Brushes.Black, _shooterColumnStart, yPos);

            // Print payment
            string payedToPrint = followUp.Payed.ToString();

            if (_useShouldHavePayed)
            {
                payedToPrint += " / " + followUp.ShouldHavePayed;
            }
            ev.Graphics.DrawString(payedToPrint, _printFont, Brushes.Black, _payedColumnStart, yPos);


            // Print nr of rounds
            ev.Graphics.DrawString(followUp.ResultsExistForRounds + " / " +
                                   followUp.Rounds,
                                   _printFont, Brushes.Black, _numberOfRoundsColumnStart, yPos);
            DrawFyrkant(ev, yPos, "Ankommit", _printFont, _arrivedColumnStart, _printFont);
            if (followUp.Arrived)
            {
                FillFyrkant(ev, yPos, "Ankommit", _printFont, _arrivedColumnStart, _printFont);
            }

            return(yPos + ev.Graphics.MeasureString(followUp.ShooterName, _printFont).Height);
        }
Exemple #2
0
        Structs.FollowUpReturn[] checkClub(DatabaseDataset.ClubsRow club)
        {
            string filter = "ClubId='" + club.ClubId + "'";
            //filter = "";
            ArrayList toReturn = new ArrayList();

            DatabaseDataset.ShootersRow[] shooters =
                (DatabaseDataset.ShootersRow[])
                //    club.GetShootersRows();
                database.Shooters.Select(filter, "GivenName, Surname");

            foreach (DatabaseDataset.ShootersRow shooter in shooters)
            {
                // This is for safety reasons
                if (shooter.IsArrivedNull())
                {
                    shooter.Arrived = false;
                }

                Structs.FollowUpReturn followUp = new Structs.FollowUpReturn();
                followUp.Arrived  = shooter.Arrived;
                followUp.CardNr   = shooter.Cardnr;
                followUp.ClubName = club.Name;
                followUp.Payed    = shooter.Payed;
                followUp.Rounds   = getRoundsForShooter(shooter);
                followUp.ResultsExistForRounds = getResultExistForShooter(shooter);
                followUp.ShooterName           = shooter.Givenname + ", " + shooter.Surname;
                followUp.ShouldHavePayed       = GetShouldHavePayed(shooter);
                toReturn.Add(followUp);
            }

            return((Structs.FollowUpReturn[])toReturn.ToArray(typeof(Structs.FollowUpReturn)));
        }