/** * The model told us the general tab data is loaded, so tell the view to render it. * Pass the fields instead of the entity to reduce coupling. */ private void OnGeneralTabLoaded(OrganizationGeneralInfo generalInfo) { _view.LoadGeneralTab ( generalInfo.Name, generalInfo.Description, generalInfo.Email, generalInfo.Website, generalInfo.NumMembers, generalInfo.NumCalls ); }
/** * Given an organization id, get its tabs and retrieve the complete data for each of them * Fire an event for each one to notify the presenter that they are ready to render */ public async Task LoadTabs(int orgId) { TabList tabs = await _esdService.GetTabs(orgId); foreach (Tab tab in tabs.Tabs) { if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.EQUIPMENT)) { _equipmentList = await _esdService.GetOrganizationEquipment(orgId); EquipmentTabLoaded?.Invoke(); } else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.FACILITIES)) { _facilityList = await _esdService.GetOrganizationFacilities(orgId); FacilityTabLoaded?.Invoke(); } else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.GENERAL)) { OrganizationGeneralInfo generalInfo = await _esdService.GetOrganizationGeneralInfo(orgId); GeneralTabLoaded?.Invoke(generalInfo); } else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.LOCATIONS)) { _locationList = await _esdService.GetOrganizationLocations(orgId); LocationTabLoaded?.Invoke(); } else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.PEOPLE)) { _peopleList = await _esdService.GetOrganizationPeople(orgId); PeopleTabLoaded?.Invoke(); } else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.PHYSICIANS)) { _physicianList = await _esdService.GetOrganizationPhysicians(orgId); PhysiciansTabLoaded?.Invoke(); } else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.TRAINING)) { _trainingList = await _esdService.GetOrganizationTrainings(orgId); TrainingTabLoaded?.Invoke(); } else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.TREATMENT)) { _treatmentList = await _esdService.GetOrganizationTreatments(orgId); TreatmentTabLoaded?.Invoke(); } } }