/// <summary> /// Finds DataTableRef within CompanyDataEnumerationCollection /// </summary> /// <param name="DataTableRef"></param> /// <returns></returns> public CompanyDataEnumerationCollection <T> Find(int dataTableRef) { if (this != null && dataTableRef != Null.Integer) { CompanyDataEnumerationCollection <T> tempColl = new CompanyDataEnumerationCollection <T>(); foreach (T obj in this) { if (obj.DataTableRef == dataTableRef) { tempColl.Add(obj); } } return(tempColl); } return(null); }
/// <summary> /// Finds DataItemCode within CompanyDataEnumerationCollection /// </summary> /// <param name="DataTableRef"></param> /// <returns></returns> public CompanyDataEnumerationCollection <T> Find(string dataItemCode) { if (this != null && dataItemCode != Null.String) { CompanyDataEnumerationCollection <T> tempColl = new CompanyDataEnumerationCollection <T>(); foreach (T obj in this) { if (obj.DataItemCode == dataItemCode || obj.DataItemCode.ToUpper() == dataItemCode.ToUpper()) { tempColl.Add(obj); } } return(tempColl); } return(null); }
/// <summary> /// Returns CompanyDataEnumerationCollection for given CompanyRef /// </summary> public CompanyDataEnumerationCollection <T> this[int CompanyRef] { get { if (CompanyRef != Null.Integer || !CompanyRef.Equals(null)) { CompanyDataEnumerationCollection <T> tempColl = new CompanyDataEnumerationCollection <T>(); foreach (T obj in this) { if (obj.CompanyUnitRef == CompanyRef) { tempColl.Add(obj); } } return(tempColl); } return(null); } }