public async Task <IActionResult> Create([Bind("Id,Name")] TeamsModel teamsModel) { if (ModelState.IsValid) { _context.Add(teamsModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(teamsModel)); }
public async Task <IActionResult> Create([Bind("Id,DateSent,UserId,FromDate,UntilDate,LeaveId,HalfDay,AttachmentUrl,Approved")] RequestsModel requestsModel) { if (ModelState.IsValid) { _context.Add(requestsModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(requestsModel)); }
public async Task <IActionResult> Create([Bind("Id,Name,Description,TeamId")] ProjectsModel projectsModel) { if (ModelState.IsValid) { _context.Add(projectsModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(projectsModel)); }