public override void Execute() { var hearing = new Hearing() { HearingDate = _docket.HearingDate, HearingIssues = _docket.HearingIssue, Courtroom = DataManager.CourtroomRepository.GetById(_docket.Courtroom.Id), Department = DataManager.CourtDepartmentRepository.GetById(_docket.Department.Id), Session = _docket.Session, State = ObjectState.Added, }; _courtCase.Hearings.Add(hearing); _courtCase.CaseHistory.Add( new CaseHistory() { CaseHistoryEvent = Model.Enums.CaseHistoryEvent.Hearing, Hearing = hearing, Date = DateTime.Now, CourtClerk = _docket.CourtClerkId.HasValue ? DataManager.UserRepository.GetById(_docket.CourtClerkId.Value) : null, State = ObjectState.Added, } ); _courtCase.LastAction = _docket.Action.GetValueOrDefault(CourtAction.Docketed); _courtCase.State = ObjectState.Modified; _dataManagerInstance.CourtCaseRepository.ModifyByState(_courtCase); }
public override void Execute() { if (_docket.HearingReissue == null) { throw new InvalidOperationException("There is no any reissue details in the docket record"); } _docket.HearingReissue.State = ObjectState.Added; var hearing = new Hearing() { HearingDate = _docket.HearingDate, HearingIssues = _docket.HearingIssue, Courtroom = _dataManagerInstance.CourtroomRepository.GetById(_docket.Courtroom.Id), Department = _dataManagerInstance.CourtDepartmentRepository.GetById(_docket.Department.Id), Session = _docket.Session, State = ObjectState.Added, Reissue = _docket.HearingReissue, }; _courtCase.Hearings.Add(hearing); _courtCase.CaseHistory.Add( new CaseHistory() { CaseHistoryEvent = Model.Enums.CaseHistoryEvent.Hearing, Hearing = hearing, Date = DateTime.Now, CourtClerk = _docket.CourtClerkId.HasValue ? _dataManagerInstance.UserRepository.GetById(_docket.CourtClerkId.Value) : null, State = ObjectState.Added, } ); _courtCase.State = ObjectState.Modified; _dataManagerInstance.CourtCaseRepository.ModifyByState(_courtCase); }