public async Task<ActionResult> Create(Lane lane)
        {
            if (ModelState.IsValid)
            {
                var user = db.Users.Find(User.Identity.GetUserId()).Club;
                lane.Club = user;
                lane.Deleted = false;
                db.Lanes.Add(lane);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(lane);
        }
Exemple #2
0
 public TeamLane GetLaneCount(List<Round> Rounds, Lane Lane)
 {
     //return new TeamLane() { Lane = Lane, Count = Rounds.Where(r => r.Lane == Lane && (r.Teams.Contains(Team1) || r.Teams.Contains(Team2))).Count(), Round = this };
     var count = Rounds.Where(r => r.Contains(Team1ID) || r.Contains(Team2ID)).Where(r => r.Lane == Lane).Count();
     return new TeamLane() { Lane = Lane, Count = count, Round = this };
 }
Exemple #3
0
 public JSONLane(Lane model)
 {
     this.ID = model.ID;
     this.Name = model.Name;
 }