public SalesTargetController()
 {
     var dbfactory = new DatabaseFactory();
      _SalesTargetService = new SalesTargetService(new SalesTargetRepository(dbfactory), new UnitOfWork(dbfactory));
      _SalesTargetDetailService = new SalesTargetDetailService(new SalesTargetDetailRepository(dbfactory), new UnitOfWork(dbfactory));
      _SecCompanyService = new SecCompanyService(new SecCompanyRepository(dbfactory), new UnitOfWork(dbfactory));
      _officeService = new OfficeService(new OfficeRepository(dbfactory), new UnitOfWork(dbfactory));
      _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), new UnitOfWork(dbfactory));
 }
        public DashboardController()
        {
            InitStyle();
            randomGen = new Random();

            var dbfactory = new DatabaseFactory();
            var newUoW = new UnitOfWork(dbfactory);

            _SalesTargetService = new SalesTargetService(new SalesTargetRepository(dbfactory), newUoW);
            _SalesOrderService = new SalesOrderService(new SalesOrderRepository(dbfactory), new SalesOrderDetailRepository(dbfactory),
                new SalesOrderApprovalRepository(dbfactory), new NotificationRepository(dbfactory),
                new NotificationDetailRepository(dbfactory), newUoW);
            _collectionTargetService = new CollectionTargetService(new CollectionTargetRepository(dbfactory), newUoW);
            _collectionEntryService = new CollectionEntryService(new CollectionEntryRepository(dbfactory), newUoW);
            _hrmEmployeeService = new HrmEmployeeService(new HrmEmployeeRepository(dbfactory), newUoW);
            _companyService = new SecCompanyService(new SecCompanyRepository(dbfactory), newUoW);
        }