public async Task <IActionResult> Edit(int id, [Bind("Id,ZHName,ENName,ZHPosition,ENPosition,ZHDescription,ENDescription,Photo,Email,LinkedIn,Twitter,Type,Order,Category,Status,CreateDate")] DFGTeam dFGTeam) { if (id != dFGTeam.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dFGTeam); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DFGTeamExists(dFGTeam.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dFGTeam)); }
public async Task <IActionResult> Create([Bind("Id,ZHName,ENName,ZHPosition,ENPosition,ZHDescription,ENDescription,Photo,Email,LinkedIn,Twitter,Type,Category,Order,Status,CreateDate")] DFGTeam dFGTeam) { if (ModelState.IsValid) { dFGTeam.CreateDate = DateTime.Now; dFGTeam.Category = _category; _context.Add(dFGTeam); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dFGTeam)); }