Ejemplo n.º 1
0
 public MaterialService(
     IMapper mapper,
     IMaterialRepository repository,
     IMaterialConfigRepository configRepository,
     IMaterialBrandRepository brandRepository,
     IMaterialTypeRepository materialTypeRepository,
     IMaterialSerialNoRepository serialNoRepository,
     IMaterialCategoryRepository materialCategoryRepository,
     IMaterialCategoryService materialCategoryService,
     IMaterialTypeService materialTypeService,
     IAttachmentRepository attachmentRepository,
     IHttpContextAccessor accessor) : base(mapper, repository, attachmentRepository, accessor)
 {
     ConfigRepository           = configRepository;
     BrandRepository            = brandRepository;
     MaterialTypeRepository     = materialTypeRepository;
     SerialNoRepository         = serialNoRepository;
     MaterialCategoryRepository = materialCategoryRepository;
     MaterialCategoryService    = materialCategoryService;
     MaterialTypeService        = materialTypeService;
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var container = new UnityContainer();

            container.RegisterType <IDepartmentService, DepartmentService>();
            container.RegisterType <ILibraryService, LibraryService>();
            container.RegisterType <IMaterialTypeService, MaterialTypeService>();
            container.RegisterType <IMenuService, MenuService>();
            container.RegisterType <ITagService, TagService>();
            container.RegisterType <IUserService, UserService>();

            IDepartmentService   departmentService   = container.Resolve <IDepartmentService>();
            ILibraryService      libraryService      = container.Resolve <ILibraryService>();
            IMaterialTypeService materialTypeService = container.Resolve <IMaterialTypeService>();
            IMenuService         menuService         = container.Resolve <IMenuService>();
            ITagService          tagService          = container.Resolve <ITagService>();
            IUserService         userService         = container.Resolve <IUserService>();


            var lib = libraryService.AddLibrary(new Common.ViewModels.Library.LibraryViewModel {
                Name = "TestLiblary"
            }).Result;
            var dep = departmentService.AddDepartment(new Common.ViewModels.Department.DepartmentViewModel {
                Name = "Test", LibraryId = lib.Id
            }).Result;
            var mtype = materialTypeService.AddMaterialType(new Common.ViewModels.MaterialType.MaterialTypeViewModel {
                Name = "TestMaterialType"
            }).Result;
            var menu = menuService.AddMenu(new Common.ViewModels.Menu.MenuViewModel {
                Name = "Test Menu", Description = "Demo"
            });
            var tegData = tagService.AddTag(new Common.ViewModels.Tag.TagViewModel {
                Name = "TestTag"
            });
            var userData = userService.AddUser(new Common.ViewModels.User.UserPostViewModel {
                Username = "******", IsActive = true, Mail = "*****@*****.**"
            });
        }
Ejemplo n.º 3
0
 public MaterialTypeController(IMaterialTypeService materialTypeService, IMenuItemService menuItemService)
     : base(menuItemService)
 {
     this.materialTypeService = materialTypeService;
 }
Ejemplo n.º 4
0
 public MaterialTypesController(IMaterialTypeService materialTypeService,
                                ILogger <MaterialTypesController> logger)
 {
     _materialTypeService = materialTypeService;
     _logger = logger;
 }
Ejemplo n.º 5
0
 public CategoryController(ICategoryService categoryService, IMaterialTypeService materialTypeService, IMenuItemService menuItemService)
     : base(menuItemService)
 {
     this.categoryService     = categoryService;
     this.materialTypeService = materialTypeService;
 }
 public MaterialTypeController(IMaterialTypeService service)
 {
     this.Service = service;
 }