private void SalvaColunasExportador() { mdlDataBaseAccess.Tabelas.XsdTbExportadoresColunas typDatSetColunas = this.ExportadoresColunas; //Deleting for (int i = typDatSetColunas.tbExportadoresColunas.Rows.Count - 1; i >= 0; i--) { typDatSetColunas.tbExportadoresColunas[i].Delete(); } for (int i = 0; i < this.Count; i++) { clsColuna coluna = this[i]; if (coluna.Posicao <= 0) { continue; } mdlDataBaseAccess.Tabelas.XsdTbExportadoresColunas.tbExportadoresColunasRow dtrwColuna = typDatSetColunas.tbExportadoresColunas.NewtbExportadoresColunasRow(); dtrwColuna.nIdExportador = m_nIdExportador; dtrwColuna.nIdColuna = coluna.Posicao; dtrwColuna.strNome = coluna.Nome; dtrwColuna.nTamanho = coluna.Tamanho; typDatSetColunas.tbExportadoresColunas.AddtbExportadoresColunasRow(dtrwColuna); } m_cls_dba_ConnectionDB.SetTbExportadoresColunas(typDatSetColunas); m_typDatSetExportadoresColunas = null; }
private void CarregaColunasExportador() { SetTodasColunasDisponiveis(); mdlDataBaseAccess.Tabelas.XsdTbExportadoresColunas typDatSetColunas = this.ExportadoresColunas; if (typDatSetColunas.tbExportadoresColunas.Rows.Count == 0) { CarregaColunasDefault(); SalvaColunasExportador(); } else { for (int i = 0; i < typDatSetColunas.tbExportadoresColunas.Rows.Count; i++) { mdlDataBaseAccess.Tabelas.XsdTbExportadoresColunas.tbExportadoresColunasRow dtrwColuna = typDatSetColunas.tbExportadoresColunas[i]; this.SetPosicao(dtrwColuna.strNome, dtrwColuna.nIdColuna, true); this.SetTamanho(dtrwColuna.strNome, dtrwColuna.nTamanho); } this.RemoveLacunas(); } }