public async Task <IActionResult> Create([Bind("DeptId,DeptName")] Department department) { if (ModelState.IsValid) { _context.Add(department); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(department)); }
public async Task <IActionResult> Create([Bind("LoginId,EmployeeId,Username,Password")] Login login) { if (ModelState.IsValid) { _context.Add(login); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(login)); }
public async Task <IActionResult> Create([Bind("ShiftId,ShiftName,StartTime,FinishTime,ShftCreatedDate")] Shift shift) { if (ModelState.IsValid) { _context.Add(shift); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(shift)); }
public async Task <IActionResult> Create([Bind("AvailabilityId,EmployeeId,AvailableDate,AvailableFromTime,AvailableToTime")] Availability availability) { if (ModelState.IsValid) { _context.Add(availability); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(availability)); }
public async Task <IActionResult> Create([Bind("RequestId,LoginId,NewPassword,RequestDate,Status")] PasswordRequest passwordRequest) { if (ModelState.IsValid) { _context.Add(passwordRequest); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["LoginId"] = new SelectList(_context.Login, "LoginId", "LoginId", passwordRequest.LoginId); return(View(passwordRequest)); }
public async Task <IActionResult> Create([Bind("LoginTrailId,LogInId,LogInTime,LogOutTime")] LoginTrail loginTrail) { if (ModelState.IsValid) { _context.Add(loginTrail); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["LogInId"] = new SelectList(_context.Login, "LoginId", "LoginId", loginTrail.LogInId); return(View(loginTrail)); }
public async Task <IActionResult> Create([Bind("InvitationId,EmployeeId,ShiftId,InvitationStatus,InvitationDate,NotificationStatus")] ShiftInvitation shiftInvitation) { if (ModelState.IsValid) { _context.Add(shiftInvitation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "EmployeeId", shiftInvitation.EmployeeId); ViewData["ShiftId"] = new SelectList(_context.Shift, "ShiftId", "ShiftId", shiftInvitation.ShiftId); return(View(shiftInvitation)); }
public async Task <IActionResult> Create([Bind("BookingId,ShiftId,EmployeeId,BookedTime")] BookedShifts bookedShifts) { if (ModelState.IsValid) { _context.Add(bookedShifts); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "EmployeeId", bookedShifts.EmployeeId); ViewData["ShiftId"] = new SelectList(_context.Shift, "ShiftId", "ShiftId", bookedShifts.ShiftId); return(View(bookedShifts)); }
public async Task <IActionResult> Create([Bind("AttendanceId,EmployeeId,TimeIn,TimeOut,AttendanceDate,ShiftId,ApprovalStatus")] Timesheets timesheets) { if (ModelState.IsValid) { _context.Add(timesheets); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "EmployeeId", timesheets.EmployeeId); ViewData["ShiftId"] = new SelectList(_context.Shift, "ShiftId", "ShiftId", timesheets.ShiftId); return(View(timesheets)); }
public async Task <IActionResult> Create( [Bind("EmployeeId,FirstName,LastName,Gender,ProfilePicture,DOB,JoiningDate,Position,PhoneNumber," + "Email,Contract,ReportingManagerId,DepartmentId,HourlySalary")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employee)); }