Exemple #1
0
        protected override string[] FormatExportRecord(object obj)
        {
            string[] objs = new string[this.PickHeadViewFieldList.Length];
            PickdetailmaterialQuery pickLine = obj as PickdetailmaterialQuery;
            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);
                if (fieldInfo != null)
                {
                    strValue = fieldInfo.GetValue(pickLine).ToString();
                }
                objs[i] = strValue;
            }
            return(objs);
        }
Exemple #2
0
        protected override DataRow GetGridRow(object obj)
        {
            DataRow row = this.DtSource.NewRow();

            PickdetailmaterialQuery pickLine = obj as PickdetailmaterialQuery;
            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);
                if (fieldInfo != null)
                {
                    strValue = fieldInfo.GetValue(pickLine).ToString();
                }
                row[i + 1] = strValue;
            }

            return(row);
        }