public async Task <IActionResult> Create([Bind("ShiftId,ShiftTypeId,ShiftDate")] Shift shift)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shift);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ShiftTypeId"] = new SelectList(_context.ShiftTypes, "ShiftTypeId", "Name", shift.ShiftTypeId);
            return(View(shift));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ShiftRoleId,RoleName")] ShiftRole shiftRole)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shiftRole);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shiftRole));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("ShiftTypeId,Name,StartOffsetHrs,StartOffsetMins,RoasterSequence,ShiftSequence,ColorString")] ShiftType shiftType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shiftType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shiftType));
        }
        public async Task <IActionResult> Create([Bind("GenderId,Name")] Gender gender)
        {
            if (ModelState.IsValid)
            {
                _context.Add(gender);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(gender));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("ShiftParticipationTypeId,Name,IsAbsence,IsBold,ColorString")] ShiftParticipationType shiftParticipationType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shiftParticipationType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shiftParticipationType));
        }
        public async Task <IActionResult> Create([Bind("EmployeeShiftSkillId,EmployeeId,ShiftSkillId")] EmployeeShiftSkill employeeShiftSkill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employeeShiftSkill);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"]   = new SelectList(_context.Employees, "EmployeeId", "Name", employeeShiftSkill.EmployeeId);
            ViewData["ShiftSkillId"] = new SelectList(_context.ShiftSkills, "ShiftSkillId", "Name", employeeShiftSkill.ShiftSkillId);
            return(View(employeeShiftSkill));
        }
        public async Task <IActionResult> Create([Bind("ShiftParticipationId,EmployeeId,ShiftId")] ShiftParticipation shiftParticipation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shiftParticipation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "Name", shiftParticipation.EmployeeId);
            ViewData["ShiftId"]    = new SelectList(_context.Shifts, "ShiftId", "ShiftId", shiftParticipation.ShiftId);
            return(View(shiftParticipation));
        }
Exemplo n.º 8
0
        public async Task <IActionResult> Create([Bind("EmployeeId,OfficeId,GenderId,Name,Phone,Email,Dob,IsActive,ShiftRoleId,ShiftGroupId")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GenderId"]     = new SelectList(_context.Genders, "GenderId", "Name", employee.GenderId);
            ViewData["ShiftGroupId"] = new SelectList(_context.ShiftGroups, "ShiftGroupId", "Name", employee.ShiftGroupId);
            ViewData["ShiftRoleId"]  = new SelectList(_context.ShiftRoles, "ShiftRoleId", "RoleName", employee.ShiftRoleId);
            return(View(employee));
        }