using System; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Media; using BeWo.ServiceProxy; using BS.Shared.DataContracts.Compact; namespace BeWo.View.Search { public class OrganisationSearchView : GenericSearchView { public OrganisationSearchView() { if (!DesignerProperties.GetIsInDesignMode(this)) { this.ThemeColor = this.FindResource("OrganisationContentBrush") as Brush; } } protected override void GetAll(Action> pCallBack) { if (this.SearchMode == SearchMode.CostBearer) { ServiceFacade.DoCustomerServiceAsync( s => s.GetAllCostBearerCompact(), r => { r.Sort((x, y) => { return x.Name.CompareTo(y.Name); }); pCallBack(r); }); } else if (this.SearchMode == SearchMode.OnlyValidGkvOrganisations) { ServiceFacade.DoCustomerServiceAsync( s => s.GetAllGkvValidOrganisationsCompact(), r => { r.Sort((x, y) => { return x.Name.CompareTo(y.Name); }); pCallBack(r); }); } else { ServiceFacade.DoCustomerServiceAsync( s => s.GetAllActiveOrganisationsCompact(), r => { r.Sort((x, y) => { return x.Name.CompareTo(y.Name); }); pCallBack(r); }); } } } }