예제 #1
0
        public ActionResult GetIsolatorOfflineDetail(int id)
        {
            var iso    = isolatorService.GetIsolatorById(id);
            var shifts = lookupService.GetAllStandaredShifts();

            var shiftIds = new String[0];

            if (!string.IsNullOrEmpty(iso.OfflineShifts))
            {
                shiftIds = iso.OfflineShifts.Split('|');
            }

            var model = new IsolatorOfflineViewModel
            {
                IsolatorId   = iso.IsolatorId,
                IsolatorName = iso.Abbriviation,
                StartDate    = iso.OfflineStartDate,
                EndDate      = iso.OfflineEndDate,
                AllShifts    = shiftIds.Length == 0,
                ShiftList    = new MultiSelectList(shifts.Select(p => new SelectListItem {
                    Value = p.ShiftId.ToString(), Text = p.ShiftTitle
                }), "Value", "Text", shiftIds),
            };

            return(PartialView("_IsolatorOffline", model));
        }