Пример #1
0
        private IBattl GetBattlNotPlayedThisWeek()
        {
            IBattl     battl = new Battl();
            IDataQuery query = new DataQuery();

            DateTime date       = DateTime.Now;
            int      daysRange  = 6;
            int      dayWeek    = (int)date.DayOfWeek;
            DateTime lastMonday = date.AddDays(-daysRange);
            DateTime lastSunday = date;

            IRepositoryBLL <ISong> repo = new SongRepositoryBLL(new SongRepository(_dataBase));
            ISongBLL songBLL            = new SongBLL(repo);

            ISong fisrtSong  = songBLL.GetRandomSong(0);
            ISong secondSong = songBLL.GetRandomSong(fisrtSong.SongId);

            battl.FirstSongId  = fisrtSong.SongId;
            battl.SecondSongId = secondSong.SongId;

            return(battl);
        }
Пример #2
0
        public IBattl CreateTestBattl(DateTime date)
        {
            DateTime lastBattlTime = date;


            IRepositoryBLL <ISong> repo = new SongRepositoryBLL(new SongRepository(_dataBase));
            ISongBLL songBLL            = new SongBLL(repo);
            ISong    fisrtSong          = songBLL.GetRandomSong(0);
            ISong    secondSong         = songBLL.GetRandomSong(fisrtSong.SongId);

            IBattl battl = new Battl();

            battl.FirstSongId  = fisrtSong.SongId;
            battl.SecondSongId = secondSong.SongId;
            battl.BattlDate    = lastBattlTime.AddHours(1);
            battl.StartTime    = battl.BattlDate.AddMinutes(5);
            battl.EndTime      = battl.StartTime.AddMinutes(5);

            battl = _battlRepository.Add(battl);

            return(battl);
        }
Пример #3
0
        private IBattl GetBattlNotPlayedThisWeek()
        {
            IBattl battl = new Battl();
            IDataQuery query = new DataQuery();

            DateTime date = DateTime.Now;
            int daysRange = 6;
            int dayWeek = (int)date.DayOfWeek;
            DateTime lastMonday = date.AddDays(-daysRange);
            DateTime lastSunday = date;

            IRepositoryBLL<ISong> repo = new SongRepositoryBLL(new SongRepository(_dataBase));
            ISongBLL songBLL = new SongBLL(repo);

            ISong fisrtSong = songBLL.GetRandomSong(0);
            ISong secondSong = songBLL.GetRandomSong(fisrtSong.SongId);

            battl.FirstSongId = fisrtSong.SongId;
            battl.SecondSongId = secondSong.SongId;

            return battl;
        }
Пример #4
0
        public IBattl CreateTestBattl(DateTime date)
        {
            DateTime lastBattlTime = date;

            IRepositoryBLL<ISong> repo = new SongRepositoryBLL(new SongRepository(_dataBase));
            ISongBLL songBLL = new SongBLL(repo);
            ISong fisrtSong = songBLL.GetRandomSong(0);
            ISong secondSong = songBLL.GetRandomSong(fisrtSong.SongId);

            IBattl battl = new Battl();
            battl.FirstSongId = fisrtSong.SongId;
            battl.SecondSongId = secondSong.SongId;
            battl.BattlDate = lastBattlTime.AddHours(1);
            battl.StartTime = battl.BattlDate.AddMinutes(5);
            battl.EndTime = battl.StartTime.AddMinutes(5);

            battl = _battlRepository.Add(battl);

            return battl;
        }