public ChartsController(IRepository <Product> _ProductRepo, IRepository <Transaction> _TransactionRepo, SalesLogic _SalesL, ProfitLogic _ProfitL, ChartLogic _ChartL)
 {
     ProductRepo     = _ProductRepo;
     TransactionRepo = _TransactionRepo;
     SalesLogic      = _SalesL;
     ProfitLogic     = _ProfitL;
     ChartLogic      = _ChartL;
 }
Ejemplo n.º 2
0
        private bool ImportProfit(Application application)
        {
            var importProfit = new ImportProfit();
            var profitItem   = importProfit.GetProfitItemFromExcel(application);
            var profitLogic  = new ProfitLogic();

            return(profitLogic.Add(profitItem));
        }
 public DashboardController(IRepository <Product> _ProductRepo, IRepository <Transaction> _transaction,
                            IRepository <Store> _StoreRepo, SalesLogic _SalesL, ProfitLogic _ProfitL, ChartLogic _ChartL)
 {
     ProductRepo     = _ProductRepo;
     TransactionRepo = _transaction;
     SalesL          = _SalesL;
     ProfitLogic     = _ProfitL;
     StoreRepo       = _StoreRepo;
 }
        public ActionResult Index()
        {
            ViewBag.profits      = ProfitLogic.GetProfitForProducts(x => x.StoreId == LoggedInUser.StoreId).Sum(x => x.ProfitsForProductInYear.Sum(y => y.ProfitsPerMonth.Sum(z => z.Value)));
            ViewBag.sales        = SalesL.GetSalesForProducts(x => x.StoreId == LoggedInUser.StoreId).Sum(x => x.TransactionsForProductInYear.Sum(y => y.TransactionsPerMonth.Sum(z => z.Value)));
            ViewBag.transactions = TransactionRepo.GetAll(x => x.Batch.Product.StoreId == LoggedInUser.StoreId).Count();
            ViewBag.products     = ProductRepo.GetAll(x => x.StoreId == LoggedInUser.StoreId).Count();

            ProfitLogic.GetProfitForProducts(x => x.StoreId == LoggedInUser.StoreId);

            return(View());
        }
Ejemplo n.º 5
0
        public AnalysisController(IRepository <Product> _ProductRepo, IRepository <Batch> _ProductInStoreRepo,
                                  IRepository <Transaction> _TransactiontRepo, IRepository <Auction> _AuctionRepo,
                                  IRepository <ProductToBeAuctioned> _ProductToBeAuctionedRepo, IRepository <Loss> _LossRepo,
                                  IRepository <AuctionTransactionStatus> _AuctionStatusTransactionRepo, ProfitLogic _ProfitLogic,
                                  SalesLogic _SalesLogic, ProductsLogic _ProductsLogic)
        {
            ProductRepo        = _ProductRepo;
            Auctionrepo        = _AuctionRepo;
            ProductInStoreRepo = _ProductInStoreRepo;
            TransactionRepo    = _TransactiontRepo;
            ToBeAuctionedRepo  = _ProductToBeAuctionedRepo;

            ProfitLogic   = _ProfitLogic;
            SalesLogic    = _SalesLogic;
            ProductsLogic = _ProductsLogic;
        }