Example #1
0
        public LookupToFirmViewModel()
        {
            CurrentFirmaWraperDest = new FirmModelWraper(ConfigTempoSinglenton.GetInstance().CurrentFirma);
            _fn = CurrentFirmaWraperDest.Name;
            //_allFirms = new ObservableCollection<FirmModelWraper>();
            //foreach (var item in Context.GetAllFirma())
            //{
            //    _allFirms.Add(new FirmModelWraper(item));
            //}
            //if (_allFirms.Count > 0) CurrentFirmaWraperSource = _allFirms[0];


            this._Lookups = new ObservableCollection <LookUpMetaData>(Context.GetAllLookups(""));
            if (this._Lookups != null)
            {
                Lookup = _Lookups.Count > 0 ? _Lookups[0] : null;
                //this.CalculateFields();
            }

            Mappings = new ObservableCollection <ObservableCollection <string> >(Context.GetAllSearches());
        }
        public CopyLookupFromFirmToFirmViewModel()
            : base()
        {
            CurrentFirmaWraperDest = new FirmModelWraper(ConfigTempoSinglenton.GetInstance().CurrentFirma);
            _allFirms = new ObservableCollection <FirmModelWraper>();
            foreach (var item in context.GetAllFirma().Where(e => e.Id != CurrentFirmaWraperDest.Id))
            {
                _allFirms.Add(new FirmModelWraper(item));
            }
            if (_allFirms.Count > 0)
            {
                CurrentFirmaWraperSource = _allFirms[0];
            }
            CopyCommand = new DelegateCommand((o) => this.CopyFirmToFirm(), (o) => this.CanCopyFirmToFirm());

            this._Lookups = new ObservableCollection <LookUpMetaData>(context.GetAllLookups(""));
            if (this._Lookups != null)
            {
                _Lookup = _Lookups.Count > 0 ? _Lookups[0] : null;
                this.CalculateFields();
            }
        }