Limpieza de codigo

This commit is contained in:
2013-10-14 20:20:23 +02:00
parent af72a4decb
commit b4eea3818f
22 changed files with 194 additions and 197 deletions

View File

@@ -10,8 +10,8 @@ namespace ServerExplorer
{
public class TablaDesc
{
public String Esquema="";
public String Nombre="";
public String Esquema = String.Empty;
public String Nombre = String.Empty;
public List<ColumnaDesc> Columnas = new List<ColumnaDesc>();
public TablaDesc() { }
@@ -56,11 +56,11 @@ namespace ServerExplorer
" col.TABLE_SCHEMA=@nombreEsquema " +
" order by col.ORDINAL_POSITION",
cnx);
prm=new SqlParameter("@nombreTabla",SqlDbType.VarChar,100);
prm.Value=nombre;
prm = new SqlParameter("@nombreTabla", SqlDbType.VarChar, 100);
prm.Value = nombre;
da.SelectCommand.Parameters.Add(prm);
prm=new SqlParameter("@nombreEsquema",SqlDbType.VarChar,100);
prm.Value=esquema;
prm = new SqlParameter("@nombreEsquema", SqlDbType.VarChar, 100);
prm.Value = esquema;
da.SelectCommand.Parameters.Add(prm);
// Obtener datatable con las columnas
@@ -76,8 +76,8 @@ namespace ServerExplorer
ColumnaDesc col;
// Obtener columna
col=GetCol((String)dr["Columna"]);
if (col==null)
col = GetCol((String)dr["Columna"]);
if (col == null)
{
col = new ColumnaDesc();
Columnas.Add(col);
@@ -115,8 +115,8 @@ namespace ServerExplorer
public class ColumnaDesc
{
public string Nombre = "";
public string Tipo = "";
public string Nombre = String.Empty;
public string Tipo = String.Empty;
public int Tamanho = -1;
public bool Primaria = false;
@@ -125,7 +125,7 @@ namespace ServerExplorer
private TipoCol tipo = TipoCol.Unset;
public TipoCol GetTipo()
{
string stipo=Tipo.ToLower();
string stipo = Tipo.ToLower();
if (this.tipo != TipoCol.Unset)
{
@@ -133,12 +133,12 @@ namespace ServerExplorer
}
// Numericos
if(
stipo=="bigint" ||
stipo=="int" ||
stipo=="smallint" ||
stipo=="tinyint" ||
stipo=="bigint"
if (
stipo == "bigint" ||
stipo == "int" ||
stipo == "smallint" ||
stipo == "tinyint" ||
stipo == "bigint"
)
{
return TipoCol.Numerico;
@@ -147,7 +147,7 @@ namespace ServerExplorer
// Aproximados numericos
if (
stipo == "float" ||
stipo == "real"
stipo == "real"
)
{
return TipoCol.AproxNumerico;
@@ -173,7 +173,7 @@ namespace ServerExplorer
stipo == "text" ||
stipo == "nchar" ||
stipo == "nvarchar" ||
stipo == "ntext"
stipo == "ntext"
)
{
return TipoCol.Texto;
@@ -183,7 +183,7 @@ namespace ServerExplorer
if (
stipo == "binary" ||
stipo == "varbinary" ||
stipo == "image"
stipo == "image"
)
{
return TipoCol.Binario;
@@ -191,7 +191,7 @@ namespace ServerExplorer
// Booleano
if (
stipo == "bit"
stipo == "bit"
)
{
return TipoCol.Booleano;