Beispiel #1
0
        public SaleDisplayViewModel()
        {
            _saleServ          = new SaleServices();
            _safeServ          = new SafeServices();
            _categoryServ      = new CategoryServices();
            _saleCategoryServ  = new SaleCategoryServices();
            _clientAccountServ = new ClientAccountServices();

            _key           = "";
            _isFocused     = true;
            _currentWindow = Application.Current.Windows.OfType <MetroWindow>().LastOrDefault();
            sales          = _saleServ.GetSales();
            Load();
        }
Beispiel #2
0
        public SaleShowViewModel()
        {
            _saleServ          = new SaleServices();
            _categoryServ      = new CategoryServices();
            _saleRecallServ    = new SaleRecallServices();
            _saleCategoryServ  = new SaleCategoryServices();
            _clientAccountServ = new ClientAccountServices();
            _saleRecallDialog  = new SaleRecallDialog();

            _state          = "Normal";
            _isFocused      = true;
            _currentWindow  = Application.Current.Windows.OfType <MetroWindow>().LastOrDefault();
            _selectedSale   = _saleServ.GetSale(ID);
            _saleCategories = new ObservableCollection <SaleCategoryVM>(_saleCategoryServ.GetSaleCategoriesVM(ID));
            _categories     = new ObservableCollection <SaleRecallVM>(_saleRecallServ.GetSaleCategoriesVM(ID));
            RecallsQty      = _saleRecallServ.GetSaleRecallsSum(ID);
            Report          = "تقرير الفاتورة";
        }
Beispiel #3
0
        public SaleUpdateViewModel()
        {
            _safeServ          = new SafeServices();
            _saleServ          = new SaleServices();
            _clientServ        = new ClientServices();
            _categoryServ      = new CategoryServices();
            _salespersonServ   = new SalespersonServices();
            _saleCategoryServ  = new SaleCategoryServices();
            _clientAccountServ = new ClientAccountServices();
            _categoriesDialog  = new CategoriesShowDialog();
            _currentWindow     = Application.Current.Windows.OfType <MetroWindow>().LastOrDefault();

            _key            = "";
            _isFocused      = true;
            _selectedSale   = _saleServ.GetSale(ID);
            Salespersons    = new ObservableCollection <Salesperson>(_salespersonServ.GetSalespersons());
            _saleCategories = new ObservableCollection <SaleCategoryVM>(_saleCategoryServ.GetSaleCategoriesVM(ID));
            Report          = "تقرير الفاتورة";
        }
Beispiel #4
0
        public SaleAddViewModel()
        {
            _safeServ          = new SafeServices();
            _saleServ          = new SaleServices();
            _clientServ        = new ClientServices();
            _categoryServ      = new CategoryServices();
            _salespersonServ   = new SalespersonServices();
            _saleCategoryServ  = new SaleCategoryServices();
            _clientAccountServ = new ClientAccountServices();
            _newSale           = new Sale();
            _categoriesDialog  = new CategoriesShowDialog();
            _saleCategories    = new ObservableCollection <SaleCategoryVM>();

            _key           = "";
            _isFocused     = true;
            _currentWindow = Application.Current.Windows.OfType <MetroWindow>().LastOrDefault();
            Clients        = new ObservableCollection <Client>(_clientServ.GetClients());
            Salespersons   = new ObservableCollection <Salesperson>(_salespersonServ.GetSalespersons());
            NewSale.Date   = DateTime.Now;
            Report         = "تقرير الفاتورة";
        }