/// <summary> /// Runs prior to the work being done. /// </summary> protected override void PreExecute() { WellKnownError = new WellKnownErrors(); TranscriptionRepository = new TranscriptionRepository(); PredefineUserRepository = new PredefineUserRepository(); AudioEquipmentUsedRepository = new AudioEquipmentUsedRepository(); VideoEquipmentUsedRepository = new VideoEquipmentUsedRepository(); WellKnownError.Value = WellKnownError.NoError; }
/// <summary> /// Runs prior to the work being done. /// </summary> protected override void PreExecute() { WellKnownError = new WellKnownErrors(); TranscriptionRepository = new TranscriptionRepository(); RepositoryRepository = new RepositoryRepository(); CollectionRepository = new CollectionRepository(); SubseryRepository = new SubseryRepository(); SubjectRepository = new SubjectRepository(); KeywordRepository = new KeywordRepository(); PredefineUserRepository = new PredefineUserRepository(); AudioEquipmentUsedRepository = new AudioEquipmentUsedRepository(); VideoEquipmentUsedRepository = new VideoEquipmentUsedRepository(); UserTypeRepository = new UserTypeRepository(); WellKnownError.Value = WellKnownError.NoError; }
/// <summary> /// The actual Work to be done. /// </summary> protected override void Execute() { transcription daTranscription = TranscriptionRepository.GetTranscription(Request.TranscriptionModel.ProjectCode); if (daTranscription != null) { WellKnownError.Value = WellKnownErrors.NotUniqueProjectCode; } else { AddPredefineUser(); if (Request.TranscriptionModel.IsANewAudioEquipment) { AudioEquipmentUsedRepository.Add( new audioequipmentused() { AudioEquipmentUsedName = Request.TranscriptionModel.AudioEquipmentUsed }); AudioEquipmentUsedRepository.Save(); } if (Request.TranscriptionModel.IsANewVideoEquipment) { VideoEquipmentUsedRepository.Add(new videoequipmentused() { VideoEquipmentUsedName = Request.TranscriptionModel.VideoEquipmentUsed }); VideoEquipmentUsedRepository.Save(); } if (Request.WellKnownModificationType == Core.Enums.WellKnownModificationType.Add) { transcription transcription = Util.ConvertToTranscription(Request.TranscriptionModel); TranscriptionRepository.Add(transcription); TranscriptionRepository.Save(); } else { daTranscription = null; daTranscription = TranscriptionRepository.GetTranscription(Request.TranscriptionModel.Id); TranscriptionModel transcriptionModel = Request.TranscriptionModel; switch (Request.WellKnownTranscriptionModificationType) { case Core.Enums.WellKnownTranscriptionModificationType.Transcript: daTranscription.TranscriberAssigned = transcriptionModel.TranscriberAssigned; daTranscription.AuditCheckCompleted = transcriptionModel.AuditCheckCompleted; daTranscription.FirstEditCompleted = transcriptionModel.FirstEditCompleted; daTranscription.SecondEditCompleted = transcriptionModel.SecondEditCompleted; daTranscription.ThirdEditCompleted = transcriptionModel.ThirdEditCompleted; CheckPredefineUserAndInsert(2, transcriptionModel.TranscriberAssigned); CheckPredefineUserAndInsert(2, transcriptionModel.AuditCheckCompleted); CheckPredefineUserAndInsert(2, transcriptionModel.FirstEditCompleted); CheckPredefineUserAndInsert(2, transcriptionModel.SecondEditCompleted); CheckPredefineUserAndInsert(2, transcriptionModel.ThirdEditCompleted); daTranscription.DraftSentDate = transcriptionModel.DraftSentDate; daTranscription.SentOut = transcriptionModel.SentOut; daTranscription.EditWithCorrectionCompleted = transcriptionModel.EditWithCorrectionCompleted; daTranscription.FinalEditCompleted = transcriptionModel.FinalEditCompleted; CheckPredefineUserAndInsert(2, transcriptionModel.EditWithCorrectionCompleted); CheckPredefineUserAndInsert(2, transcriptionModel.FinalEditCompleted); daTranscription.FinalSentDate = transcriptionModel.FinalSentDate; daTranscription.MetadataDraft = transcriptionModel.MetadataDraft; daTranscription.IsPriority = transcriptionModel.IsPriority; daTranscription.ReasonForPriority = transcriptionModel.ReasonForPriority; daTranscription.TranscriptStatus = transcriptionModel.TranscriptStatus; daTranscription.TranscriptLocation = transcriptionModel.TranscriptLocation; daTranscription.TranscriptNote = transcriptionModel.TranscriptNote; break; case Core.Enums.WellKnownTranscriptionModificationType.Media: daTranscription.IsAudioFormat = transcriptionModel.IsAudioFormat; //daTranscription.IsVideoFormat = transcriptionModel.IsVideoFormat; daTranscription.IsBornDigital = transcriptionModel.IsBornDigital; daTranscription.OriginalMediumType = transcriptionModel.OriginalMediumType; daTranscription.OriginalMedium = transcriptionModel.OriginalMedium; daTranscription.IsConvertToDigital = transcriptionModel.IsConvertToDigital; daTranscription.ConvertToDigitalDate = transcriptionModel.ConvertToDigitalDate; daTranscription.IsAccessMediaStatus = transcriptionModel.IsAccessMediaStatus; daTranscription.TechnicalSpecification = transcriptionModel.TechnicalSpecification; daTranscription.MasterFileLocation = transcriptionModel.MasterFileLocation; daTranscription.AccessFileLocation = transcriptionModel.AccessFileLocation; break; case Core.Enums.WellKnownTranscriptionModificationType.Metadata: daTranscription.Title = transcriptionModel.Title; daTranscription.Interviewee = transcriptionModel.Interviewee; daTranscription.Interviewer = transcriptionModel.Interviewer; daTranscription.InterviewDate = transcriptionModel.InterviewDate; daTranscription.InterviewDate1 = transcriptionModel.InterviewDate1; daTranscription.InterviewDate2 = transcriptionModel.InterviewDate2; daTranscription.ConvertToDigitalDate = transcriptionModel.ConvertToDigitalDate; daTranscription.Subject = transcriptionModel.Subject; daTranscription.Keywords = transcriptionModel.Keywords; daTranscription.Description = transcriptionModel.Description; daTranscription.ScopeAndContents = transcriptionModel.ScopeAndContents; daTranscription.Format = transcriptionModel.Format; daTranscription.Type = transcriptionModel.Type; daTranscription.Publisher = transcriptionModel.Publisher; daTranscription.RelationIsPartOf = transcriptionModel.RelationIsPartOf; daTranscription.CoverageSpatial = transcriptionModel.CoverageSpatial; daTranscription.CoverageTemporal = transcriptionModel.CoverageTemporal; daTranscription.Rights = transcriptionModel.Rights; daTranscription.Language = transcriptionModel.Language; daTranscription.Identifier = transcriptionModel.Identifier; daTranscription.Transcript = transcriptionModel.Transcript; daTranscription.FileName = transcriptionModel.FileName; daTranscription.CollectionId = transcriptionModel.CollectionId; daTranscription.SubseriesId = transcriptionModel.SubseriesId; break; case Core.Enums.WellKnownTranscriptionModificationType.Supplement: daTranscription.IsOnline = transcriptionModel.IsOnline; daTranscription.IsRosetta = transcriptionModel.IsRosetta; daTranscription.ReleaseForm = transcriptionModel.ReleaseForm; daTranscription.IsRestriction = transcriptionModel.IsRestriction; daTranscription.IsDarkArchive = transcriptionModel.IsDarkArchive; daTranscription.MetadataDraft = transcriptionModel.MetadataDraft; daTranscription.RestrictionNote = transcriptionModel.RestrictionNote; daTranscription.DarkArchiveNote = transcriptionModel.DarkArchiveNote; daTranscription.IsAudioFormat = transcriptionModel.IsAudioFormat; daTranscription.IsVideoFormat = transcriptionModel.IsVideoFormat; daTranscription.AudioEquipmentUsed = transcriptionModel.AudioEquipmentUsed; daTranscription.VideoEquipmentUsed = transcriptionModel.VideoEquipmentUsed; daTranscription.EquipmentNumber = transcriptionModel.EquipmentNumber; daTranscription.Place = transcriptionModel.Place; daTranscription.InterviewerDescription = transcriptionModel.InterviewerDescription; daTranscription.InterviewerKeywords = transcriptionModel.InterviewerKeywords; daTranscription.InterviewerSubjects = transcriptionModel.InterviewerSubjects; daTranscription.InterviewerNote = transcriptionModel.InterviewerNote; daTranscription.GeneralNote = transcriptionModel.GeneralNote; break; default: break; } daTranscription.UpdatedBy = transcriptionModel.UpdatedBy; daTranscription.UpdatedDate = transcriptionModel.UpdatedDate; TranscriptionRepository.Edit(daTranscription); TranscriptionRepository.Save(); } } Response = new ResponseModel() { IsOperationSuccess = true, }; }
/// <summary> /// The actual Work to be done. /// </summary> protected override void Execute() { MainFormModel mainFormModel = null; List <RepositoryModel> repositoryList = new List <RepositoryModel>(); List <CollectionModel> newlist = new List <CollectionModel>(); List <SubseryModel> newSubseriesList = new List <SubseryModel>(); List <SubjectModel> subjectList = new List <SubjectModel>(); List <KeywordModel> keywordList = new List <KeywordModel>(); List <UserTypeModel> userTypes = new List <UserTypeModel>(); //if (Request.IsStartup) //{ mainFormModel = new MainFormModel() { BrowseRecordCount = TranscriptionRepository.GetAll().Count(), TranscrptionQueueRecordCount = TranscriptionRepository.FindBy(t => t.TranscriptStatus == false).Count(), }; // collect repository details. List <repository> repositories = RepositoryRepository.GetRepositoriess(); foreach (repository item in repositories) { repositoryList.Add(Util.ConvertToRepositoryModel(item)); } // collect collection details. List <collection> collections = CollectionRepository.GetCollections().OrderBy(c => c.CollectionName).ToList(); foreach (collection item in collections) { newlist.Add(Util.ConvertToCollectionModel(item, repositories.First(c => c.Id == item.RepositoryId).RepositoryName)); } // collect subseries details. foreach (subsery item in SubseryRepository.GetSubseries().OrderBy(s => s.SubseriesName)) { newSubseriesList.Add(Util.ConvertToSubseryModel(item, collections.FirstOrDefault(s => s.Id == item.CollectionId).CollectionName)); } // collect subject details. foreach (subject item in SubjectRepository.GetSubjects()) { subjectList.Add(Util.ConvertToSubjectModel(item)); } // collect keywords details. foreach (keyword item in KeywordRepository.GetKeywords()) { keywordList.Add(Util.ConvertToKeywordModel(item)); } // collect user types details. foreach (usertype item in UserTypeRepository.GetAll()) { userTypes.Add(Util.ConvertToUsertypeModel(item)); } //} List <PredefinedUserModel> predefineUserList = Util.ConvertToPredefinedUserModel(PredefineUserRepository.GetPredefinedUsers()); List <string> audioEquipmentsUsed = AudioEquipmentUsedRepository.List(); List <string> videoEquipmentsUsed = VideoEquipmentUsedRepository.List(); Response = new ResponseModel() { Repositories = repositoryList, Subseries = newSubseriesList, Collections = newlist, Subjects = subjectList, Keywords = keywordList, PredefinedUsers = predefineUserList, AudioEquipmentsUsed = audioEquipmentsUsed, VideoEquipmentsUsed = videoEquipmentsUsed, UserTypes = userTypes, MainFormModel = mainFormModel, IsOperationSuccess = true }; }