Esempio n. 1
0
 public Turnaments(Turnaments turnament)
 {
     this.Id = turnament.Id;
     this.Name = turnament.Name;
     this.Seats = turnament.Seats;
     this.StartTime = turnament.StartTime;
     this.IsSeatAndGo = turnament.IsSeatAndGo;
     this.RegistationOpen = turnament.RegistationOpen;
     this.EntryCost = turnament.EntryCost;
     this.Taxes = turnament.Taxes;
     this.TakenSeats = turnament.TakenSeats;
     this.SizeX = turnament.SizeX;
     this.SizeY = turnament.SizeY;
 }
Esempio n. 2
0
        public void GetTurnament(string typeIdStr, string userDeviceId)
        {
            int typeId = int.Parse(typeIdStr);
            SignalRChatDatabase.TurnamentsType type = (SignalRChatDatabase.TurnamentsType)typeId;
            var openTurnaments = context.Turnaments.Where(x => x.Type == type && x.RegistationOpen == true).ToList();
            Users user = context.Users.FirstOrDefault(x => x.DeviceId == userDeviceId);

            Clients.Client(user.UserWebClientId).clearCurrentTurnamentsTab(type.ToString());

            foreach (var turnament in openTurnaments)
            {
                var turnament1 = new Turnaments(turnament);
                turnament1.Playes = new List<SignalRChatDatabase.Users>();
                bool registered = false;
                if (turnament.Playes.FirstOrDefault(x => x.DeviceId == userDeviceId) != null)
                {
                    registered = true;
                }
                Clients.Client(user.UserWebClientId).showTurnament(turnament1, type.ToString(), registered);
            }
        }