public override void Start() { _availableProcedureTypes = new ProcedureTypeSummaryTable(); _selectedProcedureTypes = new ProcedureTypeSummaryTable(); Platform.GetService <IDiagnosticServiceAdminService>( service => { var formDataResponse = service.LoadDiagnosticServiceEditorFormData(new LoadDiagnosticServiceEditorFormDataRequest()); _availableProcedureTypes.Items.AddRange(formDataResponse.ProcedureTypeChoices); if (_isNew) { _editedItemDetail = new DiagnosticServiceDetail(); } else { var response = service.LoadDiagnosticServiceForEdit(new LoadDiagnosticServiceForEditRequest(_editedItemEntityRef)); _editedItemDetail = response.DiagnosticService; _selectedProcedureTypes.Items.AddRange(_editedItemDetail.ProcedureTypes); } foreach (var selectedSummary in _selectedProcedureTypes.Items) { _availableProcedureTypes.Items.Remove(selectedSummary); } }); base.Start(); }
public void UpdateDiagnosticService(DiagnosticService ds, DiagnosticServiceDetail detail, IPersistenceContext context) { ds.Id = detail.Id; ds.Name = detail.Name; ds.Deactivated = detail.Deactivated; ds.ProcedureTypes.Clear(); ds.ProcedureTypes.AddAll( detail.ProcedureTypes.Select(pt => context.Load <ProcedureType>(pt.ProcedureTypeRef, EntityLoadFlags.Proxy)).ToList()); }
/// <summary> /// Called to handle the "toggle activation" action, if supported /// </summary> /// <param name="items">A list of items to edit.</param> /// <param name="editedItems">The list of items that were edited.</param> /// <returns>True if items were edited, false otherwise.</returns> protected override bool UpdateItemsActivation(IList <DiagnosticServiceSummary> items, out IList <DiagnosticServiceSummary> editedItems) { List <DiagnosticServiceSummary> results = new List <DiagnosticServiceSummary>(); foreach (DiagnosticServiceSummary item in items) { Platform.GetService <IDiagnosticServiceAdminService>( delegate(IDiagnosticServiceAdminService service) { DiagnosticServiceDetail detail = service.LoadDiagnosticServiceForEdit( new LoadDiagnosticServiceForEditRequest(item.DiagnosticServiceRef)).DiagnosticService; detail.Deactivated = !detail.Deactivated; DiagnosticServiceSummary summary = service.UpdateDiagnosticService( new UpdateDiagnosticServiceRequest(detail)).DiagnosticService; results.Add(summary); }); } editedItems = results; return(true); }
public UpdateDiagnosticServiceRequest(DiagnosticServiceDetail detail) { this.DiagnosticService = detail; }
public AddDiagnosticServiceRequest(DiagnosticServiceDetail detail) { this.DiagnosticService = detail; }
public LoadDiagnosticServiceForEditResponse(DiagnosticServiceDetail detail) { this.DiagnosticService = detail; }