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"); }
private void SetAccountSource(ContactClient rec) { var cache = GetCache(rec._DCType); if (cache != null) { rec.accntSource = cache.GetNotNullArray; if (rec.accntSource != null) { rec.NotifyPropertyChanged("AccountSource"); } } }
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; } }