public ActionResult OrderByList(string Id)
        {
            IBookService = new BooksService();
            ICategoryService = new CategoryService();
            IAuthorService = new AuthorService();

            var books = IBookService.GetBooks();
            foreach (var book in books)
            {
                book.Author= IAuthorService.GetAuthor(book.AuthorId);
                book.Category = ICategoryService.GetCategory(book.CategoryId);
            }

            if (Id.Equals("1"))
            {
                books.OrderBy(a => a.Author.Name);
            }

            if (Id.Equals("2"))
            {
                books.OrderBy(c => c.Category.Name);
            }

            return View("Index", books);
        }
        public ActionResult Author()
        {
            IAuthorService = new AuthorService();
            var authors = IAuthorService.GetAuthors();

            return View(authors);
        }
예제 #3
0
 public void Setup()
 {
     _authorService = MockRepository.GenerateStub<IAuthorService>();
     _sut = new AuthorController(_authorService);
     _sut.Request = new HttpRequestMessage();
     _sut.Request.SetConfiguration(new HttpConfiguration());
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BlogsApiContext" /> class.
 /// </summary>
 /// <param name="lifetimeScope">The lifetime scope.</param>
 /// <param name="tagService">The tag service.</param>
 /// <param name="blogService">The blog service.</param>
 /// <param name="authorService">The author service.</param>
 /// <param name="repository">The repository.</param>
 public BlogsApiContext(ILifetimeScope lifetimeScope, ITagService tagService, IBlogService blogService, IAuthorService authorService, IRepository repository = null)
     : base(lifetimeScope, repository)
 {
     this.tagService = tagService;
     this.blogService = blogService;
     this.authorService = authorService;
 }
예제 #5
0
 public DefaultBlogApiOperations(IBlogPostsService blogPosts, IBlogPostService blogPost, IAuthorsService authors,
     IAuthorService author)
 {
     BlogPost = blogPost;
     BlogPosts = blogPosts;
     Author = author;
     Authors = authors;
 }
예제 #6
0
 public StatController(IStatService statService, IAuthorService authorService, ITagService tagService, IUserInterfaceManager userInterfaceManager, IMapper mapper)
     : base(userInterfaceManager)
 {
     this.statService = statService;
     this.authorService = authorService;
     this.tagService = tagService;
     this.mapper = mapper;
 }
 public BookController(IBookService bookService, IAuthorService authorService, IGradeService gradeService, IGenreService genreService, IUserService userService)
 {
     this.bookService = bookService;
     this.authorService = authorService;
     this.gradeService = gradeService;
     this.genreService = genreService;
     this.userService = userService;
 }
 public AuthorsController(
     IMapper mapper,
     IAuthorService authorService,
     IBookService bookService,
     IUserService userService)
 {
     this.mapper        = mapper;
     this.authorService = authorService;
     this.bookService   = bookService;
     this.userService   = userService;
 }
 public LibraryVisitController(
     IReaderService readerService,
     IBookService bookService,
     IAuthorService authorService,
     ISubscriptionService subscriptionService)
 {
     _readerService       = readerService;
     _booksService        = bookService;
     _authorService       = authorService;
     _subscriptionService = subscriptionService;
 }
예제 #10
0
 public BooksController(
     IBookService bookService,
     ICategoryService categoryService,
     IAuthorService authorService,
     ICloudinaryService cloudinaryService)
 {
     this.bookService       = bookService;
     this.categoryService   = categoryService;
     this.authorService     = authorService;
     this.cloudinaryService = cloudinaryService;
 }
예제 #11
0
 public BookController(
     IMapper mapper,
     IUserMgmtService userSrv,
     IAuthorService authorServ,
     IBookService bookServ)
 {
     _mapper     = mapper;
     _userSrv    = userSrv;
     _authorServ = authorServ;
     _bookServ   = bookServ;
 }
예제 #12
0
 public HomeController(ILogger <HomeController> logger, IBookService bookService, IBrandService brandService, ILanguageService languageService, IGenreService genreService, IGenreBookService genreBookService, IAuthorService authorService, IAuthorBookService authorBookService)
 {
     _logger                = logger;
     this.bookService       = bookService;
     this.brandService      = brandService;
     this.languageService   = languageService;
     this.genreService      = genreService;
     this.genreBookService  = genreBookService;
     this.authorService     = authorService;
     this.authorBookService = authorBookService;
 }
예제 #13
0
 public BookController(IBookService bookService,
                       IPickOfTheDayService pickOfTheDayService,
                       IPickOfTheWeekService pickOfTheWeekService,
                       IAuthorService authorService,
                       IBookAuthorService bookAuthorService)
 {
     _bookService          = bookService;
     _pickOfTheDayService  = pickOfTheDayService;
     _pickOfTheWeekService = pickOfTheWeekService;
     _authorService        = authorService;
     _bookAuthorService    = bookAuthorService;
 }
예제 #14
0
 public BookController(IInformationService informationService, IChapterDetailService chapterDetailService, IAudioBookService audioBookService, ITypeEbookService typeEbookService, IUserService userService, IAuthorService authorService, IBookCategoryService bookCategoryService, IBookService bookService, IEbookService ebookService)
 {
     this._authorService        = authorService;
     this._informationService   = informationService;
     this._chapterDetailService = chapterDetailService;
     this._audioBookService     = audioBookService;
     this._bookCategoryService  = bookCategoryService;
     this._bookService          = bookService;
     this._ebookService         = ebookService;
     this._userService          = userService;
     this._typeEbookService     = typeEbookService;
 }
예제 #15
0
 public BookManagementController(
     IBookService bookServices,
     ICategoryService categoryServices,
     IAuthorService authorServices,
     IPublisherService publisherServices
     )
 {
     _bookServices      = bookServices;
     _categoryServices  = categoryServices;
     _authorServices    = authorServices;
     _publisherServices = publisherServices;
 }
예제 #16
0
 public OtherExtraFileRenamer(IOtherExtraFileService otherExtraFileService,
                              IAuthorService authorService,
                              IRecycleBinProvider recycleBinProvider,
                              IDiskProvider diskProvider,
                              Logger logger)
 {
     _logger                = logger;
     _diskProvider          = diskProvider;
     _recycleBinProvider    = recycleBinProvider;
     _authorService         = authorService;
     _otherExtraFileService = otherExtraFileService;
 }
예제 #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetBlogPostCommand" /> class.
 /// </summary>
 /// <param name="categoryService">The category service.</param>
 /// <param name="authorService">The author service.</param>
 /// <param name="tagService">The tag service.</param>
 /// <param name="contentService">The content service.</param>
 /// <param name="fileUrlResolver">The file URL resolver.</param>
 /// <param name="cmsConfiguration">The CMS configuration.</param>
 /// <param name="blogOptionService">The blog option service.</param>
 public GetBlogPostCommand(ICategoryService categoryService, IAuthorService authorService,
                           ITagService tagService, IContentService contentService, IMediaFileUrlResolver fileUrlResolver,
                           ICmsConfiguration cmsConfiguration, Services.IOptionService blogOptionService)
 {
     this.categoryService   = categoryService;
     this.authorService     = authorService;
     this.tagService        = tagService;
     this.contentService    = contentService;
     this.fileUrlResolver   = fileUrlResolver;
     this.cmsConfiguration  = cmsConfiguration;
     this.blogOptionService = blogOptionService;
 }
예제 #18
0
 public ManualImportController(IManualImportService manualImportService,
                               IAuthorService authorService,
                               IEditionService editionService,
                               IBookService bookService,
                               Logger logger)
 {
     _authorService       = authorService;
     _bookService         = bookService;
     _editionService      = editionService;
     _manualImportService = manualImportService;
     _logger = logger;
 }
예제 #19
0
        public AuthorController(IBroadcastSignalRMessage signalRBroadcaster,
                                IAuthorService authorService,
                                IBookService bookService,
                                IAddAuthorService addAuthorService,
                                IAuthorStatisticsService authorStatisticsService,
                                IMapCoversToLocal coverMapper,
                                IManageCommandQueue commandQueueManager,
                                IRootFolderService rootFolderService,
                                RecycleBinValidator recycleBinValidator,
                                RootFolderValidator rootFolderValidator,
                                MappedNetworkDriveValidator mappedNetworkDriveValidator,
                                AuthorPathValidator authorPathValidator,
                                AuthorExistsValidator authorExistsValidator,
                                AuthorAncestorValidator authorAncestorValidator,
                                SystemFolderValidator systemFolderValidator,
                                QualityProfileExistsValidator qualityProfileExistsValidator,
                                MetadataProfileExistsValidator metadataProfileExistsValidator)
            : base(signalRBroadcaster)
        {
            _authorService           = authorService;
            _bookService             = bookService;
            _addAuthorService        = addAuthorService;
            _authorStatisticsService = authorStatisticsService;

            _coverMapper         = coverMapper;
            _commandQueueManager = commandQueueManager;
            _rootFolderService   = rootFolderService;

            Http.Validation.RuleBuilderExtensions.ValidId(SharedValidator.RuleFor(s => s.QualityProfileId));
            Http.Validation.RuleBuilderExtensions.ValidId(SharedValidator.RuleFor(s => s.MetadataProfileId));

            SharedValidator.RuleFor(s => s.Path)
            .Cascade(CascadeMode.StopOnFirstFailure)
            .IsValidPath()
            .SetValidator(rootFolderValidator)
            .SetValidator(mappedNetworkDriveValidator)
            .SetValidator(authorPathValidator)
            .SetValidator(authorAncestorValidator)
            .SetValidator(recycleBinValidator)
            .SetValidator(systemFolderValidator)
            .When(s => !s.Path.IsNullOrWhiteSpace());

            SharedValidator.RuleFor(s => s.QualityProfileId).SetValidator(qualityProfileExistsValidator);
            SharedValidator.RuleFor(s => s.MetadataProfileId).SetValidator(metadataProfileExistsValidator);

            PostValidator.RuleFor(s => s.Path).IsValidPath().When(s => s.RootFolderPath.IsNullOrWhiteSpace());
            PostValidator.RuleFor(s => s.RootFolderPath).IsValidPath().When(s => s.Path.IsNullOrWhiteSpace());
            PostValidator.RuleFor(s => s.AuthorName).NotEmpty();
            PostValidator.RuleFor(s => s.ForeignAuthorId).NotEmpty().SetValidator(authorExistsValidator);

            PutValidator.RuleFor(s => s.Path).IsValidPath();
        }
예제 #20
0
 public RegisterModel(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     ILogger <RegisterModel> logger,
     IEmailSender emailSender,
     IAuthorService authorService)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _logger        = logger;
     _emailSender   = emailSender;
     _authorService = authorService;
 }
예제 #21
0
 public BooksController(IBookService bookService, IGenreService genreService, IAuthorService authorService,
                        IAuthorBookLinksService authorBookLinksService, IGenreBookLinksService genreBookLinksService,
                        IGenreAuthorLinksService genreAuthorLinksService, IReviewService reviewService, IUserFavouriteService userFavouriteService)
 {
     this.bookService             = bookService;
     this.genreService            = genreService;
     this.authorService           = authorService;
     this.authorBookLinksService  = authorBookLinksService;
     this.genreBookLinksService   = genreBookLinksService;
     this.genreAuthorLinksService = genreAuthorLinksService;
     this.reviewService           = reviewService;
     this.userFavouriteService    = userFavouriteService;
 }
        public AuthorApiController(ILocalLogger logger, IAuthorService authorService)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (authorService == null)
            {
                throw new ArgumentNullException(nameof(authorService));
            }

            _logger = logger;
            _authorService = authorService;
        }
        public ActionResult Index()
        {
            IBookService = new BooksService();
            ICategoryService = new CategoryService();
            IAuthorService = new AuthorService();

            var books = IBookService.GetBooks();
            foreach (var book in books)
            {
                book.Author= IAuthorService.GetAuthor(book.AuthorId);
                book.Category = ICategoryService.GetCategory(book.CategoryId);
            }

            return View(books);
        }
예제 #24
0
 // Constructeur de copie
 public BookViewModel(BookViewModel bvm)
 {
     this._authors = bvm._authors;
     this._authorService = bvm._authorService;
     this._book = bvm.Book;
     this._categories = bvm._categories;
     this._categoryService = bvm._categoryService;
     this._isNewPhoto = bvm._isNewPhoto;
     this._navigationServiceFacade = bvm._navigationServiceFacade;
     this._pageTitle = bvm._pageTitle;
     this._rates = bvm._rates;
     this._selectedAuthor = bvm._selectedAuthor;
     this._selectedCategory = bvm._selectedCategory;
     this._state = bvm._state;
     this._windowServices = bvm._windowServices;
 }
예제 #25
0
 public AuthorController(IAuthorService authorService)
 {
     this.authorService = authorService;
 }
예제 #26
0
 protected override void ServicesInitialization()
 {
     this._windowServices = ServiceLocator.Instance.Retrieve<IDialogService>();
     this._authorService = ServiceLocator.Instance.Retrieve<IAuthorService>();
     this._categoryService = ServiceLocator.Instance.Retrieve<ICategoryService>();
 }
 public AuthorController( IAuthorService authorService, AuthorResourceAssembler assembler )
 {
     AuthorService = authorService;
     AuthorAssembler = assembler;
 }
예제 #28
0
 public AuthenticationService(IAuthorService authorService)
 {
     this.authorService = authorService;
 }
예제 #29
0
 public AuthorAppService()
 {
     var authorRepository = RepositoryFactory.GetAuthorRepository();
     this.authorValidation = ValidationFactory.GetAuthorValidation();
     this.authorService = ServiceFactory.GetAuthorService(authorRepository, this.authorValidation);
 }                
예제 #30
0
 public AuthorAppService(IAuthorService authorService, IAuthorValidation authorValidation)
 {
     this.authorService = authorService;
     this.authorValidation = authorValidation;
 }
예제 #31
0
 public static IAuthenticationService GetAuthenticationService(IAuthorService authorService)
 {
     return new AuthenticationService(authorService);
 }
 public AuthorController(IBookService bookService, IAuthorService authorService, IUserService userService)
 {
     this.bookService = bookService;
     this.authorService = authorService;
     this.userService = userService;
 }
예제 #33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthorsService"/> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="fileUrlResolver">The file URL resolver.</param>
 /// <param name="authorService">The author service.</param>
 public AuthorsService(IRepository repository, IMediaFileUrlResolver fileUrlResolver, IAuthorService authorService)
 {
     this.repository = repository;
     this.fileUrlResolver = fileUrlResolver;
     this.authorService = authorService;
 }
예제 #34
0
 public HomeController()
 {
     _authorService = new AuthorService();
     _bookService = new BookService();
 }