Limpieza de codigo
This commit is contained in:
@@ -13,9 +13,9 @@ using System.Threading;
|
||||
|
||||
namespace ServerExplorer
|
||||
{
|
||||
public partial class frmBaseDatos : Form
|
||||
public partial class FrmBaseDatos : Form
|
||||
{
|
||||
private frmBaseDatos instancia;
|
||||
private FrmBaseDatos instancia;
|
||||
private SqlConnection cnx;
|
||||
private Config config;
|
||||
private String table_schema = null;
|
||||
@@ -67,7 +67,7 @@ namespace ServerExplorer
|
||||
// en le listview desde la configuracion
|
||||
private void tablas_alistview()
|
||||
{
|
||||
int i,j,n;
|
||||
int i, j, n;
|
||||
|
||||
// Desmarcar todos en caso de no haber ninguna tabla
|
||||
if (config.Tablas.Count == 0)
|
||||
@@ -78,26 +78,27 @@ namespace ServerExplorer
|
||||
}
|
||||
|
||||
// Recorrer items marcando los que estan en la configuracion
|
||||
n=config.Tablas.Count;
|
||||
i=j=0;
|
||||
n = config.Tablas.Count;
|
||||
i = j = 0;
|
||||
foreach (ListViewItem item in lsvTablas.Items)
|
||||
{
|
||||
item.Checked = false;
|
||||
String tablename =
|
||||
item.SubItems[1].Text + // Esquema
|
||||
item.SubItems[0].Text; // Nombre tabla
|
||||
do{
|
||||
if( config.Tablas[i].Esquema.
|
||||
do
|
||||
{
|
||||
if (config.Tablas[i].Esquema.
|
||||
CompareTo(item.SubItems[1].Text) == 0 &&
|
||||
config.Tablas[i].Nombre.
|
||||
CompareTo(item.SubItems[0].Text) == 0)
|
||||
{
|
||||
item.Checked=true;
|
||||
item.Checked = true;
|
||||
break;
|
||||
}
|
||||
i=(i+1)%n;
|
||||
}while(i!=j);
|
||||
j=i;
|
||||
i = (i + 1) % n;
|
||||
} while (i != j);
|
||||
j = i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +115,7 @@ namespace ServerExplorer
|
||||
return (db);
|
||||
}
|
||||
|
||||
public frmBaseDatos(String ConString)
|
||||
public FrmBaseDatos(String ConString)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -123,7 +124,7 @@ namespace ServerExplorer
|
||||
config.ConString = ConString;
|
||||
}
|
||||
|
||||
public frmBaseDatos(Config config)
|
||||
public FrmBaseDatos(Config config)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -156,11 +157,11 @@ namespace ServerExplorer
|
||||
ListViewItem item = lsvTablas.SelectedItems[0];
|
||||
|
||||
// Recordar tabla seleccionada
|
||||
table_schema=item.SubItems[1].Text.ToString();
|
||||
table_schema = item.SubItems[1].Text.ToString();
|
||||
table_name = item.SubItems[0].Text.ToString();
|
||||
|
||||
// Establecer titulo de la lista de columnas
|
||||
lblTituloTabla.Text=table_schema+"."+table_name;
|
||||
lblTituloTabla.Text = table_schema + "." + table_name;
|
||||
|
||||
// Obtener descripcion de tabla
|
||||
TablaDesc td = new TablaDesc();
|
||||
@@ -172,7 +173,7 @@ namespace ServerExplorer
|
||||
{
|
||||
ListViewItem subitem = lsvColumnas.Items.Add(col.Nombre);
|
||||
subitem.SubItems.Add(col.Tipo);
|
||||
if (col.Tamanho>=0)
|
||||
if (col.Tamanho >= 0)
|
||||
{
|
||||
subitem.SubItems.Add(String.Format("{0}", col.Tamanho));
|
||||
}
|
||||
@@ -215,11 +216,10 @@ namespace ServerExplorer
|
||||
private void menuConfiguracion_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Llamar a la ventana de configuracion
|
||||
frmCodeGenConfig frm = new frmCodeGenConfig(config);
|
||||
FrmCodeGenConfig frm = new FrmCodeGenConfig(config);
|
||||
frm.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
private void btnVerDatos_Click(object sender, EventArgs e)
|
||||
{
|
||||
String nombreTabla;
|
||||
@@ -228,7 +228,7 @@ namespace ServerExplorer
|
||||
|
||||
if (table_schema == null || table_name == null) { return; }
|
||||
|
||||
nombreTabla="["+table_schema+"].["+table_name+"]";
|
||||
nombreTabla = "[" + table_schema + "].[" + table_name + "]";
|
||||
|
||||
// Obtener un datatable con todos los registros de la tabla.
|
||||
da = new SqlDataAdapter(
|
||||
@@ -240,7 +240,7 @@ namespace ServerExplorer
|
||||
cnx.Close();
|
||||
|
||||
// Crear y mostrar el formulario de los datos.
|
||||
frmDatos form = new frmDatos(dt, nombreTabla);
|
||||
FrmDatos form = new FrmDatos(dt, nombreTabla);
|
||||
form.MdiParent = this.MdiParent;
|
||||
form.Show();
|
||||
|
||||
@@ -267,7 +267,7 @@ namespace ServerExplorer
|
||||
form.Show();*/
|
||||
|
||||
// Crear y mostrar el formulario de los procedimientos.
|
||||
frmProcedimientos form = new frmProcedimientos(config.ConString);
|
||||
FrmProcedimientos form = new FrmProcedimientos(config.ConString);
|
||||
form.MdiParent = this.MdiParent;
|
||||
form.Show();
|
||||
}
|
||||
@@ -275,7 +275,7 @@ namespace ServerExplorer
|
||||
private void btnExec_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Crear y mostrar el formulario de exec.
|
||||
frmExec form = new frmExec(config.ConString);
|
||||
FrmExec form = new FrmExec(config.ConString);
|
||||
form.MdiParent = this.MdiParent;
|
||||
form.Show();
|
||||
}
|
||||
@@ -285,6 +285,7 @@ namespace ServerExplorer
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void btnGenerar_Click(object sender, EventArgs e)
|
||||
{
|
||||
tablas_delistview();
|
||||
@@ -317,6 +318,7 @@ namespace ServerExplorer
|
||||
hilo.Start();
|
||||
*/
|
||||
}
|
||||
|
||||
public void GenerarDoc()
|
||||
{
|
||||
// Hacer insensible la ventana
|
||||
@@ -336,6 +338,5 @@ namespace ServerExplorer
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user