Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("InvitationId,EmployeeId,ShiftId,InvitationStatus,InvitationDate,NotificationStatus")] ShiftInvitation shiftInvitation)
        {
            if (id != shiftInvitation.InvitationId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shiftInvitation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShiftInvitationExists(shiftInvitation.InvitationId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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> Edit(int id, [Bind("BookingId,ShiftId,EmployeeId,BookedTime")] BookedShifts bookedShifts)
        {
            if (id != bookedShifts.BookingId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bookedShifts);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BookedShiftsExists(bookedShifts.BookingId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(int id, [Bind("LoginId,EmployeeId,Username,Password")] Login login)
        {
            if (id != login.LoginId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(login);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LoginExists(login.LoginId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(login));
        }
        public async Task <IActionResult> Edit(int id, [Bind("EmployeeId,FirstName,LastName,Gender,ProfilePicture,DOB,JoiningDate,Position,PhoneNumber,Email,Contract,ReportingManagerId,DepartmentId,HourlySalary")] Employee employee)
        {
            if (id != employee.EmployeeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeeExists(employee.EmployeeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ShiftId,ShiftName,StartTime,FinishTime,ShftCreatedDate")] Shift shift)
        {
            if (id != shift.ShiftId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shift);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShiftExists(shift.ShiftId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shift));
        }
        public async Task <IActionResult> Edit(int id, [Bind("DeptId,DeptName")] Department department)
        {
            if (id != department.DeptId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(department);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DepartmentExists(department.DeptId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(department));
        }
        public async Task <IActionResult> Edit(int id, [Bind("RequestId,LoginId,NewPassword,RequestDate,Status")] PasswordRequest passwordRequest)
        {
            if (id != passwordRequest.RequestId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(passwordRequest);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PasswordRequestExists(passwordRequest.RequestId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LoginId"] = new SelectList(_context.Login, "LoginId", "LoginId", passwordRequest.LoginId);
            return(View(passwordRequest));
        }
Beispiel #8
0
        public async Task <IActionResult> Edit(int id, [Bind("LoginTrailId,LogInId,LogInTime,LogOutTime")] LoginTrail loginTrail)
        {
            if (id != loginTrail.LoginTrailId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(loginTrail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LoginTrailExists(loginTrail.LoginTrailId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LogInId"] = new SelectList(_context.Login, "LoginId", "LoginId", loginTrail.LogInId);
            return(View(loginTrail));
        }
        public async Task <IActionResult> Edit(int id, [Bind("AvailabilityId,EmployeeId,AvailableDate,AvailableFromTime,AvailableToTime")] Availability availability)
        {
            if (id != availability.AvailabilityId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(availability);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AvailabilityExists(availability.AvailabilityId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(availability));
        }
Beispiel #10
0
        public async Task <IActionResult> Edit(int id, [Bind("AttendanceId,EmployeeId,TimeIn,TimeOut,AttendanceDate,ShiftId,ApprovalStatus")] Timesheets timesheets)
        {
            if (id != timesheets.AttendanceId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(timesheets);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TimesheetsExists(timesheets.AttendanceId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }