예제 #1
0
        void DoSearch(object parameter)
        {
            if (parameter == null)
            {
                return;
            }
            _currentOffset = 0;
            var lst = _bll.GetFiltered((string)parameter, 10, _currentOffset);

            PopulateFilteredList(lst);
        }
예제 #2
0
        void DoSave(object parameter)
        {
            var ctl = parameter as ContentControl;
            var o   = ctl.Content as BaseObjDto;

            if (o.Id == 0)
            {
                BaseObj objNew = null;
                objNew = ObjFromDto(o, objNew);
                _bll.Add(objNew);
            }
            else
            {
                var objExisting = _bll.GetItemById(o.Id);
                ModuleAModule.TheMapper.Map(o, objExisting);
            }
            _bll.Flush();

            _bll = _container.Resolve <IBLL>(new ResolverOverride[]
            {
                new ParameterOverride("filePath", StoragePath)
            });
            var lst = _bll.GetFiltered("", 10, _currentOffset);

            PopulateFilteredList(lst);
        }
예제 #3
0
        void OpenStorage(object parameter)
        {
            var openFileDialog = new OpenFileDialog();
            var b = openFileDialog.ShowDialog();

            if (b.HasValue && b.Value)
            {
                _currentOffset = 0;
                StoragePath    = openFileDialog.FileName;
                _bll           = _container.Resolve <IBLL>(new ResolverOverride[]
                {
                    new ParameterOverride("filePath", StoragePath)
                });
                var lst = _bll.GetFiltered("", 10, _currentOffset);
                PopulateFilteredList(lst);
            }
        }
예제 #4
0
        public MainWindowVM()
        {
            StoragePath = @"c:\tmp\1";
            _bll        = _container.Resolve <IBLL>(new ResolverOverride[]
            {
                new ParameterOverride("filePath", StoragePath)
            });
            var lst = _bll.GetFiltered();

            PopulateFilteredList(lst);

            SearchCommand        = new RelayCommand(DoSearch);
            SaveCommand          = new RelayCommand(DoSave);
            CancelCommand        = new RelayCommand(DoCancel);
            AddNoteCommand       = new RelayCommand(DoAddNote);
            AddWebUrlCommand     = new RelayCommand(DoAddWebUrl);
            AddCreditCardCommand = new RelayCommand(DoAddCreditCard);
            PrevCommand          = new RelayCommand(GetPrev);
            NextCommand          = new RelayCommand(GetNext);
            OpenCommand          = new RelayCommand(OpenStorage);
        }