private static CurrentItem ExtractItemFromDataSet(CurrentItemsCollection row, object data) { CurrentItem currentItem = null; if (data != null) { currentItem = row.Find(data.ToString()); } else { currentItem = row.Find(row[0].ColumnName); } return(currentItem); }
private List <object> SetupDataSource(object data, IDataNavigator navigator) { navigator.Reset(); List <object> list = new List <object>(); while (navigator.MoveNext()) { CurrentItemsCollection row = navigator.GetDataRow(); CurrentItem ci = null; if (data != null) { ci = row.Find(data.ToString()); } else { ci = row.Find(row[0].ColumnName); } // s1 = Convert.ToString(row.Find(data.ToString()).Value.ToString(),CultureInfo.CurrentCulture); if (ci != null) { object s1 = Convert.ToString(ci.Value.ToString(), CultureInfo.CurrentCulture); if (IsNumeric(s1)) { list.Add(Convert.ToDouble(s1, System.Globalization.CultureInfo.CurrentCulture)); } else { list.Add(true); } } else { string str = String.Format("<{0}> not found in AggregateFunction", data.ToString()); throw new FieldNotFoundException(str); } // s1 = Convert.ToString(ci.Value.ToString(),CultureInfo.CurrentCulture); // // // if (IsNumeric(s1)) { // list.Add(Convert.ToDouble(s1,System.Globalization.CultureInfo.CurrentCulture)); // } else { // list.Add(true); // } } return(list); }