コード例 #1
0
        public ActionResult Index()
        {
            var model = new TopUserViewModel();

            model.GetTopUsers();
            return(View(model));
        }
コード例 #2
0
        public async Task AddUserInTop(TopUserViewModel user)
        {
            user.ConectionId = Context.ConnectionId;

            await userService.AddInTop(user);

            Clients.Caller.UserAdded();
        }
コード例 #3
0
        /// <summary>
        /// Добавиление победителя в ТОП
        /// </summary>
        /// <param name="conectionId">id сесии соединения</param>
        /// <param name="userName">Имя пользователя</param>
        /// <param name="movesCount">Количество ходов пользователя</param>
        /// <param name="gameTime">Игровое время</param>
        private TopUserViewModel GetWinUser(string conectionId, string userName, int movesCount, TimeSpan gameTime)
        {
            var userViewModel = new TopUserViewModel
            {
                UserName    = userName,
                Count       = movesCount,
                Time        = gameTime,
                ConectionId = conectionId
            };

            return(userViewModel);
        }
コード例 #4
0
        public async Task AddInTop(TopUserViewModel viewModel)
        {
            var user = new TopUser
            {
                ConectionId = viewModel.ConectionId,
                CountMoves  = viewModel.Count,
                Time        = viewModel.Time,
                UserName    = viewModel.UserName
            };

            db.TopUsers.Add(user);
            await db.SaveChangesAsync();
        }
コード例 #5
0
ファイル: TopUserPage.xaml.cs プロジェクト: meta012/MoodFull
 public TopUserPage()
 {
     InitializeComponent();
     BindingContext = new TopUserViewModel();
 }
コード例 #6
0
 public CellResponse(MoveStatuses status, Cell сell, TopUserViewModel results)
 {
     Cell        = сell;
     this.status = status;
     Results     = results;
 }