public String GetWeeklyOneProviderReport([FromUri] int providerID) { String result = ""; //0: success, 1: member is null, 2: serveList List <ProviderReport> providerReports = null; try { providerReports = new List <ProviderReport>(); Provider provider = providerList.GetProvider(providerID); if (provider != null) { result = "----------------------Provider Report--------------------<br />"; result += "Provider ID: " + provider.ID + "<br />"; result += "Provider Name: " + provider.Name + "<br />"; result += "City: " + provider.City + "<br />"; result += "State: " + provider.State + "<br />"; result += "Street Address: " + provider.StreetAddress + "<br />"; result += "Zip Code: " + provider.ZipCode + "<br />"; List <ServiceRecord> serveList = serviceRecordList.GetAllServiceRecordForProvider(provider.ID); if (serveList != null) { int counter = 0; foreach (ServiceRecord s in serveList) { counter++; int serviceCode = s.ServiceCode; Service service = providerDirectory.GetService(serviceCode); if (service != null) { result += "<br />Service:" + counter + "<br />"; result += "Service Name: " + service.ServiceName + "<br />"; result += "Service Code: " + service.ServiceCode + "<br />"; result += "Service Fee: " + service.ServiceFee + "<br />"; } result += "<br/>-------------------------------<br/>"; } } else { result += "<br />serveList is null<br />"; } } else { result += "<br />provider is null<br />"; } } catch (Exception e) { providerReports = null; throw new HttpResponseException( Request.CreateErrorResponse(HttpStatusCode.BadRequest, e.Message)); } return(result); }
public string ValidateProvider([FromUri] int providerID) { var provider = providerList.GetProvider(providerID); if (provider == null) { return("Invalid!"); } else { return("Validate!"); } }