protected override string[] FormatExportRecord(object obj) { string[] objs = new string[this.PickHeadViewFieldList.Length]; SAPInvoicesDetail pickLine = obj as SAPInvoicesDetail; Type type = pickLine.GetType(); for (int i = 0; i < this.PickHeadViewFieldList.Length; i++) { ViewField field = this.PickHeadViewFieldList[i]; string strValue = string.Empty; System.Reflection.FieldInfo fieldInfo = type.GetField(field.FieldName.ToUpper()); if (fieldInfo != null) { strValue = fieldInfo.GetValue(pickLine).ToString(); } objs[i] = strValue; } return(objs); }
protected override DataRow GetGridRow(object obj) { DataRow row = this.DtSource.NewRow(); SAPInvoicesDetail pickLine = obj as SAPInvoicesDetail; Type type = pickLine.GetType(); for (int i = 0; i < this.PickHeadViewFieldList.Length; i++) { ViewField field = this.PickHeadViewFieldList[i]; string strValue = string.Empty; System.Reflection.FieldInfo fieldInfo = type.GetField(field.FieldName.ToUpper()); if (fieldInfo != null) { strValue = fieldInfo.GetValue(pickLine).ToString(); } row[i + 1] = strValue; } return(row); }