Example #1
0
 public SalesDataService(IProductRepository pRepo, IImageRepository iRepo,
                         IBillsRepository bRepo, IBusinessRepository businessRepo)
 {
     _imagesRepo   = iRepo;
     _billRepo     = bRepo;
     _businessRepo = businessRepo;
 }
Example #2
0
        public async Task <int> Insert(Bill bill)
        {
            using (var session = new Session())
            {
                var uow = session.UnitOfWork;

                _strategy        = new FifoStrategy();
                _billsRepository = new BillsRepository(uow);

                uow.Begin();
                try
                {
                    var billId = await _billsRepository.InsertUow(bill);

                    await _strategy.UpdateAverageCostUow(Direction.Sale, bill, uow);

                    uow.Commit();
                    return(billId);
                }
                catch (Exception e)
                {
                    uow.RollBack();
                    throw e;
                }
            }
        }
Example #3
0
 public TestBLL()
 {
     shopRepo     = new ShopRepository(conn);
     businessRepo = new BusinessRepository(conn);
     imgRepo      = new ImagesRepository(conn);
     prodRepo     = new ProductRepository(conn);
     unitRepo     = new UnitRepository(conn);
     priceRepo    = new PriceRepository(conn);
     costRepo     = new CostRepository(conn);
     stockRepo    = new StockRepository(conn);
     userRepo     = new UserRepository(conn);
     billsRepo    = new BillsRepository(conn);
     expRepo      = new ExpensesRepository(conn);
     foldersRepo  = new FoldersRepository(conn);
     dbBase       = new DropBoxBase("o9340xsv2mzn7ws", "xzky2fzfnmssik1");
     checker      = new ShopsChecker(shopRepo);
     dbBase.GeneratedAuthenticationURL();
     dbBase.GenerateAccessToken();
     prodService = new ProductService(shopRepo, businessRepo, imgRepo, dbBase, prodRepo, unitRepo, priceRepo,
                                      costRepo, stockRepo, ordersRepo, strategy, new FoldersDataService(foldersRepo, prodRepo));
     orderStockRepo     = new OrderStockRepository(conn);
     strategy           = new FifoStrategy(orderStockRepo, stockRepo, costRepo);
     salesService       = new SalesSerivce(userRepo, shopRepo, billsRepo, prodRepo, priceRepo, imgRepo, strategy, checker, costRepo);
     ordersRepo         = new OrdersRepository(conn);
     productDataService = new ProductDataService(dbBase);
 }
Example #4
0
 public GroupsService(IGroupMapping groupMapping, IGroupsRepository groupsRepository, IUserRepository userRepository, IBillsRepository billsRepository)
 {
     _groupMapping     = groupMapping;
     _groupsRepository = groupsRepository;
     _userRepository   = userRepository;
     _billsRepository  = billsRepository;
 }
Example #5
0
 public ProductPositionStrategy(IShopRepository shopRepository, IProductRepository productRepository, IStockRepository stockRepository, IOrdersRepository ordersRepository, IBillsRepository billsRepository)
 {
     _shopRepository    = shopRepository;
     _productRepository = productRepository;
     _stockRepository   = stockRepository;
     _ordersRepository  = ordersRepository;
     _billsRepository   = billsRepository;
 }
Example #6
0
 public AssignGroupMiddleware(
     RequestDelegate next,
     ILogger <AssignGroupMiddleware> logger,
     IBillsRepository repository)
 {
     this.next       = next ?? throw new System.ArgumentNullException(nameof(next));
     this.logger     = logger ?? throw new System.ArgumentNullException(nameof(logger));
     this.repository = repository ?? throw new System.ArgumentNullException(nameof(repository));
 }
        public OwnerController(IBuildingsRepository buildingsRepository, IPartitionSpacesRepository partitionSpacesRepository,
			IPersonsRepository personsRepository, IAdminJobsVotingsRepository adminJobsVotingsRepository, IBillsRepository billsRepository)
        {
            this.buildingsRepository = buildingsRepository;
            this.partitionSpacesRepository = partitionSpacesRepository;
            this.personsRepository = personsRepository;
            this.adminJobsVotingsRepository = adminJobsVotingsRepository;
            this.billsRepository = billsRepository;
        }
        public FinancesController(IBillsRepository billsRepository, IReservesRepository reservesRepository,
			IPersonsRepository personsRepository, IBuildingsRepository buildingsRepository,
			IEmailNotifier emailNotifier)
        {
            this.billsRepository = billsRepository;
            this.reservesRepository = reservesRepository;
            this.personsRepository = personsRepository;
            this.buildingsRepository = buildingsRepository;
            this.emailNotifier = emailNotifier;
        }
        public ContractorController(IContractorsRepository contractorsRepository, IMaintenancesRepository maintenancesRepository,
			IPersonsRepository personsRepository, IBillsRepository billsRepository, IRepairServicesRepository repairServicesRepository,
			IEmailNotifier emailNotifier)
        {
            this.contractorsRepository = contractorsRepository;
            this.maintenancesRepository = maintenancesRepository;
            this.personsRepository = personsRepository;
            this.billsRepository = billsRepository;
            this.repairServicesRepository = repairServicesRepository;
            this.emailNotifier = emailNotifier;
        }
        public BuildingManagerController(IBuildingManagersRepository buildingManagersRepository, IPersonsRepository personsRepository,
			IContractorsRepository contractorsRepository, IBillsRepository billsRepository, IBuildingsRepository buildingsRepository,
			IEmailNotifier emailNotifier)
        {
            this.buildingManagersRepository = buildingManagersRepository;
            this.personsRepository = personsRepository;
            this.contractorsRepository = contractorsRepository;
            this.billsRepository = billsRepository;
            this.buildingsRepository = buildingsRepository;
            this.emailNotifier = emailNotifier;
        }
Example #11
0
 public SalesSerivce(IUserRepository userRepository, IShopRepository shopRepository, IBillsRepository billsRepository, IProductRepository productRepository,
                     IPriceRepository priceRepository, IImageRepository imageRepository, IStrategy strategy, ShopsChecker shopsChecker, ICostRepository costRepo)
 {
     _imgRepo      = imageRepository;
     _userRepo     = userRepository;
     _shopRepo     = shopRepository;
     _billsRepo    = billsRepository;
     _productRepo  = productRepository;
     _priceRepo    = priceRepository;
     _costRepo     = costRepo;
     _shopsChecker = shopsChecker;
     _strategy     = strategy;
 }
Example #12
0
        public BillsModule(IBillsRepository repository)
            : base("/bills")
        {
            _repository = repository;
            Get["/summary"] = _ =>
            {
                var billSummaries = _repository.GetBillSummaries();
                return JsonConvert.SerializeObject(billSummaries);
            };

            Get["/{id}"] = parameters =>
            {
                var bill = _repository.GetBill(parameters.Id);
                return JsonConvert.SerializeObject(bill);
            };
        }
        private async void GetData()
        {
            IBillsRepository repository = BillsRepository.Instance;

            try {
                var list = await repository.GetProjektyAktowPrawnychList();

                newestList.Adapter = new ProjektyAktowPrawnychAdapter(this, list);

                if (viewSwitcher.CurrentView != newestList)
                {
                    viewSwitcher.ShowPrevious();
                }
            } catch (ApiRequestException ex) {
                this.ShowErrorDialog(ex.Message);
            }
        }
        public static bool IssueMonthlyReserveBills(Reserve reserve, IBillsRepository billsRepository)
        {
            var currentDateTime = DateTime.Now;
            bool areIssuedReserveBillsFor = billsRepository.AreIssuedReserveBillsFor(reserve, currentDateTime.Month,
                                                                                     currentDateTime.Year);

            if(!areIssuedReserveBillsFor) {
                if(reserve.Building.LandRegistry != null && reserve.Building.LandRegistry.Locked) {
                    var partitionSpaces = reserve.Building.LandRegistry.OwnedPartitionSpaces;

                        foreach (var partitionSpace in partitionSpaces) {
                            reserve.IssueReserveBillFor(partitionSpace, 23);
                        }

                    return true;
                }
            }

            return false;
        }
 public BillsController(IBillsRepository repo)
 {
     _repo = repo;
 }
Example #16
0
 public BillsController(IBillsRepository billsRepository)
 {
     this.BillsRepository = billsRepository;
 }
Example #17
0
 public BillsService(IBillsRepository billsRepository)
 {
     _billsRepository = billsRepository;
 }
Example #18
0
 public BillsController(IBillsRepository repository)
 {
     this.repository = repository ?? throw new System.ArgumentNullException(nameof(repository));
 }
Example #19
0
 public UsersService(IUserMapping userMapping, IUserRepository userRepository, IBillsRepository billsRepository)
 {
     _userMapping     = userMapping;
     _userRepository  = userRepository;
     _billsRepository = billsRepository;
 }