public async Task <IActionResult> Edit(int id, [Bind("Id,Lastname,Firstname,Middlename,CurrentAddress,Phone,Email,BiometricId,BirthDate,PlaceOfBirth,Religion,Gender,Weight,Age,CivilStatus,Height,Skin,BloodType,PermanentAddress")] Employee employee)
        {
            if (id != employee.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeeExists(employee.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,OrgId,Title,Description")] JobRole jobRole)
        {
            if (id != jobRole.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(jobRole);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JobRoleExists(jobRole.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OrgId"] = new SelectList(_context.Organization, "Id", "Name", jobRole.OrgId);
            return(View(jobRole));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,LateGracePeriod,NoLatesOrUndertime,RoundOffLates,TardinessMultiplier,UseTardinessBrackets,MaximumBreakTime,RequireLunchBreakAfter,EmployeeHasNoAbsent,RequiredWorkingHours,HalfDayIfTardinessReached,AbsentIfTardinessReached,AllowOffsettingOfOt,OvertimeMultiplier,AdditionalMinutesBeforeOt,AllowedTimeInEarlyOffset,StartOfScheduleOffset,EmployeeId")] AttendanceConfiguration attendanceConfiguration)
        {
            if (id != attendanceConfiguration.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(attendanceConfiguration);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AttendanceConfigurationExists(attendanceConfiguration.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"] = new SelectList(_context.Employee, "Id", "Id", attendanceConfiguration.EmployeeId);
            return(View(attendanceConfiguration));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,EmployeeId,LeaveTypeId,IsPaid,IsApproved,DateFiled,Start,End,Hours,Remarks,Attachment,ApprovedBy")] UserLeaves userLeaves)
        {
            if (id != userLeaves.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(userLeaves);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserLeavesExists(userLeaves.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"]  = new SelectList(_context.Employee, "Id", "Lastname", userLeaves.EmployeeId);
            ViewData["LeaveTypeId"] = new SelectList(_context.LeaveTypes, "Id", "Title", userLeaves.LeaveTypeId);
            return(View(userLeaves));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Title,WorkDays,StartTime,EndTime,RestDay")] Shifts shifts)
        {
            if (id != shifts.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shifts);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShiftsExists(shifts.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shifts));
        }
Esempio n. 6
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Address,Phone,Email,OperatingHours")] Organization organization)
        {
            if (id != organization.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(organization);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrganizationExists(organization.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(organization));
        }
        public async Task <IActionResult> Edit(short id, [Bind("JobRoleId,Title,Description,TotalCredits,Id")] LeaveTypes leaveTypes)
        {
            if (id != leaveTypes.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(leaveTypes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LeaveTypesExists(leaveTypes.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["JobRoleId"] = new SelectList(_context.JobRole, "Id", "Title", leaveTypes.JobRoleId);
            return(View(leaveTypes));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Title")] EmploymentStatusTypes employmentStatusTypes)
        {
            if (id != employmentStatusTypes.Id)
            {
                return(NotFound());
            }

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

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(department);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DepartmentExists(department.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(department));
        }
Esempio n. 10
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,JobRoleId,DepartmentId,Title,Description,Level")] Position position)
        {
            if (id != position.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(position);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PositionExists(position.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DepartmentId"] = new SelectList(_context.Department, "Id", "Name", position.DepartmentId);
            ViewData["JobRoleId"]    = new SelectList(_context.JobRole, "Id", "Title", position.JobRoleId);
            return(View(position));
        }