public GeneralSettingsServices()
 {
     if (generalSettingsRepository == null)
     {
         generalSettingsRepository = new GeneralSettingsRepository();
     }
 }
Ejemplo n.º 2
0
        public AppPresenter(AppShell view, CategoryRepository categoryRepository, CustomerRepository customerRepository, GeneralSettingsRepository generalSettingsRepository, ItemRepository itemRepository, SalesTransactionRepository salesTransactionRepository, SupplierRepository supplierRepository, UserRepository userRepository, UserRightRepository userRightRepository)
            : base(view)
        {
            this._categoryRepository         = categoryRepository;
            this._customerRepository         = customerRepository;
            this._generalSettingsRepository  = generalSettingsRepository;
            this._itemRepository             = itemRepository;
            this._salesTransactionRepository = salesTransactionRepository;
            this._supplierRepository         = supplierRepository;
            this._userRepository             = userRepository;
            this._userRightRepository        = userRightRepository;

            this._currentCategoryCollection         = new ObservableCollection <Category>(categoryRepository.FindAll());
            this._currentCustomerCollection         = new ObservableCollection <Customer>(customerRepository.FindAll());
            this._currentItemCollection             = new ObservableCollection <Item>(itemRepository.FindAllItem());
            this._currentSalesTransactionCollection = new ObservableCollection <SalesTransaction>(salesTransactionRepository.FindAllTransaction());
            this._currentSupplierCollection         = new ObservableCollection <Supplier>(supplierRepository.FindAll());
            this._currentUserCollection             = new ObservableCollection <User>(userRepository.FindAll());
            this._currentUserRightCollection        = new ObservableCollection <UserRight>(userRightRepository.FindAll());

            this._currentTItemCollection = new ObservableCollection <Item>();;

            this._currentGeneralSettings = new ObservableCollection <GeneralSettings>();
            this._currentGeneralSettings.Add(generalSettingsRepository.FindGeneralSettings());

            this._currentLogin = (Application.Current.MainWindow.DataContext as MainPresenter).CurrentLogin;

            this._profileBoxState = false;
        }