Пример #1
0
        void DataControl_CurrentItemChanged(object sender, DevExpress.Xpf.Grid.CurrentItemChangedEventArgs e)
        {
            JournalLineGridClient oldselectedItem = e.OldItem as JournalLineGridClient;

            if (oldselectedItem != null)
            {
                oldselectedItem.PropertyChanged -= JournalLineGridClient_PropertyChanged;
                var Cache = GetCache(oldselectedItem._AccountType);
                if (Cache != null && Cache.Count > 1000)
                {
                    oldselectedItem.accntSource = null;
                    oldselectedItem.NotifyPropertyChanged("AccountSource");
                }
                Cache = GetCache(oldselectedItem._OffsetAccountType);
                if (Cache != null && Cache.Count > 1000)
                {
                    oldselectedItem.offsetAccntSource = null;
                    oldselectedItem.NotifyPropertyChanged("OffsetAccountSource");
                }
            }
            JournalLineGridClient selectedItem = e.NewItem as JournalLineGridClient;

            if (selectedItem != null)
            {
                selectedItem.PropertyChanged += JournalLineGridClient_PropertyChanged;
            }
        }
Пример #2
0
        private void SetOffsetAccountSource(JournalLineGridClient rec)
        {
            var      act   = rec._OffsetAccountType;
            SQLCache cache = GetCache(act);

            if (cache != null)
            {
                int ver = cache.version + 10000 * (act + 1);
                if (ver != rec.OffsetAccountVersion || rec.offsetAccntSource == null)
                {
                    if (act == (byte)GLJournalAccountType.Finans)
                    {
                        rec.offsetAccntSource = new UnicontaClient.Pages.GLDailyJournalLine.LedgerSQLCacheFilter(cache);
                    }
                    else
                    {
                        rec.offsetAccntSource = cache.GetNotNullArray;
                    }
                    if (rec.offsetAccntSource != null)
                    {
                        rec.OffsetAccountVersion = ver;
                        rec.NotifyPropertyChanged("OffsetAccountSource");
                    }
                }
            }
        }