Пример #1
0
        public void UpdateRanking([FromBody] Ranking rankingInfo)
        {
            var errors = new List <string>();
            IRankingRepository ranking = new RankingRepository();

            new RankingService(ranking).UpdateRanking(rankingInfo, ref errors);
        }
        public ActionResult _Win(int?cycle, int num)
        {
            RankingViewModel vr;

            vr = new RankingRepository().GetRankingOfWin(cycle, num, User.Identity.GetUserId(), User.IsInRole("Admin"));
            return(View(vr));
        }
Пример #3
0
        public void DeleteRanking(string studentId, int scheduleId)
        {
            var errors = new List <string>();
            IRankingRepository ranking = new RankingRepository();

            new RankingService(ranking).DeleteRanking(studentId, scheduleId, ref errors);
        }
Пример #4
0
        public Ranking GetRankingInfo(string studentId, int scheduleId)
        {
            var errors = new List <string>();
            IRankingRepository ranking = new RankingRepository();

            return(new RankingService(ranking).GetRankingInfo(studentId, scheduleId, ref errors));
        }
Пример #5
0
        public async Task GetAllRankings()
        {
            RankingRepository     repo;
            IEnumerable <Ranking> rankings;

            repo     = new RankingRepository();
            rankings = await repo.GetAllAsync();

            Assert.IsTrue(rankings.Count() > 0);
        }
Пример #6
0
        public string InsertRanking([FromBody] Ranking rankingInfo)
        {
            var errors = new List <string>();
            IRankingRepository ranking = new RankingRepository();

            new RankingService(ranking).InsertRanking(rankingInfo, ref errors);
            if (errors.Count == 0)
            {
                return("ok");
            }

            return("error");
        }
Пример #7
0
        /// <summary>
        /// Override of <see cref="LoadAllAsync"/> to use <see cref="RankingRepository"/> instead for including navigation properties
        /// </summary>
        /// <returns></returns>
        protected override async Task LoadAllAsync()
        {
            // Create factory, and get the instance
            RepositoryFactory <RankingRepository, Ranking> rankingFactory = RepositoryFactory <RankingRepository, Ranking> .GetInstance();

            // Create repository with the factory
            RankingRepository rankingRepository = rankingFactory.Create();
            // Get all reservations
            IEnumerable <Ranking> rankings = await rankingRepository.GetAllAsync();

            // Replace collection
            Items.ReplaceWith(rankings);
        }
        public ActionResult _Rank(int?cycle, int num)
        {
            RankingViewModel vr;

            vr = new RankingRepository().GetRankingOfWin(cycle, num, User.Identity.GetUserId(), User.IsInRole("Admin"));
            Ranking rk = vr.rankinglist.Where(p => p.isUser).FirstOrDefault();

            if (rk != null)
            {
                ViewBag.UserName = User.Identity.GetUserName();
                ViewBag.WinMoney = rk.Assets;
                ViewBag.ord      = rk.ord;
            }
            return(View(vr));
        }
 public void Initialize()
 {
     _repository = new RankingRepository(DatabaseFactory, QueryFactory);
     _transaction = new TransactionScope(TransactionScopeOption.RequiresNew);
 }
 public RankingsController()
 {
     _apiRankingRepo    = new SportsradarData();
     _rankingRepository = new RankingRepository();
 }
 public void Initialize()
 {
     _playerRepository  = new PlayerRepository();
     _rankingRepository = new RankingRepository();
     _transaction       = new TransactionScope(TransactionScopeOption.RequiresNew);
 }
Пример #12
0
 public RankingService()
 {
     this.UnitOfWorkRanking = new RankingRepository();
 }
 public void Initialize()
 {
     _playerRepository = new PlayerRepository();
     _rankingRepository = new RankingRepository();
     _transaction = new TransactionScope(TransactionScopeOption.RequiresNew);
 }