Example #1
0
        public async Task <IActionResult> Edit(int id)
        {
            var shift = await _shiftService.GetByIdAsync(id);

            if (shift == null)
            {
                return(NotFound());
            }

            var editModel = new ShiftEditViewModel
            {
                ShiftId   = shift.ShiftId,
                ShiftName = shift.ShiftName,
                StartTime = shift.StartTime,
                EndTime   = shift.EndTime
            };

            return(View(editModel));
        }
Example #2
0
        public async Task <ActionResult <ShiftResource> > GetByIdAsync(int id)
        {
            var shift = await _shiftService.GetByIdAsync(id);

            //var resources = _mapper.Map<Email, EmailResource>(EmailItem);
            if (shift == null)
            {
                return(BadRequest("Email Not Found!"));
            }

            return(Ok(shift));
        }