public static SupportingDataRequestCollection Populate(DataTable collectionMembers) { SupportingDataRequestCollection colRequests = new SupportingDataRequestCollection(); foreach (DataRow drMember in collectionMembers.Rows) { colRequests.Add((eWMSourceSystem)Enum.Parse(typeof(eWMSourceSystem), drMember["WMSourceSystem"].ToString())); } return colRequests; }
public void Populate(DataSet jobReferences) { // Note. Ordering of return sets to match FieldData SP selUserWork if (jobReferences != null && jobReferences.Tables.Count > 0) { // New if (jobReferences.Tables[0].Rows.Count > 0) { mColNew = new JobReferenceCollection(); foreach (DataRow drJob in jobReferences.Tables[0].Rows) { mColNew.Add(JobReference.Create(drJob,true)); } } // Removed if (jobReferences.Tables.Count > 1 && jobReferences.Tables[1].Rows.Count > 0) { mColRemoved = new JobReferenceCollection(); foreach (DataRow drJob in jobReferences.Tables[1].Rows) { mColRemoved.Add(JobReference.Create(drJob, true)); } } // Modified if (jobReferences.Tables.Count > 2 && jobReferences.Tables[2].Rows.Count > 0) { mColModified = new JobReferenceCollection(); foreach (DataRow drJob in jobReferences.Tables[2].Rows) { mColModified.Add(JobReference.Create(drJob, true)); } } // Supporing Data if (jobReferences.Tables.Count > 3 && jobReferences.Tables[3].Rows.Count > 0) { mColSupportingDataRequests = SupportingDataRequestCollection.Populate(jobReferences.Tables[3]); } } }