public async Task <IActionResult> Create([Bind("BoulderAverageID,PullUps,PushUps,HangEdge,HangWeight,RowVersion")] BoulderAverage boulderAverage) { if (ModelState.IsValid) { _context.Add(boulderAverage); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(boulderAverage)); }
public async Task <IActionResult> Create([Bind("SportID,Name,Area,Location,SportClimbingGrade,ConsensusGrade,ModifyDate")] Sport sport) { sport.ModifyDate = DateTime.Now; if (ModelState.IsValid) { _context.Add(sport); await _context.SaveChangesAsync(); return(Redirect("/Logbook/create")); } return(View(sport)); }
public async Task <IActionResult> Create([Bind("BoulderID,Name,Area,Location,BoulderingClimbingGrade,ConsensusGrade,ModifyDate")] Boulder boulder) { boulder.ModifyDate = DateTime.Now; if (ModelState.IsValid) { _context.Add(boulder); await _context.SaveChangesAsync(); return(Redirect("/Logbook/create")); } return(View(boulder)); }
public async Task <IActionResult> Create([Bind("LogID,Type,ModifyDate,BoulderID,SportID,UserID")] Log log) { if (ModelState.IsValid) { _context.Add(log); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BoulderID"] = new SelectList(_context.Boulders, "BoulderID", "Name", log.BoulderID); ViewData["SportID"] = new SelectList(_context.Sports, "SportID", "Name", log.SportID); ViewData["UserID"] = new SelectList(_context.Users, "UserID", "UserID", log.UserID); return(View(log)); }