/// <summary> /// This function gets the list of errors and the open sample description with its correspondant attributes /// </summary> /// <param name="sampleId"></param> /// <returns>returns the list of attributes and the details of the sample</returns> public OpenSampleAttributeResponseObject ProcessGetOpenSampleAttributes(string sampleList) { try { ISam samServiceCall = new Sam(); XDocument serviceResponse = samServiceCall.GetOpenSampleAttributes(sampleList); OpenSampleAttributeResponseObject openSampleAttributeResponse = new OpenSampleAttributeResponseObject(); openSampleAttributeResponse.OpenSampleAttributeList = new List<OpenSampleObject>(); openSampleAttributeResponse.ServiceErrorList = samServiceCall.GetServiceErrors(serviceResponse); //If no error were returned get the list of attributes with the details of the sample if (openSampleAttributeResponse.ServiceErrorList.Count() == 0) { openSampleAttributeResponse.OpenSampleAttributeList = samServiceCall.GetOpenSampleAttributeResponse(serviceResponse); } return openSampleAttributeResponse; } catch { throw; } }
/// <summary> /// This function gets the list of errors and the list of Open samples and returns the list of open samples /// </summary> /// <param name="studyId"></param> /// <returns>List of open samples. If there's an error return empty list.</returns> public MainstreamStudySampleResponseObject ProcessGetMainstreamStudySample(int studyId) { ISam samServiceCall = new Sam(); XDocument serviceResponse = samServiceCall.GetMainstreamStudySamples(studyId); MainstreamStudySampleResponseObject mainstreamStudySampleResponse = new MainstreamStudySampleResponseObject(); mainstreamStudySampleResponse.MainstreamStudySamples = new List<MainstreamStudySampleObject>(); mainstreamStudySampleResponse.Errors = samServiceCall.GetServiceErrors(serviceResponse); //If no error were returned get the list of open samples if (mainstreamStudySampleResponse.Errors.Count() == 0) { mainstreamStudySampleResponse.MainstreamStudySamples = samServiceCall.GetMainstreamStudySampleResponse(serviceResponse); } return mainstreamStudySampleResponse; }