예제 #1
0
        public IActionResult UpdateShift(UpdateShiftViewModel shift)
        {
            BasePolicemanShiftVM newshift =
                _mapper.Map <BasePolicemanShiftVM>(_policePresentation.UpdateShift(shift));

            return(Json(newshift));
        }
예제 #2
0
        public PoliceShift UpdateShift(UpdateShiftViewModel shift)
        {
            PoliceShift oldshift = _shiftRepo.GetAllAsIQueryable()
                                   .FirstOrDefault(x => x.Id == shift.Id);

            oldshift.StartDate = shift.StartDate;
            oldshift.EndDate   = shift.EndDate;

            _shiftRepo.Save(oldshift);

            return(oldshift);
        }