public async Task <IActionResult> Create([Bind("Id,Name")] Team team) { if (ModelState.IsValid) { _context.Add(team); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(team)); }
public async Task <IActionResult> Create([Bind("Id,Date,DayOfWeek,Description,CreatedById")] Hollyday hollyday) { if (ModelState.IsValid) { _context.Add(hollyday); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CreatedById"] = new SelectList(_context.Employees, "Id", "Id", hollyday.CreatedById); return(View(hollyday)); }
public async Task <IActionResult> Create([Bind("Id,StartDate,EndDate,MonthId,YearId,TeamId")] BusinessDay businessDay) { if (ModelState.IsValid) { _context.Add(businessDay); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TeamId"] = new SelectList(_context.Teams, "Id", "Id", businessDay.TeamId); return(View(businessDay)); }
public async Task <IActionResult> Create([Bind("Role,Id,UserId,FirstName,LastName,WebPageAddress,Address,MobilePhoneNo,OfficePhoneNo,HomePhoneNo,FaxNo,TeamId,SeniorId")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SeniorId"] = new SelectList(_context.Employees, "Id", "Id", employee.SeniorId); ViewData["TeamId"] = new SelectList(_context.Teams, "Id", "Id", employee.TeamId); return(View(employee)); }
public async Task <IActionResult> Create([Bind("Id,TeamId,HollydayId")] HollydayTeam hollydayTeam) { if (ModelState.IsValid) { _context.Add(hollydayTeam); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["HollydayId"] = new SelectList(_context.HollyDays, "Id", "Id", hollydayTeam.HollydayId); ViewData["TeamId"] = new SelectList(_context.Teams, "Id", "Id", hollydayTeam.TeamId); return(View(hollydayTeam)); }
public async Task <IActionResult> Create([Bind("Id,TimeStamp,Status,PercentageOfWorkCompleted,AssignedToId,AssignedById,TaskId")] TaskSnapShot taskSnapShot) { if (ModelState.IsValid) { _context.Add(taskSnapShot); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AssignedById"] = new SelectList(_context.Employees, "Id", "Id", taskSnapShot.AssignedById); ViewData["AssignedToId"] = new SelectList(_context.Employees, "Id", "Id", taskSnapShot.AssignedToId); ViewData["TaskId"] = new SelectList(_context.Tasks, "Id", "Id", taskSnapShot.TaskId); return(View(taskSnapShot)); }
public async Task <IActionResult> Create( [Bind("Id,CreatedOn,Priority,BusinessDT,Title,Description,IsCommissioned,PrimaryOwnerId,SecondaryOwnerId,ReviewerId,TeamId")] Server.Models.Task task) { if (ModelState.IsValid) { _context.Add(task); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PrimaryOwnerId"] = new SelectList(_context.Employees, "Id", "Id", task.PrimaryOwnerId); ViewData["ReviewerId"] = new SelectList(_context.Employees, "Id", "Id", task.ReviewerId); ViewData["SecondaryOwnerId"] = new SelectList(_context.Employees, "Id", "Id", task.SecondaryOwnerId); ViewData["TeamId"] = new SelectList(_context.Teams, "Id", "Id", task.TeamId); return(View(task)); }