public void GetFirstResults() { if (IsMultiLab) { using (GetFacilitiesForMultiLab gffml = new GetFacilitiesForMultiLab()) { //Set the parameters using (DataView dv = new DataView(ThisSession.ChosenLabs)) gffml.ServiceList = dv.ToTable("ChosenLabs", true, new String[] { "ServiceID" }); gffml.Distance = "20"; gffml.Latitude = this.lat; gffml.Longitude = this.lng; gffml.OrderByField = "Distance"; gffml.OrderDirection = "ASC"; //Populate the object with data from the database gffml.GetData(); //If we got anything back and had no errors... if (!gffml.HasErrors && gffml.RowsBack > 0) { //If we've reached the end of the result set it even on the first pass lastResult = gffml.ReachedEnd; //Save the specific results for sorting and geocoding for when we leave the Using tblResults = gffml.RawResults; //Set the LearnMore table for use later learnMoreTable = gffml.LearnMoreResults; } } } else { if (!IsThin) { using (GetFacilitiesForService gffs = new GetFacilitiesForService()) { //Set the parameters gffs.ServiceID = ThisSession.ServiceID.ToString(); gffs.Latitude = this.lat; gffs.Longitude = this.lng; gffs.SpecialtyID = ThisSession.SpecialtyID.ToString(); gffs.Distance = "20"; gffs.OrderByField = "Distance"; gffs.OrderDirection = "ASC"; //gffs.MemberMedicalID = ThisSession.SubscriberMedicalID; gffs.CCHID = ThisSession.CCHID; gffs.UserID = Membership.GetUser().ProviderUserKey.ToString(); //Populate the object with data from the database gffs.GetData(); //Is this thin data or no? if (!gffs.DataIsThin) { //If we got anything back and had no errors... if (!gffs.HasErrors && gffs.RowsBack > 0) { //If we've reached the end of the result set it even on the first pass lastResult = gffs.ReachedEnd; //Save the specific results for sorting and geocoding for when we leave the Using tblResults = gffs.RawResults; //Set the LearnMore table for use later learnMoreTable = gffs.LearnMoreResults; } } else { IsThin = true; } } } if (IsThin) { using (GetThinDataResults gtdr = new GetThinDataResults()) { //Set the parameters gtdr.ZipCode = ThisSession.PatientZipCode; gtdr.ServiceID = ThisSession.ServiceID.ToString(); gtdr.Latitude = this.lat; gtdr.Longitude = this.lng; gtdr.SpecialtyId = ThisSession.SpecialtyID.ToString(); //Populate the object with data from the database gtdr.GetData(); if (gtdr.HasErrors && gtdr.RowsBack > 0) { lastResult = gtdr.ReachedEnd; tblResults = gtdr.RawResults; } } } } //Prepare the result buffer to begin with a clean slate if (tblResults != null && tblResults.Rows.Count > 0) if (resultBuffer == null) resultBuffer = tblResults.Clone(); else resultBuffer.Clear(); }
public void GetFirstResults() { if (IsMultiLab) { using (GetFacilitiesForMultiLab gffml = new GetFacilitiesForMultiLab()) { //Set the parameters using (DataView dv = new DataView(ThisSession.ChosenLabs)) gffml.ServiceList = dv.ToTable("ChosenLabs", true, new String[] { "ServiceID" }); gffml.Distance = "20"; gffml.Latitude = this.lat; gffml.Longitude = this.lng; gffml.OrderByField = "Distance"; gffml.OrderDirection = "ASC"; //Populate the object with data from the database gffml.GetData(); //If we got anything back and had no errors... if (!gffml.HasErrors && gffml.RowsBack > 0) { //If we've reached the end of the result set it even on the first pass lastResult = gffml.ReachedEnd; //Save the specific results for sorting and geocoding for when we leave the Using tblResults = gffml.RawResults; //Set the LearnMore table for use later learnMoreTable = gffml.LearnMoreResults; } } } else { if (!IsThin) { using (GetFacilitiesForService gffs = new GetFacilitiesForService()) { //Set the parameters gffs.ServiceID = ThisSession.ServiceID.ToString(); gffs.Latitude = this.lat; gffs.Longitude = this.lng; gffs.SpecialtyID = ThisSession.SpecialtyID.ToString(); gffs.Distance = "20"; gffs.OrderByField = "Distance"; gffs.OrderDirection = "ASC"; //gffs.MemberMedicalID = ThisSession.SubscriberMedicalID; gffs.CCHID = ThisSession.CCHID; gffs.UserID = Membership.GetUser().ProviderUserKey.ToString(); //Populate the object with data from the database gffs.GetData(); //Is this thin data or no? if (!gffs.DataIsThin) { //If we got anything back and had no errors... if (!gffs.HasErrors && gffs.RowsBack > 0) { //If we've reached the end of the result set it even on the first pass lastResult = gffs.ReachedEnd; //Save the specific results for sorting and geocoding for when we leave the Using tblResults = gffs.RawResults; //Set the LearnMore table for use later learnMoreTable = gffs.LearnMoreResults; } } else { IsThin = true; } } } if (IsThin) { using (GetThinDataResults gtdr = new GetThinDataResults()) { //Set the parameters gtdr.ZipCode = ThisSession.PatientZipCode; gtdr.ServiceID = ThisSession.ServiceID.ToString(); gtdr.Latitude = this.lat; gtdr.Longitude = this.lng; gtdr.SpecialtyId = ThisSession.SpecialtyID.ToString(); //Populate the object with data from the database gtdr.GetData(); if (gtdr.HasErrors && gtdr.RowsBack > 0) { lastResult = gtdr.ReachedEnd; tblResults = gtdr.RawResults; } } } } //Prepare the result buffer to begin with a clean slate if (tblResults != null && tblResults.Rows.Count > 0) { if (resultBuffer == null) { resultBuffer = tblResults.Clone(); } else { resultBuffer.Clear(); } } }