예제 #1
0
        public ActionResult ResolveSquawk(ResolveSquawkViewModel viewModel)
        {
            ProfileCommon profile = (ProfileCommon)HttpContext.Profile;
            Squawk squawk = _dataService.GetSquawkById(viewModel.Id);
            squawk.ResolutionNotes = viewModel.ResolutionNotes;
            squawk.ResolvedById = profile.MemberId;
            squawk.ResolvedOn = DateTime.Now;
            squawk.Status = viewModel.Status;

            _dataService.UpdateSquawk(squawk);

            SquawkDetailViewModel sqVM = new SquawkDetailViewModel()
            {
                Id = squawk.Id,
                AircraftId = squawk.AircraftId,
                Description = squawk.Description,
                PostedById = squawk.PostedById,
                PostedOn = squawk.PostedOn,
                RegistrationNumber = squawk.Aircraft.RegistrationNumber,
                ResolutionNotes = squawk.ResolutionNotes,
                ResolvedOn = squawk.ResolvedOn,
                ResolvedBy = profile.FirstName + " " + profile.LastName,
                Status = squawk.Status,
                Subject = squawk.Subject
            };

            return View(ViewNames.SquawkDetails, sqVM);
        }
예제 #2
0
        public ActionResult ResolveSquawk(int squawkId)
        {
            Squawk squawk = _dataService.GetSquawkById(squawkId);

            ResolveSquawkViewModel vm = new ResolveSquawkViewModel();
            vm.Status = squawk.Status;
            vm.AircraftId = squawk.AircraftId;
            vm.Description = squawk.Description;
            vm.Id = squawk.Id;
            vm.RegistrationNumber = squawk.Aircraft.RegistrationNumber;
            vm.ResolutionNotes = squawk.ResolutionNotes;
            vm.Subject = squawk.Subject;

            return View(ViewNames.ResolveSquawk, vm);
        }