Esempio n. 1
0
 public SuppliersController(ISuppliersRepository suppliersRepository, IMapper mapper)
 {
     _suppliersRepository = suppliersRepository ??
                            throw new ArgumentNullException(nameof(suppliersRepository));
     _mapper = mapper ??
               throw new ArgumentNullException(nameof(mapper));
 }
Esempio n. 2
0
 public UnitOfWork(ISuppliersRepository suppliers, IProductCategoriesRepository productCategories, IProductsRepository products, IProductsDbContext context)
 {
     Suppliers         = suppliers;
     ProductCategories = productCategories;
     Products          = products;
     _context          = context;
 }
Esempio n. 3
0
        public IBOSuppliers BOSuppliers(ISuppliersRepository repo)
        {
            BOSuppliers boSuppliers = (BOSuppliers)BOSuppliers();

            boSuppliers.Repository = repo;
            return(boSuppliers);
        }
Esempio n. 4
0
 public PricesService(IPricesRepository PriceRepo,
                      IProductsRepository ProductRepo,
                      ISuppliersRepository SuppliersRepo)
 {
     _pricesRepository    = PriceRepo;
     _productsRepository  = ProductRepo;
     _suppliersRepository = SuppliersRepo;
 }
Esempio n. 5
0
        public productdetailsController(IProductDetailsRepository repos, IMapper mapper,

                                        ISuppliersRepository Suppliersrepos, UserManager <IdentityUser> userManager)
        {
            _repos          = repos;
            _Suppliersrepos = Suppliersrepos;
            _mapper         = mapper;
            _userManager    = userManager;
        }
Esempio n. 6
0
 public UnitOfWork(IApplicationDbContext context, ICategoriesRepository categories, IInventoriesRepository inventories, IProductsRepository products, IStatusesRepository statuses, IStocksRepository stocks, ISuppliersRepository suppliers, ITransactionsRepository transactions, IWholesalersRepository wholesalers)
 {
     _context     = context;
     Categories   = categories;
     Inventories  = inventories;
     Products     = products;
     Statuses     = statuses;
     Stocks       = stocks;
     Suppliers    = suppliers;
     Transactions = transactions;
     Wholesalers  = wholesalers;
 }
Esempio n. 7
0
 ///<Summary>
 ///SuppliersCollectionCount
 ///This method returns the collection count of BOSuppliers objects
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 SuppliersCollectionCount(ISuppliersRepository iSuppliersRepository)
 {
     Doing(null);
     try
     {
         Int32 objCount = iSuppliersRepository.SelectAllCount();
         return(objCount);
     }
     catch (Exception ex)
     {
         Failed(null, ex);
         Handle(null, ex);
         return(-1);
     }
 }
Esempio n. 8
0
        ///<Summary>
        ///SuppliersCollection
        ///This method returns the collection of BOSuppliers objects
        ///</Summary>
        ///<returns>
        ///IList[IBOSuppliers]
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <IBOSuppliers> SuppliersCollection(ISuppliersRepository iSuppliersRepository)
        {
            Doing(null);
            try
            {
                IList <IBOSuppliers>  boSuppliersCollection  = new List <IBOSuppliers>();
                IList <IDAOSuppliers> daoSuppliersCollection = iSuppliersRepository.SelectAll();
                Done(null);

                foreach (IDAOSuppliers daoSuppliers in daoSuppliersCollection)
                {
                    boSuppliersCollection.Add(new BOSuppliers(daoSuppliers));
                }

                return(boSuppliersCollection);
            }
            catch (Exception ex)
            {
                Failed(null, ex);
                Handle(null, ex);
                return(null);
            }
        }
Esempio n. 9
0
 public SuppliersGetService(ISuppliersRepository suppliersRepository)
 {
     _suppliersRepository = suppliersRepository;
 }
Esempio n. 10
0
 public IQueryable <Suppliers> GetSuppliers([Service] ISuppliersRepository repository) => repository.GetSuppliers();
Esempio n. 11
0
 public SuppliersService(ISuppliersRepository repo)
 {
     _repo = repo;
 }
Esempio n. 12
0
 public SuppliersDeleteService(ISuppliersRepository suppliersRepository)
 {
     _suppliersRepository = suppliersRepository;
 }
Esempio n. 13
0
 public SuppliersPublishService(ISuppliersRepository suppliersRepository)
 {
     _suppliersRepository = suppliersRepository;
 }
        public static void ChooseOperatioForSuppliersRepository(ISuppliersRepository suppliersRepository, OperationForSuppliersRepository suppliersRepositoryOperation)
        {
            switch (suppliersRepositoryOperation)
            {
            case OperationForSuppliersRepository.ShowAll:
                ShowAllSuppliers(suppliersRepository.Get());
                break;

            case OperationForSuppliersRepository.ShowById:
                Console.WriteLine("Enter supplier Id: ");
                if (int.TryParse(Console.ReadLine(), out var supplierId))
                {
                    Console.WriteLine(suppliersRepository.Get(supplierId));
                }
                break;

            case OperationForSuppliersRepository.Add:
                Supplier supplierToAdd = CreateSupplierToAdd();
                suppliersRepository.Add(supplierToAdd);
                Console.WriteLine("New supplier added");
                break;

            case OperationForSuppliersRepository.Update:

                Supplier supplierToUpdate = null;
                Console.Write("Enter supplier Id to update: ");
                if (int.TryParse(Console.ReadLine(), out var supplierIdToUpdate))
                {
                    supplierToUpdate = suppliersRepository.Get(supplierIdToUpdate);
                }
                Console.Write("Enter new Name: ");
                supplierToUpdate.Name = Console.ReadLine();

                suppliersRepository.Update(supplierToUpdate);
                Console.WriteLine("Supplier updated");
                break;

            case OperationForSuppliersRepository.Delete:
                Console.WriteLine("Enter supplier Id: ");
                if (int.TryParse(Console.ReadLine(), out var supplierIdToDelete))
                {
                    suppliersRepository.Delete(supplierIdToDelete);
                    Console.WriteLine("Supplier deleted");
                }
                break;

            case OperationForSuppliersRepository.GetSupplierInfoWithMaxQuantityOfGoods:
                var maxQuantityOfGoodsSupplier = suppliersRepository.GetSupplierInfoWithMaxQuantityOfGoods();
                Console.WriteLine($"Supplier with max quantity of goods: {maxQuantityOfGoodsSupplier}");
                break;

            case OperationForSuppliersRepository.GetSupplierInfoWithMinQuantityOfGoods:
                var minQuantityOfGoodsSupplier = suppliersRepository.GetSupplierInfoWithMaxQuantityOfGoods();
                Console.WriteLine($"Supplier with max quantity of goods: {minQuantityOfGoodsSupplier}");
                break;

            default:
                Environment.Exit(0);
                break;
            }
        }
Esempio n. 15
0
 public SuppliersUpdateService(ISuppliersRepository suppliersRepository)
 {
     _suppliersRepository = suppliersRepository;
 }
Esempio n. 16
0
 public SuppliersController(ILogger <SuppliersController> logger, ISuppliersRepository suppliers)
 {
     _logger    = logger;
     _suppliers = suppliers;
 }
Esempio n. 17
0
 public SuppliersController(ISuppliersRepository suppliersRepository,
                            IMapper mapper)
 {
     _suppliersRepository = suppliersRepository;
     _mapper = mapper;
 }
Esempio n. 18
0
 public SuppliersController(IConfigurationRoot config, ISuppliersRepository supplierRepo, IHostingEnvironment env)
 {
     this.supplierRepo = supplierRepo;
     this.env          = env;
     this.config       = config;
 }
Esempio n. 19
0
 /// <summary>
 /// Конструктор сервісу постачальників
 /// </summary>
 /// <param name="suppliersRepository">Екземпляр репозиторію постачальників</param>
 public SuppliersService(ISuppliersRepository suppliersRepository)
 {
     this.suppliersRepository = suppliersRepository;
 }
Esempio n. 20
0
 public SuppliersController1(ISuppliersRepository repos, IMapper mapper)
 {
     _repos  = repos;
     _mapper = mapper;
 }