private void FindByItem(string type) { if (!string.IsNullOrEmpty(_lastQuery) && !string.IsNullOrEmpty(txtFind.Text) && txtFind.Text.StartsWith(_lastQuery)) { DefaultFindAction(); } else { _availableRefs.Clear(); var results = _conn.Apply(@"<Item type='@0' action='get' maxRecords='1000' orderBy='keyed_name' select='id,source_id,related_id'> <keyed_name condition='like'>@1</keyed_name> </Item>" , type, "*" + txtFind.Text + "*").Items(); if (results.Count() >= 1000) { _availableRefs.Add(_searchMessage); } else { foreach (var result in results) { _availableRefs.Add(ItemReference.FromFullItem(result, true)); } _lastQuery = txtFind.Text; } } }
private void FindByItem(string type) { if (!string.IsNullOrEmpty(_lastQuery) && !string.IsNullOrEmpty(txtFind.Text) && txtFind.Text.StartsWith(_lastQuery)) { DefaultFindAction(); } else { _availableRefs.Clear(); var results = _conn.GetItems("ApplyAML", string.Format(Properties.Resources.Aml_ItemGet, type, "<keyed_name condition=\"like\">*" + txtFind.Text + "*</keyed_name>")); if (results.Count() >= 1000) { _availableRefs.Add(_searchMessage); } else { foreach (var result in results) { _availableRefs.Add(ItemReference.FromFullItem(result, true)); } _lastQuery = txtFind.Text; } } }
private void SelectItems() { foreach (var itemRef in GetSelected(gridAvailable)) { _selectedRefs.Add(itemRef); _availableRefs.Remove(itemRef); } }