Beispiel #1
0
            public void UpdateRow(ref ExcelRow excel_row, ref DataTable all_properties, ref DataTable data_table, string column_name_field, string column_value_field, bool is_white)
            {
                if ((excel_row != null) && (all_properties != null) && (data_table != null) && (column_name_field.Length > 0) && (column_value_field.Length > 0))
                {
                    foreach (DataRow _row in data_table.Rows)
                    {
                        if (_row != null)
                        {
                            string _column_name = _row[column_name_field].ToString();
                            excel_row.SetValue(_column_name, _row[column_value_field].ToString(), is_white);
                        };
                    };

                    foreach (DataRow _allrow in all_properties.Rows)
                    {
                        if (_allrow != null)
                        {
                            string _property_name = _allrow[column_name_field].ToString();
                            excel_row.SetValue(_property_name, "", is_white);
                        };
                    };
                };
            }
Beispiel #2
0
            public void UpdateRow(ref ExcelRow excel_row, ref DataTable data_table, ref DataRow data_row, bool is_white)
            {
                if ((excel_row != null) && (data_table != null) && (data_row != null))
                {
                    int column_count = data_table.Columns.Count;

                    for (int column_index = 0; column_index < column_count; column_index++)
                    {
                        string _column_name = data_table.Columns[column_index].ColumnName;

                        if (_column_filter.Length > 0)
                        {
                            if (_column_name.ToLower().Contains(_column_filter.ToLower()) && _column_name != "AssetGUID")
                                continue;
                        };

                        excel_row.SetValue(_column_name, data_row[column_index].ToString(), is_white);
                    };
                };
            }