Exemplo n.º 1
0
        /// <summary>
        /// The actual Work to be done.
        /// </summary>
        protected override void Execute()
        {
            List <CollectionModel> newlist         = new List <CollectionModel>();
            CollectionModel        collectionModel = new CollectionModel();

            List <repository> repositories = RepositoryRepository.GetRepositoriess();

            if (this.Request.CollectionId > 0)
            {
                collection collection = CollectionRepository.FirstOrDefault(c => c.Id == this.Request.CollectionId);

                collectionModel = Util.ConvertToCollectionModel(
                    collection, repositories.First(c => c.Id == collection.RepositoryId).RepositoryName);
            }
            else
            {
                foreach (collection item in CollectionRepository.GetCollections().OrderBy(c => c.CollectionName))
                {
                    newlist.Add(Util.ConvertToCollectionModel(item, repositories.First(c => c.Id == item.RepositoryId).RepositoryName));
                }
            }

            Response = new ResponseModel()
            {
                Collection         = collectionModel,
                Collections        = newlist,
                IsOperationSuccess = true
            };
        }
Exemplo n.º 2
0
        /// <summary>
        /// The actual Work to be done.
        /// </summary>
        protected override void Execute()
        {
            List <RepositoryModel> newlist = new List <RepositoryModel>();

            RepositoryModel repositoryModel = new RepositoryModel();

            if (this.Request.RepositoryId > 0)
            {
                repositoryModel = Util.ConvertToRepositoryModel(RepositoryRepository.FirstOrDefault(c => c.Id == this.Request.RepositoryId));
            }
            else
            {
                foreach (repository item in RepositoryRepository.GetRepositoriess())
                {
                    newlist.Add(Util.ConvertToRepositoryModel(item));
                }
            }

            Response = new ResponseModel()
            {
                Repository         = repositoryModel,
                Repositories       = newlist,
                IsOperationSuccess = true
            };
        }
Exemplo n.º 3
0
        /// <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
            };
        }