コード例 #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Address,Phone,Email,OperatingHours")] Organization organization)
        {
            if (ModelState.IsValid)
            {
                _context.Add(organization);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(organization));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Id,Title,WorkDays,StartTime,EndTime,RestDay")] Shifts shifts)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shifts);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shifts));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("Id,Title")] EmploymentStatusTypes employmentStatusTypes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employmentStatusTypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employmentStatusTypes));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("Id,Name,Description")] Department department)
        {
            if (ModelState.IsValid)
            {
                _context.Add(department);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(department));
        }
コード例 #5
0
        public async Task <IActionResult> Create([Bind("Id,Lastname,Firstname,Middlename,CurrentAddress,Phone,Email,BiometricId,BirthDate,PlaceOfBirth,Religion,Gender,Weight,Age,CivilStatus,Height,Skin,BloodType,PermanentAddress", "EmployeeWorkBackground", "EmployeeReferences", "EmployeeEducationalBackground")] Employee employee, [Bind("Id,EmployeeId,Primary,PrimaryGradDate,Secodary,SecodaryGradDate,Vocational,VocationalGradDate,College,CollegeCourse,CollegeGradDate,GradSchool,GradSchoolCourse,GradSchoolGradDate")] EmployeeEducationalBackground educationalBackground)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);

                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
        public async Task <IActionResult> Create([Bind("Id,LateGracePeriod,NoLatesOrUndertime,RoundOffLates,TardinessMultiplier,UseTardinessBrackets,MaximumBreakTime,RequireLunchBreakAfter,EmployeeHasNoAbsent,RequiredWorkingHours,HalfDayIfTardinessReached,AbsentIfTardinessReached,AllowOffsettingOfOt,OvertimeMultiplier,AdditionalMinutesBeforeOt,AllowedTimeInEarlyOffset,StartOfScheduleOffset,EmployeeId")] AttendanceConfiguration attendanceConfiguration)
        {
            if (ModelState.IsValid)
            {
                _context.Add(attendanceConfiguration);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"] = new SelectList(_context.Employee, "Id", "Id", attendanceConfiguration.EmployeeId);
            return(View(attendanceConfiguration));
        }
コード例 #7
0
        public async Task <IActionResult> Create([Bind("Id,OrgId,Title,Description")] JobRole jobRole)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobRole);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OrgId"] = new SelectList(_context.Organization, "Id", "Name", jobRole.OrgId);
            return(View(jobRole));
        }
コード例 #8
0
        public async Task <IActionResult> Create([Bind("JobRoleId,Title,Description,TotalCredits,Id")] LeaveTypes leaveTypes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(leaveTypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["JobRoleId"] = new SelectList(_context.JobRole, "Id", "Title", leaveTypes.JobRoleId);
            return(View(leaveTypes));
        }
コード例 #9
0
        public async Task <IActionResult> Create([Bind("Id,JobRoleId,DepartmentId,Title,Description,Level")] Position position)
        {
            if (ModelState.IsValid)
            {
                _context.Add(position);
                await _context.SaveChangesAsync();

                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));
        }
コード例 #10
0
        public async Task <IActionResult> Create([Bind("Id,EmployeeId,LeaveTypeId,IsPaid,IsApproved,DateFiled,Start,End,Hours,Remarks,Attachment,ApprovedBy")] UserLeaves userLeaves)
        {
            if (ModelState.IsValid)
            {
                userLeaves.DateFiled = DateTime.Now;

                TimeSpan?ts = userLeaves.End - userLeaves.Start;
                userLeaves.Hours      = (decimal)ts.Value.TotalHours;
                userLeaves.IsApproved = false;


                _context.Add(userLeaves);
                await _context.SaveChangesAsync();

                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));
        }