Example #1
0
        public virtual IActionResult Edit(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageShifts))
            {
                return(AccessDeniedView());
            }

            //try to get a customer role with the specified id
            var shift = _shiftService.GetShiftById(id);

            if (shift == null)
            {
                return(RedirectToAction("List"));
            }

            //prepare model
            var model = _shiftModelFactory.PrepareShiftModel(null, shift);

            return(View(model));
        }
Example #2
0
        public ActionResult ShiftEdit(int id)
        {
            ShiftDetailViewModel resById          = new ShiftDetailViewModel();
            ShiftDTO             getParentDetails = _shifService.GetShiftById(id);

            resById.ShiftId         = getParentDetails.ShiftId;
            resById.ShiftName       = getParentDetails.ShiftName;
            resById.ShiftDelayAllow = getParentDetails.ShiftDelayAllow;
            resById.ShiftStatus     = getParentDetails.ShiftStatus;
            List <ShiftDayDTO> getDetails = _shiftDayService.GetShiftByParentId(getParentDetails.ShiftId);

            resById.ShiftDay = getDetails;
            return(View(resById));
        }