Exemple #1
0
 private void SaveLeonPersons(int number)
 {
     for (int i = 0; i < number; i++)
     {
         var leonPerson = new LeonPerson
         {
             Class     = "4",
             ClubName  = "Bodø Østre",
             Name      = "No Name" + i,
             Range     = 2,
             ShooterId = 123456 + i,
             SumIn     = 30,
             Target    = i + 1,
             Team      = 3
         };
         DatabaseApi.Save(leonPerson);
     }
 }
Exemple #2
0
        public void Save_RowAdded()
        {
            this.InitTestDatabase("TestStevne", new DateTime(2016, 2, 26));
            var leonPerson = new LeonPerson
            {
                Class     = "4",
                ClubName  = "Bodø Østre",
                Name      = "No Name",
                Range     = 2,
                ShooterId = 123456,
                SumIn     = 30,
                Target    = 1,
                Team      = 3
            };
            var result = DatabaseApi.Save(leonPerson);

            Assert.IsTrue(result);
        }
Exemple #3
0
        public static List <OrionRegistration> GenerateOrionForShooter(LeonPerson person, OrionSetupViewModel orionViewModel)
        {
            var result = new List <OrionRegistration>();

            foreach (var orion in orionViewModel.OrionViewModels)
            {
                int currentTeam = person.Team;
                foreach (var range in orion.RangeViews)
                {
                    if (range.RangeType == RangeType.Pause)
                    {
                        currentTeam++;
                        continue;
                    }

                    var orionRegistration = new OrionRegistration
                    {
                        OrionId   = orion.OrionId,
                        Team      = currentTeam,
                        Target    = range.FirstTarget + person.Target - 1,
                        Name      = person.Name,
                        ClubName  = person.ClubName,
                        Class     = person.Class,
                        SumIn     = person.SumIn,
                        ShooterId = person.ShooterId,
                        RangeId   = range.RangeId,
                        RangeName = range.Name
                    };

                    result.Add(orionRegistration);
                    currentTeam++;
                }
            }

            return(result);
        }