示例#1
0
        private async void EditMethod()
        {
            if (_supplyServ.IsExistInRecalls(_selectedSupply.ID) || !_supplyServ.IsLastSupply(_selectedSupply.ID))
            {
                await _currentWindow.ShowMessageAsync("فشل التعديل", "لا يمكن تعديل هذه الفاتورة", MessageDialogStyle.Affirmative, new MetroDialogSettings()
                {
                    AffirmativeButtonText = "موافق",
                    DialogMessageFontSize = 25,
                    DialogTitleFontSize   = 30
                });

                return;
            }

            SupplyUpdateViewModel.ID = _selectedSupply.ID;
            _currentWindow.Hide();
            new SupplyUpdateWindow().ShowDialog();
            supplies = _supplyServ.GetSupplies();
            Load();
            _currentWindow.ShowDialog();
        }
示例#2
0
        public SupplyDisplayViewModel()
        {
            _safeServ           = new SafeServices();
            _supplyServ         = new SupplyServices();
            _categoryServ       = new CategoryServices();
            _clientAccountServ  = new ClientAccountServices();
            _supplyCategoryServ = new SupplyCategoryServices();

            _key           = "";
            _isFocused     = true;
            _currentWindow = Application.Current.Windows.OfType <MetroWindow>().LastOrDefault();
            supplies       = _supplyServ.GetSupplies();
            Load();
        }