Exemplo n.º 1
0
        private void SetAccountSource()
        {
            SQLCache cache;

            switch (editrow._DCType)
            {
            case 1: cache = DebtorCache; break;

            case 2: cache = CreditorCache; break;

            case 3: cache = CrmProspectCache; break;

            case 4: cache = null; break;

            default: return;
            }
            editrow.accntSource = cache;
            editrow.NotifyPropertyChanged("AccountSource");
            editrow.NotifyPropertyChanged("DCAccount");
        }
Exemplo n.º 2
0
        private void SetAccountSource(ContactClient rec)
        {
            var cache = GetCache(rec._DCType);

            if (cache != null)
            {
                rec.accntSource = cache.GetNotNullArray;
                if (rec.accntSource != null)
                {
                    rec.NotifyPropertyChanged("AccountSource");
                }
            }
        }
Exemplo n.º 3
0
        private void DataControl_CurrentItemChanged(object sender, DevExpress.Xpf.Grid.CurrentItemChangedEventArgs e)
        {
            ContactClient oldSelectedItem = e.OldItem as ContactClient;

            if (oldSelectedItem != null)
            {
                oldSelectedItem.PropertyChanged -= ContactClient_PropertyChanged;
                var cache = GetCache(oldSelectedItem._DCType);
                if (cache != null && cache.Count > 1000)
                {
                    oldSelectedItem.accntSource = null;
                    oldSelectedItem.NotifyPropertyChanged("AccountSource");
                }
            }
            ContactClient selectedItem = e.NewItem as ContactClient;

            if (selectedItem != null)
            {
                selectedItem.PropertyChanged += ContactClient_PropertyChanged;
            }
        }