Miscellaneous changes. Keep original end of line characters.

This commit is contained in:
2015-06-07 01:52:30 +02:00
parent ae8ce4a213
commit 7983598bbe
43 changed files with 4038 additions and 3839 deletions

View File

@@ -1,395 +1,395 @@
namespace ServerExplorer.UI
{
partial class FrmBaseDatos
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblConString = new System.Windows.Forms.Label();
this.btnCopiarConString = new System.Windows.Forms.Button();
this.menuBaseDatos = new System.Windows.Forms.MenuStrip();
this.archivoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuCargar = new System.Windows.Forms.ToolStripMenuItem();
this.menuGuardar = new System.Windows.Forms.ToolStripMenuItem();
this.menuConfiguracion = new System.Windows.Forms.ToolStripMenuItem();
this.btnGenerar = new System.Windows.Forms.Button();
this.btnVerDatos = new System.Windows.Forms.Button();
this.lblTituloTabla = new System.Windows.Forms.Label();
this.lblTituloDB = new System.Windows.Forms.Label();
this.btnDocGen = new System.Windows.Forms.Button();
this.btnProcs = new System.Windows.Forms.Button();
this.btnExec = new System.Windows.Forms.Button();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnRefresh = new System.Windows.Forms.Button();
this.lsvTablas = new ServerExplorer.Controls.CustomListView();
this.colNombreTabla = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colEsquema = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colTipo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lsvColumnas = new ServerExplorer.Controls.CustomListView();
this.colNombreColumna = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colTipoDatos = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colTamanho = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colClave = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colNullable = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.txtConString = new ServerExplorer.Controls.CustomTextBox();
this.menuBaseDatos.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// lblConString
//
this.lblConString.AutoSize = true;
this.lblConString.Location = new System.Drawing.Point(9, 9);
this.lblConString.Name = "lblConString";
this.lblConString.Size = new System.Drawing.Size(105, 13);
this.lblConString.TabIndex = 1;
this.lblConString.Text = "Cadena de conexion";
//
// btnCopiarConString
//
this.btnCopiarConString.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCopiarConString.Location = new System.Drawing.Point(742, 4);
this.btnCopiarConString.Name = "btnCopiarConString";
this.btnCopiarConString.Size = new System.Drawing.Size(52, 23);
this.btnCopiarConString.TabIndex = 3;
this.btnCopiarConString.Text = "Copiar";
this.btnCopiarConString.UseVisualStyleBackColor = true;
this.btnCopiarConString.Click += new System.EventHandler(this.btnCopiarConString_Click);
//
// menuBaseDatos
//
this.menuBaseDatos.Dock = System.Windows.Forms.DockStyle.None;
this.menuBaseDatos.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.archivoToolStripMenuItem,
this.menuConfiguracion});
this.menuBaseDatos.Location = new System.Drawing.Point(7, 195);
this.menuBaseDatos.Name = "menuBaseDatos";
this.menuBaseDatos.Size = new System.Drawing.Size(195, 24);
this.menuBaseDatos.TabIndex = 9;
this.menuBaseDatos.Text = "menuBaseDatos";
this.menuBaseDatos.Visible = false;
this.menuBaseDatos.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.menuBaseDatos_ItemClicked);
//
// archivoToolStripMenuItem
//
this.archivoToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuCargar,
this.menuGuardar});
this.archivoToolStripMenuItem.Name = "archivoToolStripMenuItem";
this.archivoToolStripMenuItem.Size = new System.Drawing.Size(92, 20);
this.archivoToolStripMenuItem.Text = "Base de Datos";
//
// menuCargar
//
this.menuCargar.Name = "menuCargar";
this.menuCargar.Size = new System.Drawing.Size(116, 22);
this.menuCargar.Text = "Cargar";
this.menuCargar.Click += new System.EventHandler(this.menuCargar_Click);
//
// menuGuardar
//
this.menuGuardar.Name = "menuGuardar";
this.menuGuardar.Size = new System.Drawing.Size(116, 22);
this.menuGuardar.Text = "Guardar";
this.menuGuardar.Click += new System.EventHandler(this.menuGuardar_Click);
//
// menuConfiguracion
//
this.menuConfiguracion.Name = "menuConfiguracion";
this.menuConfiguracion.Size = new System.Drawing.Size(95, 20);
this.menuConfiguracion.Text = "Configuracion";
this.menuConfiguracion.Click += new System.EventHandler(this.menuConfiguracion_Click);
//
// btnGenerar
//
this.btnGenerar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnGenerar.Location = new System.Drawing.Point(392, 485);
this.btnGenerar.Name = "btnGenerar";
this.btnGenerar.Size = new System.Drawing.Size(75, 23);
this.btnGenerar.TabIndex = 10;
this.btnGenerar.Text = "Generar";
this.btnGenerar.UseVisualStyleBackColor = true;
this.btnGenerar.Click += new System.EventHandler(this.btnGenerar_Click);
//
// btnVerDatos
//
this.btnVerDatos.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnVerDatos.Location = new System.Drawing.Point(3, 485);
this.btnVerDatos.Name = "btnVerDatos";
this.btnVerDatos.Size = new System.Drawing.Size(75, 23);
this.btnVerDatos.TabIndex = 11;
this.btnVerDatos.Text = "Ver Datos";
this.btnVerDatos.UseVisualStyleBackColor = true;
this.btnVerDatos.Click += new System.EventHandler(this.btnVerDatos_Click);
//
// lblTituloTabla
//
this.lblTituloTabla.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblTituloTabla.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.lblTituloTabla.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblTituloTabla.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.lblTituloTabla.Location = new System.Drawing.Point(3, 0);
this.lblTituloTabla.Name = "lblTituloTabla";
this.lblTituloTabla.Size = new System.Drawing.Size(464, 37);
this.lblTituloTabla.TabIndex = 12;
this.lblTituloTabla.Text = "lblTituloTabla";
this.lblTituloTabla.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblTituloDB
//
this.lblTituloDB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblTituloDB.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.lblTituloDB.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblTituloDB.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.lblTituloDB.Location = new System.Drawing.Point(3, 0);
this.lblTituloDB.Name = "lblTituloDB";
this.lblTituloDB.Size = new System.Drawing.Size(326, 37);
this.lblTituloDB.TabIndex = 13;
this.lblTituloDB.Text = "lblTituloDB";
this.lblTituloDB.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnDocGen
//
this.btnDocGen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnDocGen.Location = new System.Drawing.Point(311, 485);
this.btnDocGen.Name = "btnDocGen";
this.btnDocGen.Size = new System.Drawing.Size(75, 23);
this.btnDocGen.TabIndex = 14;
this.btnDocGen.Text = "Doc";
this.btnDocGen.UseVisualStyleBackColor = true;
this.btnDocGen.Click += new System.EventHandler(this.btnDocGen_Click);
//
// btnProcs
//
this.btnProcs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnProcs.Location = new System.Drawing.Point(84, 485);
this.btnProcs.Name = "btnProcs";
this.btnProcs.Size = new System.Drawing.Size(87, 23);
this.btnProcs.TabIndex = 15;
this.btnProcs.Text = "Procedimientos";
this.btnProcs.UseVisualStyleBackColor = true;
this.btnProcs.Click += new System.EventHandler(this.btnProcs_Click);
//
// btnExec
//
this.btnExec.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnExec.Location = new System.Drawing.Point(177, 485);
this.btnExec.Name = "btnExec";
this.btnExec.Size = new System.Drawing.Size(45, 23);
this.btnExec.TabIndex = 16;
this.btnExec.Text = "Exec";
this.btnExec.UseVisualStyleBackColor = true;
this.btnExec.Click += new System.EventHandler(this.btnExec_Click);
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(1, 32);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnRefresh);
this.splitContainer1.Panel1.Controls.Add(this.lblTituloDB);
this.splitContainer1.Panel1.Controls.Add(this.btnExec);
this.splitContainer1.Panel1.Controls.Add(this.lsvTablas);
this.splitContainer1.Panel1.Controls.Add(this.btnProcs);
this.splitContainer1.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.splitContainer1_Panel1_Paint);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.lblTituloTabla);
this.splitContainer1.Panel2.Controls.Add(this.btnDocGen);
this.splitContainer1.Panel2.Controls.Add(this.lsvColumnas);
this.splitContainer1.Panel2.Controls.Add(this.menuBaseDatos);
this.splitContainer1.Panel2.Controls.Add(this.btnGenerar);
this.splitContainer1.Panel2.Controls.Add(this.btnVerDatos);
this.splitContainer1.Size = new System.Drawing.Size(806, 511);
this.splitContainer1.SplitterDistance = 332;
this.splitContainer1.TabIndex = 17;
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRefresh.Location = new System.Drawing.Point(3, 485);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(75, 23);
this.btnRefresh.TabIndex = 14;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// lsvTablas
//
this.lsvTablas.AllowSorting = true;
this.lsvTablas.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvTablas.CheckBoxes = true;
this.lsvTablas.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colNombreTabla,
this.colEsquema,
this.colTipo});
this.lsvTablas.FullRowSelect = true;
this.lsvTablas.Location = new System.Drawing.Point(3, 40);
this.lsvTablas.Name = "lsvTablas";
this.lsvTablas.Size = new System.Drawing.Size(326, 439);
this.lsvTablas.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.lsvTablas.TabIndex = 4;
this.lsvTablas.UseCompatibleStateImageBehavior = false;
this.lsvTablas.View = System.Windows.Forms.View.Details;
this.lsvTablas.SelectedIndexChanged += new System.EventHandler(this.lsvTablas_SelectedIndexChanged);
//
// colNombreTabla
//
this.colNombreTabla.Text = "Tabla";
this.colNombreTabla.Width = 169;
//
// colEsquema
//
this.colEsquema.Text = "Esquema";
//
// colTipo
//
this.colTipo.Text = "Tipo";
this.colTipo.Width = 71;
//
// lsvColumnas
//
this.lsvColumnas.AllowSorting = false;
this.lsvColumnas.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvColumnas.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colNombreColumna,
this.colTipoDatos,
this.colTamanho,
this.colClave,
this.colNullable});
this.lsvColumnas.FullRowSelect = true;
this.lsvColumnas.Location = new System.Drawing.Point(3, 40);
this.lsvColumnas.Name = "lsvColumnas";
this.lsvColumnas.Size = new System.Drawing.Size(464, 439);
this.lsvColumnas.TabIndex = 6;
this.lsvColumnas.UseCompatibleStateImageBehavior = false;
this.lsvColumnas.View = System.Windows.Forms.View.Details;
//
// colNombreColumna
//
this.colNombreColumna.Text = "Columna";
this.colNombreColumna.Width = 122;
//
// colTipoDatos
//
this.colTipoDatos.Text = "Tipo de Datos";
this.colTipoDatos.Width = 81;
//
// colTamanho
//
this.colTamanho.Text = "Tamaño";
//
// colClave
//
this.colClave.Text = "Clave";
this.colClave.Width = 71;
//
// colNullable
//
this.colNullable.Text = "Nullable";
//
// txtConString
//
this.txtConString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtConString.Location = new System.Drawing.Point(120, 6);
this.txtConString.Name = "txtConString";
this.txtConString.ReadOnly = true;
this.txtConString.Size = new System.Drawing.Size(616, 20);
this.txtConString.TabIndex = 0;
this.txtConString.TabWidth = 8;
//
// FrmBaseDatos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(806, 543);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.btnCopiarConString);
this.Controls.Add(this.lblConString);
this.Controls.Add(this.txtConString);
this.MainMenuStrip = this.menuBaseDatos;
this.Name = "FrmBaseDatos";
this.Text = "Base de Datos";
this.Load += new System.EventHandler(this.frmBaseDatos_Load);
this.menuBaseDatos.ResumeLayout(false);
this.menuBaseDatos.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private ServerExplorer.Controls.CustomTextBox txtConString;
private System.Windows.Forms.Label lblConString;
private System.Windows.Forms.Button btnCopiarConString;
private ServerExplorer.Controls.CustomListView lsvTablas;
private System.Windows.Forms.ColumnHeader colNombreTabla;
private System.Windows.Forms.ColumnHeader colEsquema;
private System.Windows.Forms.ColumnHeader colTipo;
private ServerExplorer.Controls.CustomListView lsvColumnas;
private System.Windows.Forms.ColumnHeader colNombreColumna;
private System.Windows.Forms.ColumnHeader colTipoDatos;
private System.Windows.Forms.ColumnHeader colTamanho;
private System.Windows.Forms.MenuStrip menuBaseDatos;
private System.Windows.Forms.ToolStripMenuItem archivoToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem menuCargar;
private System.Windows.Forms.ToolStripMenuItem menuGuardar;
private System.Windows.Forms.ToolStripMenuItem menuConfiguracion;
private System.Windows.Forms.ColumnHeader colClave;
private System.Windows.Forms.Button btnGenerar;
private System.Windows.Forms.Button btnVerDatos;
private System.Windows.Forms.Label lblTituloTabla;
private System.Windows.Forms.Label lblTituloDB;
private System.Windows.Forms.Button btnDocGen;
private System.Windows.Forms.Button btnProcs;
private System.Windows.Forms.Button btnExec;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ColumnHeader colNullable;
private System.Windows.Forms.Button btnRefresh;
}
namespace ServerExplorer.UI
{
partial class FrmBaseDatos
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblConString = new System.Windows.Forms.Label();
this.btnCopiarConString = new System.Windows.Forms.Button();
this.menuBaseDatos = new System.Windows.Forms.MenuStrip();
this.archivoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuCargar = new System.Windows.Forms.ToolStripMenuItem();
this.menuGuardar = new System.Windows.Forms.ToolStripMenuItem();
this.menuConfiguracion = new System.Windows.Forms.ToolStripMenuItem();
this.btnGenerar = new System.Windows.Forms.Button();
this.btnVerDatos = new System.Windows.Forms.Button();
this.lblTituloTabla = new System.Windows.Forms.Label();
this.lblTituloDB = new System.Windows.Forms.Label();
this.btnDocGen = new System.Windows.Forms.Button();
this.btnProcs = new System.Windows.Forms.Button();
this.btnExec = new System.Windows.Forms.Button();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnRefresh = new System.Windows.Forms.Button();
this.lsvTablas = new ServerExplorer.Controls.CustomListView();
this.colNombreTabla = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colEsquema = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colTipo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lsvColumnas = new ServerExplorer.Controls.CustomListView();
this.colNombreColumna = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colTipoDatos = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colTamanho = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colClave = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colNullable = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.txtConString = new ServerExplorer.Controls.CustomTextBox();
this.menuBaseDatos.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// lblConString
//
this.lblConString.AutoSize = true;
this.lblConString.Location = new System.Drawing.Point(9, 9);
this.lblConString.Name = "lblConString";
this.lblConString.Size = new System.Drawing.Size(105, 13);
this.lblConString.TabIndex = 1;
this.lblConString.Text = "Cadena de conexion";
//
// btnCopiarConString
//
this.btnCopiarConString.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCopiarConString.Location = new System.Drawing.Point(742, 4);
this.btnCopiarConString.Name = "btnCopiarConString";
this.btnCopiarConString.Size = new System.Drawing.Size(52, 23);
this.btnCopiarConString.TabIndex = 3;
this.btnCopiarConString.Text = "Copiar";
this.btnCopiarConString.UseVisualStyleBackColor = true;
this.btnCopiarConString.Click += new System.EventHandler(this.btnCopiarConString_Click);
//
// menuBaseDatos
//
this.menuBaseDatos.Dock = System.Windows.Forms.DockStyle.None;
this.menuBaseDatos.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.archivoToolStripMenuItem,
this.menuConfiguracion});
this.menuBaseDatos.Location = new System.Drawing.Point(7, 195);
this.menuBaseDatos.Name = "menuBaseDatos";
this.menuBaseDatos.Size = new System.Drawing.Size(195, 24);
this.menuBaseDatos.TabIndex = 9;
this.menuBaseDatos.Text = "menuBaseDatos";
this.menuBaseDatos.Visible = false;
this.menuBaseDatos.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.menuBaseDatos_ItemClicked);
//
// archivoToolStripMenuItem
//
this.archivoToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuCargar,
this.menuGuardar});
this.archivoToolStripMenuItem.Name = "archivoToolStripMenuItem";
this.archivoToolStripMenuItem.Size = new System.Drawing.Size(92, 20);
this.archivoToolStripMenuItem.Text = "Base de Datos";
//
// menuCargar
//
this.menuCargar.Name = "menuCargar";
this.menuCargar.Size = new System.Drawing.Size(116, 22);
this.menuCargar.Text = "Cargar";
this.menuCargar.Click += new System.EventHandler(this.menuCargar_Click);
//
// menuGuardar
//
this.menuGuardar.Name = "menuGuardar";
this.menuGuardar.Size = new System.Drawing.Size(116, 22);
this.menuGuardar.Text = "Guardar";
this.menuGuardar.Click += new System.EventHandler(this.menuGuardar_Click);
//
// menuConfiguracion
//
this.menuConfiguracion.Name = "menuConfiguracion";
this.menuConfiguracion.Size = new System.Drawing.Size(95, 20);
this.menuConfiguracion.Text = "Configuracion";
this.menuConfiguracion.Click += new System.EventHandler(this.menuConfiguracion_Click);
//
// btnGenerar
//
this.btnGenerar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnGenerar.Location = new System.Drawing.Point(392, 485);
this.btnGenerar.Name = "btnGenerar";
this.btnGenerar.Size = new System.Drawing.Size(75, 23);
this.btnGenerar.TabIndex = 10;
this.btnGenerar.Text = "Generar";
this.btnGenerar.UseVisualStyleBackColor = true;
this.btnGenerar.Click += new System.EventHandler(this.btnGenerar_Click);
//
// btnVerDatos
//
this.btnVerDatos.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnVerDatos.Location = new System.Drawing.Point(3, 485);
this.btnVerDatos.Name = "btnVerDatos";
this.btnVerDatos.Size = new System.Drawing.Size(75, 23);
this.btnVerDatos.TabIndex = 11;
this.btnVerDatos.Text = "Ver Datos";
this.btnVerDatos.UseVisualStyleBackColor = true;
this.btnVerDatos.Click += new System.EventHandler(this.btnVerDatos_Click);
//
// lblTituloTabla
//
this.lblTituloTabla.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblTituloTabla.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.lblTituloTabla.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblTituloTabla.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.lblTituloTabla.Location = new System.Drawing.Point(3, 0);
this.lblTituloTabla.Name = "lblTituloTabla";
this.lblTituloTabla.Size = new System.Drawing.Size(464, 37);
this.lblTituloTabla.TabIndex = 12;
this.lblTituloTabla.Text = "lblTituloTabla";
this.lblTituloTabla.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblTituloDB
//
this.lblTituloDB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblTituloDB.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.lblTituloDB.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblTituloDB.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.lblTituloDB.Location = new System.Drawing.Point(3, 0);
this.lblTituloDB.Name = "lblTituloDB";
this.lblTituloDB.Size = new System.Drawing.Size(326, 37);
this.lblTituloDB.TabIndex = 13;
this.lblTituloDB.Text = "lblTituloDB";
this.lblTituloDB.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnDocGen
//
this.btnDocGen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnDocGen.Location = new System.Drawing.Point(311, 485);
this.btnDocGen.Name = "btnDocGen";
this.btnDocGen.Size = new System.Drawing.Size(75, 23);
this.btnDocGen.TabIndex = 14;
this.btnDocGen.Text = "Doc";
this.btnDocGen.UseVisualStyleBackColor = true;
this.btnDocGen.Click += new System.EventHandler(this.btnDocGen_Click);
//
// btnProcs
//
this.btnProcs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnProcs.Location = new System.Drawing.Point(84, 485);
this.btnProcs.Name = "btnProcs";
this.btnProcs.Size = new System.Drawing.Size(87, 23);
this.btnProcs.TabIndex = 15;
this.btnProcs.Text = "Procedimientos";
this.btnProcs.UseVisualStyleBackColor = true;
this.btnProcs.Click += new System.EventHandler(this.btnProcs_Click);
//
// btnExec
//
this.btnExec.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnExec.Location = new System.Drawing.Point(177, 485);
this.btnExec.Name = "btnExec";
this.btnExec.Size = new System.Drawing.Size(45, 23);
this.btnExec.TabIndex = 16;
this.btnExec.Text = "Exec";
this.btnExec.UseVisualStyleBackColor = true;
this.btnExec.Click += new System.EventHandler(this.btnExec_Click);
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(1, 32);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnRefresh);
this.splitContainer1.Panel1.Controls.Add(this.lblTituloDB);
this.splitContainer1.Panel1.Controls.Add(this.btnExec);
this.splitContainer1.Panel1.Controls.Add(this.lsvTablas);
this.splitContainer1.Panel1.Controls.Add(this.btnProcs);
this.splitContainer1.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.splitContainer1_Panel1_Paint);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.lblTituloTabla);
this.splitContainer1.Panel2.Controls.Add(this.btnDocGen);
this.splitContainer1.Panel2.Controls.Add(this.lsvColumnas);
this.splitContainer1.Panel2.Controls.Add(this.menuBaseDatos);
this.splitContainer1.Panel2.Controls.Add(this.btnGenerar);
this.splitContainer1.Panel2.Controls.Add(this.btnVerDatos);
this.splitContainer1.Size = new System.Drawing.Size(806, 511);
this.splitContainer1.SplitterDistance = 332;
this.splitContainer1.TabIndex = 17;
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRefresh.Location = new System.Drawing.Point(3, 485);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(75, 23);
this.btnRefresh.TabIndex = 14;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// lsvTablas
//
this.lsvTablas.AllowSorting = true;
this.lsvTablas.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvTablas.CheckBoxes = true;
this.lsvTablas.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colNombreTabla,
this.colEsquema,
this.colTipo});
this.lsvTablas.FullRowSelect = true;
this.lsvTablas.Location = new System.Drawing.Point(3, 40);
this.lsvTablas.Name = "lsvTablas";
this.lsvTablas.Size = new System.Drawing.Size(326, 439);
this.lsvTablas.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.lsvTablas.TabIndex = 4;
this.lsvTablas.UseCompatibleStateImageBehavior = false;
this.lsvTablas.View = System.Windows.Forms.View.Details;
this.lsvTablas.SelectedIndexChanged += new System.EventHandler(this.lsvTablas_SelectedIndexChanged);
//
// colNombreTabla
//
this.colNombreTabla.Text = "Tabla";
this.colNombreTabla.Width = 169;
//
// colEsquema
//
this.colEsquema.Text = "Esquema";
//
// colTipo
//
this.colTipo.Text = "Tipo";
this.colTipo.Width = 71;
//
// lsvColumnas
//
this.lsvColumnas.AllowSorting = false;
this.lsvColumnas.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvColumnas.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colNombreColumna,
this.colTipoDatos,
this.colTamanho,
this.colClave,
this.colNullable});
this.lsvColumnas.FullRowSelect = true;
this.lsvColumnas.Location = new System.Drawing.Point(3, 40);
this.lsvColumnas.Name = "lsvColumnas";
this.lsvColumnas.Size = new System.Drawing.Size(464, 439);
this.lsvColumnas.TabIndex = 6;
this.lsvColumnas.UseCompatibleStateImageBehavior = false;
this.lsvColumnas.View = System.Windows.Forms.View.Details;
//
// colNombreColumna
//
this.colNombreColumna.Text = "Columna";
this.colNombreColumna.Width = 122;
//
// colTipoDatos
//
this.colTipoDatos.Text = "Tipo de Datos";
this.colTipoDatos.Width = 81;
//
// colTamanho
//
this.colTamanho.Text = "Tamaño";
//
// colClave
//
this.colClave.Text = "Clave";
this.colClave.Width = 71;
//
// colNullable
//
this.colNullable.Text = "Nullable";
//
// txtConString
//
this.txtConString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtConString.Location = new System.Drawing.Point(120, 6);
this.txtConString.Name = "txtConString";
this.txtConString.ReadOnly = true;
this.txtConString.Size = new System.Drawing.Size(616, 20);
this.txtConString.TabIndex = 0;
this.txtConString.TabWidth = 8;
//
// FrmBaseDatos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(806, 543);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.btnCopiarConString);
this.Controls.Add(this.lblConString);
this.Controls.Add(this.txtConString);
this.MainMenuStrip = this.menuBaseDatos;
this.Name = "FrmBaseDatos";
this.Text = "Base de Datos";
this.Load += new System.EventHandler(this.frmBaseDatos_Load);
this.menuBaseDatos.ResumeLayout(false);
this.menuBaseDatos.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private ServerExplorer.Controls.CustomTextBox txtConString;
private System.Windows.Forms.Label lblConString;
private System.Windows.Forms.Button btnCopiarConString;
private ServerExplorer.Controls.CustomListView lsvTablas;
private System.Windows.Forms.ColumnHeader colNombreTabla;
private System.Windows.Forms.ColumnHeader colEsquema;
private System.Windows.Forms.ColumnHeader colTipo;
private ServerExplorer.Controls.CustomListView lsvColumnas;
private System.Windows.Forms.ColumnHeader colNombreColumna;
private System.Windows.Forms.ColumnHeader colTipoDatos;
private System.Windows.Forms.ColumnHeader colTamanho;
private System.Windows.Forms.MenuStrip menuBaseDatos;
private System.Windows.Forms.ToolStripMenuItem archivoToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem menuCargar;
private System.Windows.Forms.ToolStripMenuItem menuGuardar;
private System.Windows.Forms.ToolStripMenuItem menuConfiguracion;
private System.Windows.Forms.ColumnHeader colClave;
private System.Windows.Forms.Button btnGenerar;
private System.Windows.Forms.Button btnVerDatos;
private System.Windows.Forms.Label lblTituloTabla;
private System.Windows.Forms.Label lblTituloDB;
private System.Windows.Forms.Button btnDocGen;
private System.Windows.Forms.Button btnProcs;
private System.Windows.Forms.Button btnExec;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ColumnHeader colNullable;
private System.Windows.Forms.Button btnRefresh;
}
}

View File

@@ -1,289 +1,289 @@
using System;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Xml.Serialization;
using ServerExplorer.Code;
namespace ServerExplorer.UI
{
public partial class FrmBaseDatos : Form
{
private SqlConnection _cnx;
private Config _config;
private String _tableSchema;
private String _tableName;
private void Initialize()
{
// Establecer conexion
txtConString.Text = _config.ConnectionString;
_cnx = new SqlConnection(_config.ConnectionString);
// Obtener lista de tablas
_cnx.Open();
DataTable dt = _cnx.GetSchema("Tables");
_cnx.Close();
// Mostrar todas las tablas
lsvTablas.Items.Clear();
foreach (DataRow dr in dt.Rows)
{
ListViewItem item = lsvTablas.Items.Add((String)dr["TABLE_NAME"]);
item.SubItems.Add((String)dr["TABLE_SCHEMA"]);
item.SubItems.Add((String)dr["TABLE_TYPE"]);
}
TablesToListView();
// Limpiar Columnas
lsvColumnas.Items.Clear();
}
/// <summary>
/// Metodo para copiar las tablas seleccionadas en el listview a la configuracion
/// </summary>
private void TablesFromListView()
{
_config.Tablas.Clear();
foreach (ListViewItem item in lsvTablas.Items)
{
if (item.Checked)
{
_config.Tablas.Add(new TablaInfo
{
Esquema = item.SubItems[1].Text,
Nombre = item.SubItems[0].Text
});
}
}
}
/// <summary>
/// Metodo para seleccionar las tablas en le listview desde la configuracion
/// </summary>
private void TablesToListView()
{
int j;
// Desmarcar todos en caso de no haber ninguna tabla
if (_config.Tablas.Count == 0)
{
foreach (ListViewItem item in lsvTablas.Items)
item.Checked = false;
return;
}
// Recorrer items marcando los que estan en la configuracion
int n = _config.Tablas.Count;
int i = j = 0;
foreach (ListViewItem item in lsvTablas.Items)
{
item.Checked = false;
do
{
if (String.Compare(_config.Tablas[i].Esquema, item.SubItems[1].Text, StringComparison.Ordinal) == 0 &&
String.Compare(_config.Tablas[i].Nombre, item.SubItems[0].Text, StringComparison.Ordinal) == 0)
{
item.Checked = true;
break;
}
i = (i + 1) % n;
} while (i != j);
j = i;
}
}
public DatabaseDesc CrearDatabaseDesc()
{
var db = new DatabaseDesc { Nombre = _cnx.Database };
foreach (TablaInfo t in _config.Tablas)
{
var td = new TablaDesc();
td.FillDesc(t.Esquema, t.Nombre, _cnx);
db.Tablas.Add(td);
}
return (db);
}
public FrmBaseDatos(String connectionString)
{
InitializeComponent();
_config = new Config {ConnectionString = connectionString};
}
public FrmBaseDatos(Config config)
{
InitializeComponent();
_config = config;
}
private void frmBaseDatos_Load(object sender, EventArgs e)
{
Initialize();
// Establecer titulos
lblTituloDB.Text = _cnx.Database;
lblTituloTabla.Text = "";
}
private void btnCopiarConString_Click(object sender, EventArgs e)
{
// Copiar la cadena de conexion al portapapeles
Clipboard.SetText(txtConString.Text);
}
private void lsvTablas_SelectedIndexChanged(object sender, EventArgs e)
{
if (lsvTablas.SelectedItems.Count != 1) { return; }
// Determinar tabla seleccionada
ListViewItem item = lsvTablas.SelectedItems[0];
// Recordar tabla seleccionada
_tableSchema = item.SubItems[1].Text;
_tableName = item.SubItems[0].Text;
// Establecer titulo de la lista de columnas
lblTituloTabla.Text = _tableSchema + @"." + _tableName;
// Obtener descripcion de tabla
var td = new TablaDesc();
td.FillDesc(_tableSchema, _tableName, _cnx);
// Mostrar "columnas" de las tablas
lsvColumnas.Items.Clear();
foreach (ColumnaDesc col in td.Columnas)
{
ListViewItem subitem = lsvColumnas.Items.Add(col.Nombre);
subitem.SubItems.Add(col.Tipo);
subitem.SubItems.Add((col.Tamanho >= 0) ? String.Format("{0}", col.Tamanho) : string.Empty);
subitem.SubItems.Add(col.Primaria ? "PK" : string.Empty);
subitem.SubItems.Add(col.Nullable ? "Null" : "NotNull");
}
}
private void menuCargar_Click(object sender, EventArgs e)
{
var dialogo = new OpenFileDialog();
if (dialogo.ShowDialog() == DialogResult.OK)
{
_config = Config.Cargar(dialogo.FileName);
Initialize();
}
}
private void menuGuardar_Click(object sender, EventArgs e)
{
var dialogo = new SaveFileDialog();
if (dialogo.ShowDialog() == DialogResult.OK)
{
TablesFromListView();
_config.Guardar(dialogo.FileName);
}
}
private void menuConfiguracion_Click(object sender, EventArgs e)
{
//// Llamar a la ventana de configuracion
//FrmCodeGenConfig frm = new FrmCodeGenConfig(config);
//frm.ShowDialog();
}
private void btnVerDatos_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(_tableSchema) || string.IsNullOrEmpty(_tableName)) { return; }
// Obtener descripcion de tabla
var td = new TablaDesc();
td.FillDesc(_tableSchema, _tableName, _cnx);
// Crear y mostrar el formulario de los datos.
var form = new FrmDatos(td, _config.ConnectionString);
FrmPrincipal.AddForm(form);
}
private void btnProcs_Click(object sender, EventArgs e)
{
// Crear y mostrar el formulario de los procedimientos.
var form = new FrmProcedimientos(_config.ConnectionString);
FrmPrincipal.AddForm(form);
}
private void btnExec_Click(object sender, EventArgs e)
{
// Crear y mostrar el formulario de exec.
var form = new FrmExec(_config.ConnectionString);
FrmPrincipal.AddForm(form);
}
private void menuBaseDatos_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void btnGenerar_Click(object sender, EventArgs e)
{
TablesFromListView();
DatabaseDesc db = CrearDatabaseDesc();
var seriador = new XmlSerializer(typeof(DatabaseDesc));
seriador.Serialize(Console.Out, db);
//CodeGen.GenerarCodigo(config, db);
}
private void btnDocGen_Click(object sender, EventArgs e)
{
// Hacer insensible la ventana
Parent.Enabled = false;
// Obtener informacion.
TablesFromListView();
DatabaseDesc db = CrearDatabaseDesc();
// Escribir documentacion
DocGen.GenerarDocumentacion(db);
// Hace sensible la ventana
Parent.Enabled = true;
/*
tablas_delistview();
Thread hilo=new Thread(new ThreadStart(instancia.GenerarDoc));
hilo.Start();
*/
}
public void GenerarDoc()
{
// Hacer insensible la ventana
Enabled = false;
// Obtener informacion.
DatabaseDesc db = CrearDatabaseDesc();
// Escribir documentacion
DocGen.GenerarDocumentacion(db);
// Hace sensible la ventana
Enabled = true;
}
private void splitContainer1_Panel1_Paint(object sender, PaintEventArgs e)
{
}
private void btnRefresh_Click(object sender, EventArgs e)
{
Initialize();
}
}
}
using System;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Xml.Serialization;
using ServerExplorer.Code;
namespace ServerExplorer.UI
{
public partial class FrmBaseDatos : Form
{
private SqlConnection _cnx;
private Config _config;
private String _tableSchema;
private String _tableName;
private void Initialize()
{
// Establecer conexion
txtConString.Text = _config.ConnectionString;
_cnx = new SqlConnection(_config.ConnectionString);
// Obtener lista de tablas
_cnx.Open();
DataTable dt = _cnx.GetSchema("Tables");
_cnx.Close();
// Mostrar todas las tablas
lsvTablas.Items.Clear();
foreach (DataRow dr in dt.Rows)
{
ListViewItem item = lsvTablas.Items.Add((String)dr["TABLE_NAME"]);
item.SubItems.Add((String)dr["TABLE_SCHEMA"]);
item.SubItems.Add((String)dr["TABLE_TYPE"]);
}
TablesToListView();
// Limpiar Columnas
lsvColumnas.Items.Clear();
}
/// <summary>
/// Metodo para copiar las tablas seleccionadas en el listview a la configuracion
/// </summary>
private void TablesFromListView()
{
_config.Tablas.Clear();
foreach (ListViewItem item in lsvTablas.Items)
{
if (item.Checked)
{
_config.Tablas.Add(new TablaInfo
{
Esquema = item.SubItems[1].Text,
Nombre = item.SubItems[0].Text
});
}
}
}
/// <summary>
/// Metodo para seleccionar las tablas en le listview desde la configuracion
/// </summary>
private void TablesToListView()
{
int j;
// Desmarcar todos en caso de no haber ninguna tabla
if (_config.Tablas.Count == 0)
{
foreach (ListViewItem item in lsvTablas.Items)
item.Checked = false;
return;
}
// Recorrer items marcando los que estan en la configuracion
int n = _config.Tablas.Count;
int i = j = 0;
foreach (ListViewItem item in lsvTablas.Items)
{
item.Checked = false;
do
{
if (String.Compare(_config.Tablas[i].Esquema, item.SubItems[1].Text, StringComparison.Ordinal) == 0 &&
String.Compare(_config.Tablas[i].Nombre, item.SubItems[0].Text, StringComparison.Ordinal) == 0)
{
item.Checked = true;
break;
}
i = (i + 1) % n;
} while (i != j);
j = i;
}
}
public DatabaseDesc CrearDatabaseDesc()
{
var db = new DatabaseDesc { Nombre = _cnx.Database };
foreach (TablaInfo t in _config.Tablas)
{
var td = new TablaDesc();
td.FillDesc(t.Esquema, t.Nombre, _cnx);
db.Tablas.Add(td);
}
return (db);
}
public FrmBaseDatos(String connectionString)
{
InitializeComponent();
_config = new Config {ConnectionString = connectionString};
}
public FrmBaseDatos(Config config)
{
InitializeComponent();
_config = config;
}
private void frmBaseDatos_Load(object sender, EventArgs e)
{
Initialize();
// Establecer titulos
lblTituloDB.Text = _cnx.Database;
lblTituloTabla.Text = "";
}
private void btnCopiarConString_Click(object sender, EventArgs e)
{
// Copiar la cadena de conexion al portapapeles
Clipboard.SetText(txtConString.Text);
}
private void lsvTablas_SelectedIndexChanged(object sender, EventArgs e)
{
if (lsvTablas.SelectedItems.Count != 1) { return; }
// Determinar tabla seleccionada
ListViewItem item = lsvTablas.SelectedItems[0];
// Recordar tabla seleccionada
_tableSchema = item.SubItems[1].Text;
_tableName = item.SubItems[0].Text;
// Establecer titulo de la lista de columnas
lblTituloTabla.Text = _tableSchema + @"." + _tableName;
// Obtener descripcion de tabla
var td = new TablaDesc();
td.FillDesc(_tableSchema, _tableName, _cnx);
// Mostrar "columnas" de las tablas
lsvColumnas.Items.Clear();
foreach (ColumnaDesc col in td.Columnas)
{
ListViewItem subitem = lsvColumnas.Items.Add(col.Nombre);
subitem.SubItems.Add(col.Tipo);
subitem.SubItems.Add((col.Tamanho >= 0) ? String.Format("{0}", col.Tamanho) : string.Empty);
subitem.SubItems.Add(col.Primaria ? "PK" : string.Empty);
subitem.SubItems.Add(col.Nullable ? "Null" : "NotNull");
}
}
private void menuCargar_Click(object sender, EventArgs e)
{
var dialogo = new OpenFileDialog();
if (dialogo.ShowDialog() == DialogResult.OK)
{
_config = Config.Cargar(dialogo.FileName);
Initialize();
}
}
private void menuGuardar_Click(object sender, EventArgs e)
{
var dialogo = new SaveFileDialog();
if (dialogo.ShowDialog() == DialogResult.OK)
{
TablesFromListView();
_config.Guardar(dialogo.FileName);
}
}
private void menuConfiguracion_Click(object sender, EventArgs e)
{
//// Llamar a la ventana de configuracion
//FrmCodeGenConfig frm = new FrmCodeGenConfig(config);
//frm.ShowDialog();
}
private void btnVerDatos_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(_tableSchema) || string.IsNullOrEmpty(_tableName)) { return; }
// Obtener descripcion de tabla
var td = new TablaDesc();
td.FillDesc(_tableSchema, _tableName, _cnx);
// Crear y mostrar el formulario de los datos.
var form = new FrmDatos(td, _config.ConnectionString);
FrmPrincipal.AddForm(form);
}
private void btnProcs_Click(object sender, EventArgs e)
{
// Crear y mostrar el formulario de los procedimientos.
var form = new FrmProcedimientos(_config.ConnectionString);
FrmPrincipal.AddForm(form);
}
private void btnExec_Click(object sender, EventArgs e)
{
// Crear y mostrar el formulario de exec.
var form = new FrmExec(_config.ConnectionString);
FrmPrincipal.AddForm(form);
}
private void menuBaseDatos_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void btnGenerar_Click(object sender, EventArgs e)
{
TablesFromListView();
DatabaseDesc db = CrearDatabaseDesc();
var seriador = new XmlSerializer(typeof(DatabaseDesc));
seriador.Serialize(Console.Out, db);
//CodeGen.GenerarCodigo(config, db);
}
private void btnDocGen_Click(object sender, EventArgs e)
{
// Hacer insensible la ventana
Parent.Enabled = false;
// Obtener informacion.
TablesFromListView();
DatabaseDesc db = CrearDatabaseDesc();
// Escribir documentacion
DocGen.GenerarDocumentacion(db);
// Hace sensible la ventana
Parent.Enabled = true;
/*
tablas_delistview();
Thread hilo=new Thread(new ThreadStart(instancia.GenerarDoc));
hilo.Start();
*/
}
public void GenerarDoc()
{
// Hacer insensible la ventana
Enabled = false;
// Obtener informacion.
DatabaseDesc db = CrearDatabaseDesc();
// Escribir documentacion
DocGen.GenerarDocumentacion(db);
// Hace sensible la ventana
Enabled = true;
}
private void splitContainer1_Panel1_Paint(object sender, PaintEventArgs e)
{
}
private void btnRefresh_Click(object sender, EventArgs e)
{
Initialize();
}
}
}

View File

@@ -1,126 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuBaseDatos.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>41</value>
</metadata>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuBaseDatos.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>41</value>
</metadata>
</root>

View File

@@ -1,84 +1,84 @@
namespace ServerExplorer.UI
{
partial class FrmDatos
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dgvDatos = new System.Windows.Forms.DataGridView();
this.btnRefresh = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvDatos)).BeginInit();
this.SuspendLayout();
//
// dgvDatos
//
this.dgvDatos.AllowUserToAddRows = false;
this.dgvDatos.AllowUserToDeleteRows = false;
this.dgvDatos.AllowUserToOrderColumns = true;
this.dgvDatos.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvDatos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDatos.Location = new System.Drawing.Point(12, 18);
this.dgvDatos.Name = "dgvDatos";
this.dgvDatos.ReadOnly = true;
this.dgvDatos.Size = new System.Drawing.Size(347, 273);
this.dgvDatos.TabIndex = 0;
this.dgvDatos.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDatos_CellDoubleClick);
this.dgvDatos.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvDatos_CellFormatting);
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRefresh.Location = new System.Drawing.Point(12, 297);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(75, 23);
this.btnRefresh.TabIndex = 1;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// FrmDatos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(371, 332);
this.Controls.Add(this.btnRefresh);
this.Controls.Add(this.dgvDatos);
this.Name = "FrmDatos";
this.Text = "frmDatos";
this.Load += new System.EventHandler(this.frmDatos_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvDatos)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvDatos;
private System.Windows.Forms.Button btnRefresh;
}
namespace ServerExplorer.UI
{
partial class FrmDatos
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dgvDatos = new System.Windows.Forms.DataGridView();
this.btnRefresh = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvDatos)).BeginInit();
this.SuspendLayout();
//
// dgvDatos
//
this.dgvDatos.AllowUserToAddRows = false;
this.dgvDatos.AllowUserToDeleteRows = false;
this.dgvDatos.AllowUserToOrderColumns = true;
this.dgvDatos.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvDatos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDatos.Location = new System.Drawing.Point(12, 18);
this.dgvDatos.Name = "dgvDatos";
this.dgvDatos.ReadOnly = true;
this.dgvDatos.Size = new System.Drawing.Size(347, 273);
this.dgvDatos.TabIndex = 0;
this.dgvDatos.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDatos_CellDoubleClick);
this.dgvDatos.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvDatos_CellFormatting);
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRefresh.Location = new System.Drawing.Point(12, 297);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(75, 23);
this.btnRefresh.TabIndex = 1;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// FrmDatos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(371, 332);
this.Controls.Add(this.btnRefresh);
this.Controls.Add(this.dgvDatos);
this.Name = "FrmDatos";
this.Text = "frmDatos";
this.Load += new System.EventHandler(this.frmDatos_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvDatos)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvDatos;
private System.Windows.Forms.Button btnRefresh;
}
}

View File

@@ -1,72 +1,72 @@
using System;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using ServerExplorer.Code;
using System.Data.SqlClient;
namespace ServerExplorer.UI
{
public partial class FrmDatos : Form
{
#region Declarations
private readonly TablaDesc _tablaDesc;
private readonly string _conexionString = string.Empty;
#endregion
#region Form life cycle
public FrmDatos(TablaDesc tablaDesc, string conexionString)
{
InitializeComponent();
_tablaDesc = tablaDesc;
_conexionString = conexionString;
LoadDataFromTable();
}
private void frmDatos_Load(object sender, EventArgs e) { }
#endregion
#region Events
private void dgvDatos_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { }
private void dgvDatos_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.DesiredType == typeof(Image))
{
if (e.Value is DBNull || (e.Value is byte[] && ((byte[])e.Value).Length <= 0))
{
e.Value = new Bitmap(1, 1);
}
}
}
private void btnRefresh_Click(object sender, EventArgs e)
{
LoadDataFromTable();
}
#endregion
#region Private methods
private void LoadDataFromTable()
{
Text = _tablaDesc.Esquema + @"." + _tablaDesc.Nombre;
string tableFullName = "[" + _tablaDesc.Esquema + "].[" + _tablaDesc.Nombre + "]";
var dt= new DataTable();
var cnx = new SqlConnection(_conexionString);
var da = new SqlDataAdapter( "select * from " + tableFullName, cnx);
cnx.Open();
da.Fill(dt);
cnx.Close();
dgvDatos.DataSource = dt;
}
#endregion
}
}
using System;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using ServerExplorer.Code;
using System.Data.SqlClient;
namespace ServerExplorer.UI
{
public partial class FrmDatos : Form
{
#region Declarations
private readonly TablaDesc _tablaDesc;
private readonly string _conexionString = string.Empty;
#endregion
#region Form life cycle
public FrmDatos(TablaDesc tablaDesc, string conexionString)
{
InitializeComponent();
_tablaDesc = tablaDesc;
_conexionString = conexionString;
LoadDataFromTable();
}
private void frmDatos_Load(object sender, EventArgs e) { }
#endregion
#region Events
private void dgvDatos_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { }
private void dgvDatos_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.DesiredType == typeof(Image))
{
if (e.Value is DBNull || (e.Value is byte[] && ((byte[])e.Value).Length <= 0))
{
e.Value = new Bitmap(1, 1);
}
}
}
private void btnRefresh_Click(object sender, EventArgs e)
{
LoadDataFromTable();
}
#endregion
#region Private methods
private void LoadDataFromTable()
{
Text = _tablaDesc.Esquema + @"." + _tablaDesc.Nombre;
string tableFullName = "[" + _tablaDesc.Esquema + "].[" + _tablaDesc.Nombre + "]";
var dt= new DataTable();
var cnx = new SqlConnection(_conexionString);
var da = new SqlDataAdapter( "select * from " + tableFullName, cnx);
cnx.Open();
da.Fill(dt);
cnx.Close();
dgvDatos.DataSource = dt;
}
#endregion
}
}

View File

@@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,142 +1,142 @@
namespace ServerExplorer.UI
{
partial class FrmExec
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnExec = new System.Windows.Forms.Button();
this.txtCommand = new ServerExplorer.Controls.CustomTextBox();
this.dgvDatos = new System.Windows.Forms.DataGridView();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnGenInserts = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvDatos)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// btnExec
//
this.btnExec.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnExec.Location = new System.Drawing.Point(532, 66);
this.btnExec.Name = "btnExec";
this.btnExec.Size = new System.Drawing.Size(75, 23);
this.btnExec.TabIndex = 0;
this.btnExec.Text = "Exec";
this.btnExec.UseVisualStyleBackColor = true;
this.btnExec.Click += new System.EventHandler(this.btnExec_Click);
//
// txtCommand
//
this.txtCommand.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtCommand.Font = new System.Drawing.Font("Lucida Console", 8.25F);
this.txtCommand.Location = new System.Drawing.Point(3, 3);
this.txtCommand.Multiline = true;
this.txtCommand.Name = "txtCommand";
this.txtCommand.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtCommand.Size = new System.Drawing.Size(604, 57);
this.txtCommand.TabIndex = 1;
this.txtCommand.TabWidth = 8;
//
// dgvDatos
//
this.dgvDatos.AllowUserToAddRows = false;
this.dgvDatos.AllowUserToDeleteRows = false;
this.dgvDatos.AllowUserToOrderColumns = true;
this.dgvDatos.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvDatos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDatos.Location = new System.Drawing.Point(3, 3);
this.dgvDatos.Name = "dgvDatos";
this.dgvDatos.ReadOnly = true;
this.dgvDatos.Size = new System.Drawing.Size(604, 338);
this.dgvDatos.TabIndex = 2;
this.dgvDatos.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvDatos_CellFormatting);
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(12, 12);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnGenInserts);
this.splitContainer1.Panel1.Controls.Add(this.txtCommand);
this.splitContainer1.Panel1.Controls.Add(this.btnExec);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.dgvDatos);
this.splitContainer1.Size = new System.Drawing.Size(610, 440);
this.splitContainer1.SplitterDistance = 92;
this.splitContainer1.TabIndex = 3;
//
// btnGenInserts
//
this.btnGenInserts.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnGenInserts.Location = new System.Drawing.Point(424, 66);
this.btnGenInserts.Name = "btnGenInserts";
this.btnGenInserts.Size = new System.Drawing.Size(102, 23);
this.btnGenInserts.TabIndex = 2;
this.btnGenInserts.Text = "Genera INSERTs";
this.btnGenInserts.UseVisualStyleBackColor = true;
this.btnGenInserts.Click += new System.EventHandler(this.btnGenInserts_Click);
//
// FrmExec
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(634, 464);
this.Controls.Add(this.splitContainer1);
this.Name = "FrmExec";
this.Text = "frmExec";
((System.ComponentModel.ISupportInitialize)(this.dgvDatos)).EndInit();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnExec;
private ServerExplorer.Controls.CustomTextBox txtCommand;
private System.Windows.Forms.DataGridView dgvDatos;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Button btnGenInserts;
}
namespace ServerExplorer.UI
{
partial class FrmExec
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnExec = new System.Windows.Forms.Button();
this.txtCommand = new ServerExplorer.Controls.CustomTextBox();
this.dgvDatos = new System.Windows.Forms.DataGridView();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnGenInserts = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvDatos)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// btnExec
//
this.btnExec.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnExec.Location = new System.Drawing.Point(532, 66);
this.btnExec.Name = "btnExec";
this.btnExec.Size = new System.Drawing.Size(75, 23);
this.btnExec.TabIndex = 0;
this.btnExec.Text = "Exec";
this.btnExec.UseVisualStyleBackColor = true;
this.btnExec.Click += new System.EventHandler(this.btnExec_Click);
//
// txtCommand
//
this.txtCommand.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtCommand.Font = new System.Drawing.Font("Lucida Console", 8.25F);
this.txtCommand.Location = new System.Drawing.Point(3, 3);
this.txtCommand.Multiline = true;
this.txtCommand.Name = "txtCommand";
this.txtCommand.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtCommand.Size = new System.Drawing.Size(604, 57);
this.txtCommand.TabIndex = 1;
this.txtCommand.TabWidth = 8;
//
// dgvDatos
//
this.dgvDatos.AllowUserToAddRows = false;
this.dgvDatos.AllowUserToDeleteRows = false;
this.dgvDatos.AllowUserToOrderColumns = true;
this.dgvDatos.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvDatos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDatos.Location = new System.Drawing.Point(3, 3);
this.dgvDatos.Name = "dgvDatos";
this.dgvDatos.ReadOnly = true;
this.dgvDatos.Size = new System.Drawing.Size(604, 338);
this.dgvDatos.TabIndex = 2;
this.dgvDatos.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvDatos_CellFormatting);
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(12, 12);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnGenInserts);
this.splitContainer1.Panel1.Controls.Add(this.txtCommand);
this.splitContainer1.Panel1.Controls.Add(this.btnExec);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.dgvDatos);
this.splitContainer1.Size = new System.Drawing.Size(610, 440);
this.splitContainer1.SplitterDistance = 92;
this.splitContainer1.TabIndex = 3;
//
// btnGenInserts
//
this.btnGenInserts.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnGenInserts.Location = new System.Drawing.Point(424, 66);
this.btnGenInserts.Name = "btnGenInserts";
this.btnGenInserts.Size = new System.Drawing.Size(102, 23);
this.btnGenInserts.TabIndex = 2;
this.btnGenInserts.Text = "Genera INSERTs";
this.btnGenInserts.UseVisualStyleBackColor = true;
this.btnGenInserts.Click += new System.EventHandler(this.btnGenInserts_Click);
//
// FrmExec
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(634, 464);
this.Controls.Add(this.splitContainer1);
this.Name = "FrmExec";
this.Text = "frmExec";
((System.ComponentModel.ISupportInitialize)(this.dgvDatos)).EndInit();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnExec;
private ServerExplorer.Controls.CustomTextBox txtCommand;
private System.Windows.Forms.DataGridView dgvDatos;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Button btnGenInserts;
}
}

View File

@@ -1,168 +1,168 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Globalization;
using System.Windows.Forms;
namespace ServerExplorer.UI
{
public partial class FrmExec : Form
{
#region Declarations
private readonly string _cnxString;
#endregion
#region Form life cycle
public FrmExec(string cnxString)
{
InitializeComponent();
_cnxString = cnxString;
}
#endregion
#region Events
private void btnExec_Click(object sender, EventArgs e)
{
try
{
DataTable dt = Exec();
dgvDatos.DataSource = dt;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void btnGenInserts_Click(object sender, EventArgs e)
{
try
{
// Obtener el nombre de la tabla destino
string destTable = Microsoft.VisualBasic.Interaction.InputBox("Nombre de la tabla destino", "tabla destino", String.Empty,
Top + (Height / 2), Left + (Width / 2));
DataTable dt = GenerarInserts(destTable);
dgvDatos.DataSource = dt;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void dgvDatos_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.DesiredType == typeof(Image))
{
if (e.Value is DBNull || (e.Value is byte[] && ((byte[])e.Value).Length <= 0))
{
e.Value = new Bitmap(1, 1);
}
}
}
#endregion
#region Private methods
private DataTable Exec()
{
// Establecer conexion
var cnx = new SqlConnection(_cnxString);
// Obtener resultado en un datatable.
var da = new SqlDataAdapter(txtCommand.Text, cnx);
var dt = new DataTable();
cnx.Open();
da.Fill(dt);
cnx.Close();
return dt;
}
private DataTable GenerarInserts(string destTable)
{
var nfi = new NumberFormatInfo { NumberDecimalSeparator = "." };
DataTable dataTable = Exec();
// Preparar la datatable destino
var destDataTable = new DataTable();
destDataTable.Columns.Add("Comando", typeof(String));
// Recorrer la tabla de datos
foreach (DataRow dr in dataTable.Rows)
{
string strColumns = String.Empty;
string strValues = String.Empty;
foreach (DataColumn dc in dataTable.Columns)
{
// El nombre de la columna
if (strColumns != String.Empty)
strColumns += ", ";
strColumns += "[" + dc.ColumnName + "]";
// El valor de la columna
if (strValues != String.Empty)
strValues += ", ";
object valor = dr[dc];
if (valor == DBNull.Value || valor == null)
{
// NULOS
strValues += "NULL";
}
else
{
string type = dc.DataType.Name.ToLower();
if (type == "string")
{
// Cadenas
strValues += "'" + ((string)valor).Replace("'", "''") + "'";
}
else if (type == "decimal")
{
// Decimales
strValues += ((decimal)valor).ToString(nfi);
}
else if (type == "bit" || type == "bool" || type == "boolean")
{
// Booleanos
strValues += ((bool)valor) ? "1" : "0";
}
else if (type == "byte[]" )
{
// Arrays de bytes (imagenes, archivos etc)
strValues += "0x" + BitConverter.ToString(((byte[])valor)).Replace("-", "");
}
else
{
// Otros
strValues += valor.ToString();
}
}
}
// Insertar fila a la datatable destino
destDataTable.Rows.Add(
new object[] {
String.Format("INSERT INTO {0} ({1}) VALUES ({2})",
destTable, strColumns, strValues)
});
}
return destDataTable;
}
#endregion
}
}
using System;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Globalization;
using System.Windows.Forms;
namespace ServerExplorer.UI
{
public partial class FrmExec : Form
{
#region Declarations
private readonly string _cnxString;
#endregion
#region Form life cycle
public FrmExec(string cnxString)
{
InitializeComponent();
_cnxString = cnxString;
}
#endregion
#region Events
private void btnExec_Click(object sender, EventArgs e)
{
try
{
DataTable dt = Exec();
dgvDatos.DataSource = dt;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void btnGenInserts_Click(object sender, EventArgs e)
{
try
{
// Obtener el nombre de la tabla destino
string destTable = Microsoft.VisualBasic.Interaction.InputBox("Nombre de la tabla destino", "tabla destino", String.Empty,
Top + (Height / 2), Left + (Width / 2));
DataTable dt = GenerarInserts(destTable);
dgvDatos.DataSource = dt;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void dgvDatos_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.DesiredType == typeof(Image))
{
if (e.Value is DBNull || (e.Value is byte[] && ((byte[])e.Value).Length <= 0))
{
e.Value = new Bitmap(1, 1);
}
}
}
#endregion
#region Private methods
private DataTable Exec()
{
// Establecer conexion
var cnx = new SqlConnection(_cnxString);
// Obtener resultado en un datatable.
var da = new SqlDataAdapter(txtCommand.Text, cnx);
var dt = new DataTable();
cnx.Open();
da.Fill(dt);
cnx.Close();
return dt;
}
private DataTable GenerarInserts(string destTable)
{
var nfi = new NumberFormatInfo { NumberDecimalSeparator = "." };
DataTable dataTable = Exec();
// Preparar la datatable destino
var destDataTable = new DataTable();
destDataTable.Columns.Add("Comando", typeof(String));
// Recorrer la tabla de datos
foreach (DataRow dr in dataTable.Rows)
{
string strColumns = String.Empty;
string strValues = String.Empty;
foreach (DataColumn dc in dataTable.Columns)
{
// El nombre de la columna
if (strColumns != String.Empty)
strColumns += ", ";
strColumns += "[" + dc.ColumnName + "]";
// El valor de la columna
if (strValues != String.Empty)
strValues += ", ";
object valor = dr[dc];
if (valor == DBNull.Value || valor == null)
{
// NULOS
strValues += "NULL";
}
else
{
string type = dc.DataType.Name.ToLower();
if (type == "string")
{
// Cadenas
strValues += "'" + ((string)valor).Replace("'", "''") + "'";
}
else if (type == "decimal")
{
// Decimales
strValues += ((decimal)valor).ToString(nfi);
}
else if (type == "bit" || type == "bool" || type == "boolean")
{
// Booleanos
strValues += ((bool)valor) ? "1" : "0";
}
else if (type == "byte[]" )
{
// Arrays de bytes (imagenes, archivos etc)
strValues += "0x" + BitConverter.ToString(((byte[])valor)).Replace("-", "");
}
else
{
// Otros
strValues += valor.ToString();
}
}
}
// Insertar fila a la datatable destino
destDataTable.Rows.Add(
new object[] {
String.Format("INSERT INTO {0} ({1}) VALUES ({2})",
destTable, strColumns, strValues)
});
}
return destDataTable;
}
#endregion
}
}

View File

@@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,130 +1,130 @@
namespace ServerExplorer.UI
{
partial class FrmPrincipal
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.menuPrincipal = new System.Windows.Forms.MenuStrip();
this.menuServidor = new System.Windows.Forms.ToolStripMenuItem();
this.menuBuscarServidor = new System.Windows.Forms.ToolStripMenuItem();
this.menuBaseDatos = new System.Windows.Forms.ToolStripMenuItem();
this.menuConectarA = new System.Windows.Forms.ToolStripMenuItem();
this.menuConectarPRUEBAS = new System.Windows.Forms.ToolStripMenuItem();
this.flowpnlWindows = new System.Windows.Forms.FlowLayoutPanel();
this.menuPrincipal.SuspendLayout();
this.SuspendLayout();
//
// menuPrincipal
//
this.menuPrincipal.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuServidor,
this.menuBaseDatos});
this.menuPrincipal.Location = new System.Drawing.Point(0, 0);
this.menuPrincipal.Name = "menuPrincipal";
this.menuPrincipal.Size = new System.Drawing.Size(800, 24);
this.menuPrincipal.TabIndex = 4;
this.menuPrincipal.Text = "menuPrincipal";
//
// menuServidor
//
this.menuServidor.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuBuscarServidor});
this.menuServidor.Name = "menuServidor";
this.menuServidor.Size = new System.Drawing.Size(62, 20);
this.menuServidor.Text = "Servidor";
//
// menuBuscarServidor
//
this.menuBuscarServidor.Name = "menuBuscarServidor";
this.menuBuscarServidor.Size = new System.Drawing.Size(155, 22);
this.menuBuscarServidor.Text = "Buscar Servidor";
this.menuBuscarServidor.Click += new System.EventHandler(this.menuBuscarServidor_Click);
//
// menuBaseDatos
//
this.menuBaseDatos.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuConectarA,
this.menuConectarPRUEBAS});
this.menuBaseDatos.Name = "menuBaseDatos";
this.menuBaseDatos.Size = new System.Drawing.Size(92, 20);
this.menuBaseDatos.Text = "Base de Datos";
//
// menuConectarA
//
this.menuConectarA.Name = "menuConectarA";
this.menuConectarA.Size = new System.Drawing.Size(183, 22);
this.menuConectarA.Text = "Conectar a...";
this.menuConectarA.Click += new System.EventHandler(this.menuConectarA_Click);
//
// menuConectarPRUEBAS
//
this.menuConectarPRUEBAS.Name = "menuConectarPRUEBAS";
this.menuConectarPRUEBAS.Size = new System.Drawing.Size(183, 22);
this.menuConectarPRUEBAS.Text = "Conectar a PRUEBAS";
this.menuConectarPRUEBAS.Click += new System.EventHandler(this.menuConectarPRUEBAS_Click);
//
// flowpnlWindows
//
this.flowpnlWindows.AutoSize = true;
this.flowpnlWindows.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowpnlWindows.Dock = System.Windows.Forms.DockStyle.Top;
this.flowpnlWindows.Location = new System.Drawing.Point(0, 24);
this.flowpnlWindows.Name = "flowpnlWindows";
this.flowpnlWindows.Size = new System.Drawing.Size(800, 0);
this.flowpnlWindows.TabIndex = 6;
//
// FrmPrincipal
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 601);
this.Controls.Add(this.flowpnlWindows);
this.Controls.Add(this.menuPrincipal);
this.IsMdiContainer = true;
this.MainMenuStrip = this.menuPrincipal;
this.Name = "FrmPrincipal";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Explorador de Servidores";
this.MdiChildActivate += new System.EventHandler(this.FrmPrincipal_MdiChildActivate);
this.menuPrincipal.ResumeLayout(false);
this.menuPrincipal.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.MenuStrip menuPrincipal;
private System.Windows.Forms.ToolStripMenuItem menuServidor;
private System.Windows.Forms.ToolStripMenuItem menuBuscarServidor;
private System.Windows.Forms.ToolStripMenuItem menuBaseDatos;
private System.Windows.Forms.ToolStripMenuItem menuConectarA;
private System.Windows.Forms.ToolStripMenuItem menuConectarPRUEBAS;
private System.Windows.Forms.FlowLayoutPanel flowpnlWindows;
}
namespace ServerExplorer.UI
{
partial class FrmPrincipal
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.menuPrincipal = new System.Windows.Forms.MenuStrip();
this.menuServidor = new System.Windows.Forms.ToolStripMenuItem();
this.menuBuscarServidor = new System.Windows.Forms.ToolStripMenuItem();
this.menuBaseDatos = new System.Windows.Forms.ToolStripMenuItem();
this.menuConectarA = new System.Windows.Forms.ToolStripMenuItem();
this.menuConectarPRUEBAS = new System.Windows.Forms.ToolStripMenuItem();
this.flowpnlWindows = new System.Windows.Forms.FlowLayoutPanel();
this.menuPrincipal.SuspendLayout();
this.SuspendLayout();
//
// menuPrincipal
//
this.menuPrincipal.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuServidor,
this.menuBaseDatos});
this.menuPrincipal.Location = new System.Drawing.Point(0, 0);
this.menuPrincipal.Name = "menuPrincipal";
this.menuPrincipal.Size = new System.Drawing.Size(800, 24);
this.menuPrincipal.TabIndex = 4;
this.menuPrincipal.Text = "menuPrincipal";
//
// menuServidor
//
this.menuServidor.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuBuscarServidor});
this.menuServidor.Name = "menuServidor";
this.menuServidor.Size = new System.Drawing.Size(62, 20);
this.menuServidor.Text = "Servidor";
//
// menuBuscarServidor
//
this.menuBuscarServidor.Name = "menuBuscarServidor";
this.menuBuscarServidor.Size = new System.Drawing.Size(155, 22);
this.menuBuscarServidor.Text = "Buscar Servidor";
this.menuBuscarServidor.Click += new System.EventHandler(this.menuBuscarServidor_Click);
//
// menuBaseDatos
//
this.menuBaseDatos.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuConectarA,
this.menuConectarPRUEBAS});
this.menuBaseDatos.Name = "menuBaseDatos";
this.menuBaseDatos.Size = new System.Drawing.Size(92, 20);
this.menuBaseDatos.Text = "Base de Datos";
//
// menuConectarA
//
this.menuConectarA.Name = "menuConectarA";
this.menuConectarA.Size = new System.Drawing.Size(183, 22);
this.menuConectarA.Text = "Conectar a...";
this.menuConectarA.Click += new System.EventHandler(this.menuConectarA_Click);
//
// menuConectarPRUEBAS
//
this.menuConectarPRUEBAS.Name = "menuConectarPRUEBAS";
this.menuConectarPRUEBAS.Size = new System.Drawing.Size(183, 22);
this.menuConectarPRUEBAS.Text = "Conectar a PRUEBAS";
this.menuConectarPRUEBAS.Click += new System.EventHandler(this.menuConectarPRUEBAS_Click);
//
// flowpnlWindows
//
this.flowpnlWindows.AutoSize = true;
this.flowpnlWindows.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowpnlWindows.Dock = System.Windows.Forms.DockStyle.Top;
this.flowpnlWindows.Location = new System.Drawing.Point(0, 24);
this.flowpnlWindows.Name = "flowpnlWindows";
this.flowpnlWindows.Size = new System.Drawing.Size(800, 0);
this.flowpnlWindows.TabIndex = 6;
//
// FrmPrincipal
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 601);
this.Controls.Add(this.flowpnlWindows);
this.Controls.Add(this.menuPrincipal);
this.IsMdiContainer = true;
this.MainMenuStrip = this.menuPrincipal;
this.Name = "FrmPrincipal";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Explorador de Servidores";
this.MdiChildActivate += new System.EventHandler(this.FrmPrincipal_MdiChildActivate);
this.menuPrincipal.ResumeLayout(false);
this.menuPrincipal.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.MenuStrip menuPrincipal;
private System.Windows.Forms.ToolStripMenuItem menuServidor;
private System.Windows.Forms.ToolStripMenuItem menuBuscarServidor;
private System.Windows.Forms.ToolStripMenuItem menuBaseDatos;
private System.Windows.Forms.ToolStripMenuItem menuConectarA;
private System.Windows.Forms.ToolStripMenuItem menuConectarPRUEBAS;
private System.Windows.Forms.FlowLayoutPanel flowpnlWindows;
}
}

View File

@@ -1,116 +1,116 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ServerExplorer.Code;
using ServerExplorer.Controls;
namespace ServerExplorer.UI
{
public partial class FrmPrincipal : Form
{
#region Declarations
private static FrmPrincipal _currentInstance;
#endregion
#region Creator
public FrmPrincipal()
{
_currentInstance = this;
InitializeComponent();
}
#endregion
#region WindowList
private List<Form> listChilds = new List<Form>();
public static void AddForm(Form frm)
{
frm.MdiParent = _currentInstance;
frm.WindowState = FormWindowState.Maximized;
frm.Show();
_currentInstance.listChilds.Add(frm);
frm.FormClosed += _currentInstance.FrmPrincipal_OnChildClose;
_currentInstance.RefreshWindowButtons();
}
protected void FrmPrincipal_OnChildClose(object sender, FormClosedEventArgs e)
{
listChilds.Remove((Form)sender);
RefreshWindowButtons();
}
private void FrmPrincipal_MdiChildActivate(object sender, EventArgs e)
{
RefreshWindowButtons();
}
private void RefreshWindowButtons()
{
int childCount = listChilds.Count;
int delta = childCount - flowpnlWindows.Controls.Count;
if (delta < 0)
{
int dest = flowpnlWindows.Controls.Count + delta;
for (int i = flowpnlWindows.Controls.Count - 1; i >= dest; i--)
{
flowpnlWindows.Controls.RemoveAt(i);
}
}
else if (delta > 0)
{
for (int i = 0; i < delta; i++)
{
flowpnlWindows.Controls.Add(new WindowButton());
}
}
for (int i = 0; i < childCount; i++)
{
WindowButton btn = (WindowButton)flowpnlWindows.Controls[i];
Form frm = listChilds[i];
btn.Text = frm.Text;
btn.Window = frm;
btn.Active = (frm == ActiveMdiChild);
}
}
#endregion
#region Menus
private void menuConectarPRUEBAS_Click(object sender, EventArgs e)
{
// Crear ventana de la base de datos de pruebas
var frm = new FrmBaseDatos("Data Source=SSSRV3;Initial Catalog=PRUEBAS;User ID=sa;Password=SLsssrv3");
//frmBaseDatos frm = new frmBaseDatos("Data Source=DANTE;Initial Catalog=BD_AlfonsoRodriguez;Integrated Security=True");
//frmBaseDatos frm = new frmBaseDatos("Data Source=OSKURITO;Initial Catalog=BD_AlfonsoRodriguez;Integrated Security=True");
FrmPrincipal.AddForm(frm);
}
private void menuBuscarServidor_Click(object sender, EventArgs e)
{
// Mostrar ventana de buscador de servidores
var frm = new FrmServidores();
FrmPrincipal.AddForm(frm);
}
private void menuConectarA_Click(object sender, EventArgs e)
{
// Cargar configuracion
var dialogo = new OpenFileDialog();
if (dialogo.ShowDialog() != DialogResult.OK) return;
Config config = Config.Cargar(dialogo.FileName);
// Crear y mostrar ventana
var frm = new FrmBaseDatos(config);
FrmPrincipal.AddForm(frm);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ServerExplorer.Code;
using ServerExplorer.Controls;
namespace ServerExplorer.UI
{
public partial class FrmPrincipal : Form
{
#region Declarations
private static FrmPrincipal _currentInstance;
#endregion
#region Creator
public FrmPrincipal()
{
_currentInstance = this;
InitializeComponent();
}
#endregion
#region WindowList
private List<Form> listChilds = new List<Form>();
public static void AddForm(Form frm)
{
frm.MdiParent = _currentInstance;
frm.WindowState = FormWindowState.Maximized;
frm.Show();
_currentInstance.listChilds.Add(frm);
frm.FormClosed += _currentInstance.FrmPrincipal_OnChildClose;
_currentInstance.RefreshWindowButtons();
}
protected void FrmPrincipal_OnChildClose(object sender, FormClosedEventArgs e)
{
listChilds.Remove((Form)sender);
RefreshWindowButtons();
}
private void FrmPrincipal_MdiChildActivate(object sender, EventArgs e)
{
RefreshWindowButtons();
}
private void RefreshWindowButtons()
{
int childCount = listChilds.Count;
int delta = childCount - flowpnlWindows.Controls.Count;
if (delta < 0)
{
int dest = flowpnlWindows.Controls.Count + delta;
for (int i = flowpnlWindows.Controls.Count - 1; i >= dest; i--)
{
flowpnlWindows.Controls.RemoveAt(i);
}
}
else if (delta > 0)
{
for (int i = 0; i < delta; i++)
{
flowpnlWindows.Controls.Add(new WindowButton());
}
}
for (int i = 0; i < childCount; i++)
{
WindowButton btn = (WindowButton)flowpnlWindows.Controls[i];
Form frm = listChilds[i];
btn.Text = frm.Text;
btn.Window = frm;
btn.Active = (frm == ActiveMdiChild);
}
}
#endregion
#region Menus
private void menuConectarPRUEBAS_Click(object sender, EventArgs e)
{
// Crear ventana de la base de datos de pruebas
var frm = new FrmBaseDatos("Data Source=localhost;Initial Catalog=Tests;Integrated Security=True");
//frmBaseDatos frm = new frmBaseDatos("Data Source=DANTE;Initial Catalog=BD_AlfonsoRodriguez;Integrated Security=True");
//frmBaseDatos frm = new frmBaseDatos("Data Source=OSKURITO;Initial Catalog=BD_AlfonsoRodriguez;Integrated Security=True");
FrmPrincipal.AddForm(frm);
}
private void menuBuscarServidor_Click(object sender, EventArgs e)
{
// Mostrar ventana de buscador de servidores
var frm = new FrmServidores();
FrmPrincipal.AddForm(frm);
}
private void menuConectarA_Click(object sender, EventArgs e)
{
// Cargar configuracion
var dialogo = new OpenFileDialog();
if (dialogo.ShowDialog() != DialogResult.OK) return;
Config config = Config.Cargar(dialogo.FileName);
// Crear y mostrar ventana
var frm = new FrmBaseDatos(config);
FrmPrincipal.AddForm(frm);
}
#endregion
}
}

View File

@@ -1,126 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuPrincipal.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>14, 6</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>32</value>
</metadata>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuPrincipal.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>14, 6</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>32</value>
</metadata>
</root>

View File

@@ -1,160 +1,160 @@
namespace ServerExplorer.UI
{
partial class FrmProcedimientos
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lsvProcs = new ServerExplorer.Controls.CustomListView();
this.colNombre = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colSchema = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colFecha = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colTipo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.txtProc = new ServerExplorer.Controls.CustomTextBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnRefresh = new System.Windows.Forms.Button();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// lsvProcs
//
this.lsvProcs.Activation = System.Windows.Forms.ItemActivation.OneClick;
this.lsvProcs.AllowSorting = true;
this.lsvProcs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvProcs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colNombre,
this.colSchema,
this.colFecha,
this.colTipo});
this.lsvProcs.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lsvProcs.FullRowSelect = true;
this.lsvProcs.GridLines = true;
this.lsvProcs.Location = new System.Drawing.Point(0, 0);
this.lsvProcs.Name = "lsvProcs";
this.lsvProcs.Size = new System.Drawing.Size(352, 449);
this.lsvProcs.TabIndex = 0;
this.lsvProcs.UseCompatibleStateImageBehavior = false;
this.lsvProcs.View = System.Windows.Forms.View.Details;
this.lsvProcs.SelectedIndexChanged += new System.EventHandler(this.lsvProcs_SelectedIndexChanged);
//
// colNombre
//
this.colNombre.Text = "Nombre";
this.colNombre.Width = 120;
//
// colSchema
//
this.colSchema.Text = "Schema";
//
// colFecha
//
this.colFecha.Text = "Fecha";
this.colFecha.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.colFecha.Width = 84;
//
// colTipo
//
this.colTipo.Text = "Tipo";
//
// txtProc
//
this.txtProc.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtProc.Font = new System.Drawing.Font("Lucida Console", 8.25F);
this.txtProc.Location = new System.Drawing.Point(3, 3);
this.txtProc.Multiline = true;
this.txtProc.Name = "txtProc";
this.txtProc.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.txtProc.Size = new System.Drawing.Size(352, 475);
this.txtProc.TabIndex = 1;
this.txtProc.TabWidth = 4;
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(12, 12);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnRefresh);
this.splitContainer1.Panel1.Controls.Add(this.lsvProcs);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.txtProc);
this.splitContainer1.Size = new System.Drawing.Size(717, 481);
this.splitContainer1.SplitterDistance = 355;
this.splitContainer1.TabIndex = 2;
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRefresh.Location = new System.Drawing.Point(3, 455);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(75, 23);
this.btnRefresh.TabIndex = 1;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// FrmProcedimientos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(741, 505);
this.Controls.Add(this.splitContainer1);
this.Name = "FrmProcedimientos";
this.Text = "frmProcedimientos";
this.Load += new System.EventHandler(this.frmProcedimientos_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private ServerExplorer.Controls.CustomListView lsvProcs;
private System.Windows.Forms.ColumnHeader colNombre;
private System.Windows.Forms.ColumnHeader colFecha;
private ServerExplorer.Controls.CustomTextBox txtProc;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ColumnHeader colTipo;
private System.Windows.Forms.ColumnHeader colSchema;
private System.Windows.Forms.Button btnRefresh;
}
namespace ServerExplorer.UI
{
partial class FrmProcedimientos
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lsvProcs = new ServerExplorer.Controls.CustomListView();
this.colNombre = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colSchema = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colFecha = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colTipo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.txtProc = new ServerExplorer.Controls.CustomTextBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnRefresh = new System.Windows.Forms.Button();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// lsvProcs
//
this.lsvProcs.Activation = System.Windows.Forms.ItemActivation.OneClick;
this.lsvProcs.AllowSorting = true;
this.lsvProcs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvProcs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colNombre,
this.colSchema,
this.colFecha,
this.colTipo});
this.lsvProcs.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lsvProcs.FullRowSelect = true;
this.lsvProcs.GridLines = true;
this.lsvProcs.Location = new System.Drawing.Point(0, 0);
this.lsvProcs.Name = "lsvProcs";
this.lsvProcs.Size = new System.Drawing.Size(352, 449);
this.lsvProcs.TabIndex = 0;
this.lsvProcs.UseCompatibleStateImageBehavior = false;
this.lsvProcs.View = System.Windows.Forms.View.Details;
this.lsvProcs.SelectedIndexChanged += new System.EventHandler(this.lsvProcs_SelectedIndexChanged);
//
// colNombre
//
this.colNombre.Text = "Nombre";
this.colNombre.Width = 120;
//
// colSchema
//
this.colSchema.Text = "Schema";
//
// colFecha
//
this.colFecha.Text = "Fecha";
this.colFecha.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.colFecha.Width = 84;
//
// colTipo
//
this.colTipo.Text = "Tipo";
//
// txtProc
//
this.txtProc.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtProc.Font = new System.Drawing.Font("Lucida Console", 8.25F);
this.txtProc.Location = new System.Drawing.Point(3, 3);
this.txtProc.Multiline = true;
this.txtProc.Name = "txtProc";
this.txtProc.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.txtProc.Size = new System.Drawing.Size(352, 475);
this.txtProc.TabIndex = 1;
this.txtProc.TabWidth = 4;
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(12, 12);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnRefresh);
this.splitContainer1.Panel1.Controls.Add(this.lsvProcs);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.txtProc);
this.splitContainer1.Size = new System.Drawing.Size(717, 481);
this.splitContainer1.SplitterDistance = 355;
this.splitContainer1.TabIndex = 2;
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRefresh.Location = new System.Drawing.Point(3, 455);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(75, 23);
this.btnRefresh.TabIndex = 1;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// FrmProcedimientos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(741, 505);
this.Controls.Add(this.splitContainer1);
this.Name = "FrmProcedimientos";
this.Text = "frmProcedimientos";
this.Load += new System.EventHandler(this.frmProcedimientos_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private ServerExplorer.Controls.CustomListView lsvProcs;
private System.Windows.Forms.ColumnHeader colNombre;
private System.Windows.Forms.ColumnHeader colFecha;
private ServerExplorer.Controls.CustomTextBox txtProc;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ColumnHeader colTipo;
private System.Windows.Forms.ColumnHeader colSchema;
private System.Windows.Forms.Button btnRefresh;
}
}

View File

@@ -1,105 +1,115 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace ServerExplorer.UI
{
public partial class FrmProcedimientos : Form
{
#region Declarations
private readonly SqlConnection _cnx;
#endregion
#region Form life cycle
public FrmProcedimientos(string cnxString)
{
InitializeComponent();
_cnx = new SqlConnection(cnxString);
}
private void frmProcedimientos_Load(object sender, EventArgs e)
{
LoadProcedures();
}
#endregion
#region Events
private void lsvProcs_SelectedIndexChanged(object sender, EventArgs e)
{
if (lsvProcs.SelectedItems.Count <= 0) { return; }
string name = lsvProcs.SelectedItems[0].SubItems[0].Text;
string schema = lsvProcs.SelectedItems[0].SubItems[1].Text;
LoadProcedure(schema, name);
}
private void btnRefresh_Click(object sender, EventArgs e)
{
LoadProcedures();
}
#endregion
#region Private methods
private void LoadProcedures()
{
// Obtener un datatable con todos los procedimientos de la base de datos.
var da = new SqlDataAdapter(
"SELECT ROUTINE_NAME Name, ROUTINE_SCHEMA [Schema], CREATED CreateDate, ROUTINE_TYPE [Type] FROM INFORMATION_SCHEMA.ROUTINES",
_cnx);
var dt = new DataTable();
_cnx.Open();
da.Fill(dt);
_cnx.Close();
// Mostrar todos los procedimientos
lsvProcs.Items.Clear();
foreach (DataRow dr in dt.Rows)
{
ListViewItem item = lsvProcs.Items.Add((String)dr["Name"]);
item.SubItems.Add((string)dr["Schema"]);
item.SubItems.Add(((DateTime)dr["CreateDate"]).ToShortDateString());
item.SubItems.Add((string)dr["Type"]);
}
}
private void LoadProcedure(string schema, string name)
{
var da = new SqlDataAdapter(@"
SELECT
ISNULL(smsp.definition, ssmsp.definition) AS [Definition]
FROM sys.all_objects AS sp
LEFT OUTER JOIN sys.sql_modules AS smsp ON smsp.object_id = sp.object_id
LEFT OUTER JOIN sys.system_sql_modules AS ssmsp ON ssmsp.object_id = sp.object_id
WHERE
(sp.type = N'P' OR sp.type = N'RF' OR sp.type='PC')
and
(sp.name=@name and SCHEMA_NAME(sp.schema_id)=@schema)
", _cnx);
da.SelectCommand.Parameters.AddWithValue("@Name", name);
da.SelectCommand.Parameters.AddWithValue("@Schema", schema);
var dt = new DataTable();
_cnx.Open();
da.Fill(dt);
_cnx.Close();
// Mostrar el contenido del procedimiento
txtProc.Text = String.Empty;
foreach (DataRow dr in dt.Rows)
{
txtProc.Text += ((string)dr[0]).Replace("\r", "").Replace("\n", "\r\n");
}
}
#endregion
}
}
using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace ServerExplorer.UI
{
public partial class FrmProcedimientos : Form
{
#region Declarations
private readonly SqlConnection _cnx;
#endregion
#region Form life cycle
public FrmProcedimientos(string cnxString)
{
InitializeComponent();
_cnx = new SqlConnection(cnxString);
}
private void frmProcedimientos_Load(object sender, EventArgs e)
{
LoadProcedures();
}
#endregion
#region Events
private void lsvProcs_SelectedIndexChanged(object sender, EventArgs e)
{
if (lsvProcs.SelectedItems.Count <= 0) { return; }
string name = lsvProcs.SelectedItems[0].SubItems[0].Text;
string schema = lsvProcs.SelectedItems[0].SubItems[1].Text;
LoadProcedure(schema, name);
}
private void btnRefresh_Click(object sender, EventArgs e)
{
LoadProcedures();
}
#endregion
#region Private methods
private void LoadProcedures()
{
// Obtener un datatable con todos los procedimientos de la base de datos.
var da = new SqlDataAdapter(
"SELECT ROUTINE_NAME Name, ROUTINE_SCHEMA [Schema], CREATED CreateDate, ROUTINE_TYPE [Type] FROM INFORMATION_SCHEMA.ROUTINES",
_cnx);
var dt = new DataTable();
_cnx.Open();
da.Fill(dt);
_cnx.Close();
// Mostrar todos los procedimientos
lsvProcs.Items.Clear();
foreach (DataRow dr in dt.Rows)
{
ListViewItem item = lsvProcs.Items.Add((String)dr["Name"]);
item.SubItems.Add((string)dr["Schema"]);
item.SubItems.Add(((DateTime)dr["CreateDate"]).ToShortDateString());
item.SubItems.Add((string)dr["Type"]);
}
}
private void LoadProcedure(string schema, string name)
{
SqlDataAdapter dataAdapter;
_cnx.Open();
if (_cnx.ServerVersion.StartsWith("10."))
{
dataAdapter = new SqlDataAdapter(@"
SELECT
ISNULL(smsp.definition, ssmsp.definition) AS [Definition]
FROM sys.all_objects AS sp
INNER JOIN sys.schemas sn ON sp.schema_id = sn.schema_id
LEFT OUTER JOIN sys.sql_modules AS smsp ON smsp.object_id = sp.object_id
LEFT OUTER JOIN sys.system_sql_modules AS ssmsp ON ssmsp.object_id = sp.object_id
WHERE
(sp.type = N'P' OR sp.type = N'RF' OR sp.type = N'PC' OR sp.type = N'IF' OR sp.type = N'FN' OR sp.type = N'TF')
AND
(sp.name = @name and sn.name = @schema)
", _cnx);
dataAdapter.SelectCommand.Parameters.AddWithValue("@Name", name);
dataAdapter.SelectCommand.Parameters.AddWithValue("@Schema", schema);
}
else
{
return;
}
var dt = new DataTable();
dataAdapter.Fill(dt);
_cnx.Close();
// Mostrar el contenido del procedimiento
txtProc.Text = String.Empty;
foreach (DataRow dr in dt.Rows)
{
txtProc.Text += ((string)dr[0]).Replace("\r", "").Replace("\n", "\r\n");
}
}
#endregion
}
}

View File

@@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,258 +1,257 @@
namespace ServerExplorer.UI
{
partial class FrmServidores
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lsvServidores = new ServerExplorer.Controls.CustomListView();
this.colNombreServidor = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colInstancia = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.btnListarServidores = new System.Windows.Forms.Button();
this.lblServidor = new System.Windows.Forms.Label();
this.txtServidor = new ServerExplorer.Controls.CustomTextBox();
this.lblUsuario = new System.Windows.Forms.Label();
this.lblContrasenha = new System.Windows.Forms.Label();
this.txtUsuario = new ServerExplorer.Controls.CustomTextBox();
this.TxtContrasenha = new ServerExplorer.Controls.CustomTextBox();
this.btnListarBBDD = new System.Windows.Forms.Button();
this.lsvBBDD = new ServerExplorer.Controls.CustomListView();
this.colDBName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colFechaCreacion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// lsvServidores
//
this.lsvServidores.AllowSorting = true;
this.lsvServidores.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvServidores.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colNombreServidor,
this.colInstancia,
this.colVersion});
this.lsvServidores.FullRowSelect = true;
this.lsvServidores.Location = new System.Drawing.Point(3, 32);
this.lsvServidores.Name = "lsvServidores";
this.lsvServidores.Size = new System.Drawing.Size(306, 386);
this.lsvServidores.TabIndex = 1;
this.lsvServidores.UseCompatibleStateImageBehavior = false;
this.lsvServidores.View = System.Windows.Forms.View.Details;
this.lsvServidores.SelectedIndexChanged += new System.EventHandler(this.lsvServidores_SelectedIndexChanged);
//
// colNombreServidor
//
this.colNombreServidor.Text = "Servidor";
this.colNombreServidor.Width = 110;
//
// colInstancia
//
this.colInstancia.Text = "Instancia";
this.colInstancia.Width = 94;
//
// colVersion
//
this.colVersion.Text = "Version";
this.colVersion.Width = 73;
//
// btnListarServidores
//
this.btnListarServidores.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnListarServidores.Location = new System.Drawing.Point(3, 3);
this.btnListarServidores.Name = "btnListarServidores";
this.btnListarServidores.Size = new System.Drawing.Size(306, 23);
this.btnListarServidores.TabIndex = 2;
this.btnListarServidores.Text = "Listar Servidores";
this.btnListarServidores.UseVisualStyleBackColor = true;
this.btnListarServidores.Click += new System.EventHandler(this.btnListarServidores_Click);
//
// lblServidor
//
this.lblServidor.AutoSize = true;
this.lblServidor.Location = new System.Drawing.Point(3, 8);
this.lblServidor.Name = "lblServidor";
this.lblServidor.Size = new System.Drawing.Size(46, 13);
this.lblServidor.TabIndex = 3;
this.lblServidor.Text = "Servidor";
//
// txtServidor
//
this.txtServidor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtServidor.Location = new System.Drawing.Point(70, 6);
this.txtServidor.Name = "txtServidor";
this.txtServidor.Size = new System.Drawing.Size(218, 20);
this.txtServidor.TabIndex = 4;
//
// lblUsuario
//
this.lblUsuario.AutoSize = true;
this.lblUsuario.Location = new System.Drawing.Point(3, 35);
this.lblUsuario.Name = "lblUsuario";
this.lblUsuario.Size = new System.Drawing.Size(43, 13);
this.lblUsuario.TabIndex = 5;
this.lblUsuario.Text = "Usuario";
//
// lblContrasenha
//
this.lblContrasenha.AutoSize = true;
this.lblContrasenha.Location = new System.Drawing.Point(3, 61);
this.lblContrasenha.Name = "lblContrasenha";
this.lblContrasenha.Size = new System.Drawing.Size(61, 13);
this.lblContrasenha.TabIndex = 6;
this.lblContrasenha.Text = "Contraseña";
//
// txtUsuario
//
this.txtUsuario.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtUsuario.Location = new System.Drawing.Point(70, 32);
this.txtUsuario.Name = "txtUsuario";
this.txtUsuario.Size = new System.Drawing.Size(218, 20);
this.txtUsuario.TabIndex = 7;
//
// TxtContrasenha
//
this.TxtContrasenha.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TxtContrasenha.Location = new System.Drawing.Point(70, 58);
this.TxtContrasenha.Name = "TxtContrasenha";
this.TxtContrasenha.Size = new System.Drawing.Size(218, 20);
this.TxtContrasenha.TabIndex = 8;
this.TxtContrasenha.UseSystemPasswordChar = true;
//
// btnListarBBDD
//
this.btnListarBBDD.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnListarBBDD.Location = new System.Drawing.Point(6, 84);
this.btnListarBBDD.Name = "btnListarBBDD";
this.btnListarBBDD.Size = new System.Drawing.Size(282, 23);
this.btnListarBBDD.TabIndex = 9;
this.btnListarBBDD.Text = "Listar BBDD";
this.btnListarBBDD.UseVisualStyleBackColor = true;
this.btnListarBBDD.Click += new System.EventHandler(this.btnListarBBDD_Click);
//
// lsvBBDD
//
this.lsvBBDD.AllowSorting = true;
this.lsvBBDD.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvBBDD.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colDBName,
this.colFechaCreacion});
this.lsvBBDD.FullRowSelect = true;
this.lsvBBDD.Location = new System.Drawing.Point(6, 113);
this.lsvBBDD.Name = "lsvBBDD";
this.lsvBBDD.Size = new System.Drawing.Size(282, 305);
this.lsvBBDD.TabIndex = 11;
this.lsvBBDD.UseCompatibleStateImageBehavior = false;
this.lsvBBDD.View = System.Windows.Forms.View.Details;
this.lsvBBDD.DoubleClick += new System.EventHandler(this.lsvBBDD_DoubleClick);
//
// colDBName
//
this.colDBName.Text = "Base de Datos";
this.colDBName.Width = 165;
//
// colFechaCreacion
//
this.colFechaCreacion.Text = "Fecha de Creacion";
this.colFechaCreacion.Width = 107;
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.Location = new System.Drawing.Point(12, 12);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.lsvServidores);
this.splitContainer1.Panel1.Controls.Add(this.btnListarServidores);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.lblServidor);
this.splitContainer1.Panel2.Controls.Add(this.lsvBBDD);
this.splitContainer1.Panel2.Controls.Add(this.txtServidor);
this.splitContainer1.Panel2.Controls.Add(this.btnListarBBDD);
this.splitContainer1.Panel2.Controls.Add(this.lblUsuario);
this.splitContainer1.Panel2.Controls.Add(this.lblContrasenha);
this.splitContainer1.Panel2.Controls.Add(this.TxtContrasenha);
this.splitContainer1.Panel2.Controls.Add(this.txtUsuario);
this.splitContainer1.Size = new System.Drawing.Size(607, 421);
this.splitContainer1.SplitterDistance = 312;
this.splitContainer1.TabIndex = 12;
//
// FrmServidores
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(631, 445);
this.Controls.Add(this.splitContainer1);
this.Name = "FrmServidores";
this.Text = "Servidores";
this.Load += new System.EventHandler(this.Form1_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private ServerExplorer.Controls.CustomListView lsvServidores;
private System.Windows.Forms.Button btnListarServidores;
private System.Windows.Forms.ColumnHeader colNombreServidor;
private System.Windows.Forms.ColumnHeader colInstancia;
private System.Windows.Forms.ColumnHeader colVersion;
private System.Windows.Forms.Label lblServidor;
private ServerExplorer.Controls.CustomTextBox txtServidor;
private System.Windows.Forms.Label lblUsuario;
private System.Windows.Forms.Label lblContrasenha;
private ServerExplorer.Controls.CustomTextBox txtUsuario;
private ServerExplorer.Controls.CustomTextBox TxtContrasenha;
private System.Windows.Forms.Button btnListarBBDD;
private ServerExplorer.Controls.CustomListView lsvBBDD;
private System.Windows.Forms.ColumnHeader colDBName;
private System.Windows.Forms.ColumnHeader colFechaCreacion;
private System.Windows.Forms.SplitContainer splitContainer1;
}
}
namespace ServerExplorer.UI
{
partial class FrmServidores
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lsvServidores = new ServerExplorer.Controls.CustomListView();
this.colNombreServidor = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colInstancia = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.btnListarServidores = new System.Windows.Forms.Button();
this.lblServidor = new System.Windows.Forms.Label();
this.txtServidor = new ServerExplorer.Controls.CustomTextBox();
this.lblUsuario = new System.Windows.Forms.Label();
this.lblContrasenha = new System.Windows.Forms.Label();
this.txtUsuario = new ServerExplorer.Controls.CustomTextBox();
this.TxtContrasenha = new ServerExplorer.Controls.CustomTextBox();
this.btnListarBBDD = new System.Windows.Forms.Button();
this.lsvBBDD = new ServerExplorer.Controls.CustomListView();
this.colDBName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colFechaCreacion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// lsvServidores
//
this.lsvServidores.AllowSorting = true;
this.lsvServidores.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvServidores.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colNombreServidor,
this.colInstancia,
this.colVersion});
this.lsvServidores.FullRowSelect = true;
this.lsvServidores.Location = new System.Drawing.Point(3, 32);
this.lsvServidores.Name = "lsvServidores";
this.lsvServidores.Size = new System.Drawing.Size(306, 386);
this.lsvServidores.TabIndex = 1;
this.lsvServidores.UseCompatibleStateImageBehavior = false;
this.lsvServidores.View = System.Windows.Forms.View.Details;
this.lsvServidores.SelectedIndexChanged += new System.EventHandler(this.lsvServidores_SelectedIndexChanged);
//
// colNombreServidor
//
this.colNombreServidor.Text = "Servidor";
this.colNombreServidor.Width = 110;
//
// colInstancia
//
this.colInstancia.Text = "Instancia";
this.colInstancia.Width = 94;
//
// colVersion
//
this.colVersion.Text = "Version";
this.colVersion.Width = 73;
//
// btnListarServidores
//
this.btnListarServidores.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnListarServidores.Location = new System.Drawing.Point(3, 3);
this.btnListarServidores.Name = "btnListarServidores";
this.btnListarServidores.Size = new System.Drawing.Size(306, 23);
this.btnListarServidores.TabIndex = 2;
this.btnListarServidores.Text = "Listar Servidores";
this.btnListarServidores.UseVisualStyleBackColor = true;
this.btnListarServidores.Click += new System.EventHandler(this.btnListarServidores_Click);
//
// lblServidor
//
this.lblServidor.AutoSize = true;
this.lblServidor.Location = new System.Drawing.Point(3, 8);
this.lblServidor.Name = "lblServidor";
this.lblServidor.Size = new System.Drawing.Size(46, 13);
this.lblServidor.TabIndex = 3;
this.lblServidor.Text = "Servidor";
//
// txtServidor
//
this.txtServidor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtServidor.Location = new System.Drawing.Point(70, 6);
this.txtServidor.Name = "txtServidor";
this.txtServidor.Size = new System.Drawing.Size(218, 20);
this.txtServidor.TabIndex = 4;
//
// lblUsuario
//
this.lblUsuario.AutoSize = true;
this.lblUsuario.Location = new System.Drawing.Point(3, 35);
this.lblUsuario.Name = "lblUsuario";
this.lblUsuario.Size = new System.Drawing.Size(43, 13);
this.lblUsuario.TabIndex = 5;
this.lblUsuario.Text = "Usuario";
//
// lblContrasenha
//
this.lblContrasenha.AutoSize = true;
this.lblContrasenha.Location = new System.Drawing.Point(3, 61);
this.lblContrasenha.Name = "lblContrasenha";
this.lblContrasenha.Size = new System.Drawing.Size(61, 13);
this.lblContrasenha.TabIndex = 6;
this.lblContrasenha.Text = "Contraseña";
//
// txtUsuario
//
this.txtUsuario.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtUsuario.Location = new System.Drawing.Point(70, 32);
this.txtUsuario.Name = "txtUsuario";
this.txtUsuario.Size = new System.Drawing.Size(218, 20);
this.txtUsuario.TabIndex = 7;
//
// TxtContrasenha
//
this.TxtContrasenha.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TxtContrasenha.Location = new System.Drawing.Point(70, 58);
this.TxtContrasenha.Name = "TxtContrasenha";
this.TxtContrasenha.Size = new System.Drawing.Size(218, 20);
this.TxtContrasenha.TabIndex = 8;
this.TxtContrasenha.UseSystemPasswordChar = true;
//
// btnListarBBDD
//
this.btnListarBBDD.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnListarBBDD.Location = new System.Drawing.Point(6, 84);
this.btnListarBBDD.Name = "btnListarBBDD";
this.btnListarBBDD.Size = new System.Drawing.Size(282, 23);
this.btnListarBBDD.TabIndex = 9;
this.btnListarBBDD.Text = "Listar BBDD";
this.btnListarBBDD.UseVisualStyleBackColor = true;
this.btnListarBBDD.Click += new System.EventHandler(this.btnListarBBDD_Click);
//
// lsvBBDD
//
this.lsvBBDD.AllowSorting = true;
this.lsvBBDD.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lsvBBDD.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colDBName,
this.colFechaCreacion});
this.lsvBBDD.FullRowSelect = true;
this.lsvBBDD.Location = new System.Drawing.Point(6, 113);
this.lsvBBDD.Name = "lsvBBDD";
this.lsvBBDD.Size = new System.Drawing.Size(282, 305);
this.lsvBBDD.TabIndex = 11;
this.lsvBBDD.UseCompatibleStateImageBehavior = false;
this.lsvBBDD.View = System.Windows.Forms.View.Details;
this.lsvBBDD.DoubleClick += new System.EventHandler(this.lsvBBDD_DoubleClick);
//
// colDBName
//
this.colDBName.Text = "Base de Datos";
this.colDBName.Width = 165;
//
// colFechaCreacion
//
this.colFechaCreacion.Text = "Fecha de Creacion";
this.colFechaCreacion.Width = 107;
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.Location = new System.Drawing.Point(12, 12);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.lsvServidores);
this.splitContainer1.Panel1.Controls.Add(this.btnListarServidores);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.lblServidor);
this.splitContainer1.Panel2.Controls.Add(this.lsvBBDD);
this.splitContainer1.Panel2.Controls.Add(this.txtServidor);
this.splitContainer1.Panel2.Controls.Add(this.btnListarBBDD);
this.splitContainer1.Panel2.Controls.Add(this.lblUsuario);
this.splitContainer1.Panel2.Controls.Add(this.lblContrasenha);
this.splitContainer1.Panel2.Controls.Add(this.TxtContrasenha);
this.splitContainer1.Panel2.Controls.Add(this.txtUsuario);
this.splitContainer1.Size = new System.Drawing.Size(607, 421);
this.splitContainer1.SplitterDistance = 312;
this.splitContainer1.TabIndex = 12;
//
// FrmServidores
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(631, 445);
this.Controls.Add(this.splitContainer1);
this.Name = "FrmServidores";
this.Text = "Servidores";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private ServerExplorer.Controls.CustomListView lsvServidores;
private System.Windows.Forms.Button btnListarServidores;
private System.Windows.Forms.ColumnHeader colNombreServidor;
private System.Windows.Forms.ColumnHeader colInstancia;
private System.Windows.Forms.ColumnHeader colVersion;
private System.Windows.Forms.Label lblServidor;
private ServerExplorer.Controls.CustomTextBox txtServidor;
private System.Windows.Forms.Label lblUsuario;
private System.Windows.Forms.Label lblContrasenha;
private ServerExplorer.Controls.CustomTextBox txtUsuario;
private ServerExplorer.Controls.CustomTextBox TxtContrasenha;
private System.Windows.Forms.Button btnListarBBDD;
private ServerExplorer.Controls.CustomListView lsvBBDD;
private System.Windows.Forms.ColumnHeader colDBName;
private System.Windows.Forms.ColumnHeader colFechaCreacion;
private System.Windows.Forms.SplitContainer splitContainer1;
}
}

View File

@@ -1,94 +1,85 @@
using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace ServerExplorer.UI
{
public partial class FrmServidores : Form
{
public FrmServidores()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void btnListarServidores_Click(object sender, EventArgs e)
{
// Obtener listado de servidores
SqlDataSourceEnumerator enumerador = SqlDataSourceEnumerator.Instance;
DataTable servidores = enumerador.GetDataSources();
lsvServidores.Items.Clear();
lsvBBDD.Items.Clear();
foreach (DataRow dr in servidores.Rows)
{
ListViewItem item = lsvServidores.Items.Add((String)dr["ServerName"]);
item.SubItems.Add((dr["InstanceName"] == DBNull.Value) ? string.Empty : (String)dr["InstanceName"]);
item.SubItems.Add((dr["Version"] == DBNull.Value) ? "???" : (String) dr["Version"]);
}
}
private void lsvServidores_SelectedIndexChanged(object sender, EventArgs e)
{
if (lsvServidores.SelectedItems.Count > 0)
{
ListViewItem item = lsvServidores.SelectedItems[0];
txtServidor.Text = String.IsNullOrEmpty(item.SubItems[1].Text)
? item.SubItems[0].Text
: String.Format("{0}/{1}", item.SubItems[0].Text, item.SubItems[1].Text);
}
}
private void btnListarBBDD_Click(object sender, EventArgs e)
{
// Obtener todas las bases de datos
var cnx = new SqlConnection(BuildConnectionString());
cnx.Open();
DataTable dt = cnx.GetSchema("Databases");
cnx.Close();
// Mostrar bases de datos
lsvBBDD.Items.Clear();
foreach (DataRow dr in dt.Rows)
{
ListViewItem item = lsvBBDD.Items.Add((String)dr["database_name"]);
item.SubItems.Add(((DateTime)dr["create_date"]).ToShortDateString());
}
}
private void lsvBBDD_DoubleClick(object sender, EventArgs e)
{
if (lsvBBDD.SelectedItems.Count != 1) return;
// Llamar a la venta de la base de datos
var frm = new FrmBaseDatos(BuildConnectionString());
FrmPrincipal.AddForm(frm);
}
private string BuildConnectionString()
{
// Construir cadena de conexion
var constructor = new SqlConnectionStringBuilder();
constructor.DataSource = (!string.IsNullOrEmpty(txtServidor.Text)) ? txtServidor.Text : "localhost";
if (lsvBBDD.SelectedItems.Count > 0)
{
constructor.InitialCatalog = lsvBBDD.SelectedItems[0].SubItems[0].Text;
}
if (String.IsNullOrEmpty(txtUsuario.Text))
{
constructor.IntegratedSecurity = true;
}
else
{
constructor.UserID = txtUsuario.Text;
constructor.Password = TxtContrasenha.Text;
}
return constructor.ConnectionString;
}
}
}
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Windows.Forms;
using ServerExplorer.Code.DataAccess;
using ServerExplorer.Code.DataTransfer;
namespace ServerExplorer.UI
{
public partial class FrmServidores : Form
{
public FrmServidores()
{
InitializeComponent();
}
private void btnListarServidores_Click(object sender, EventArgs e)
{
List<Server> servers = ServerDA.Server_GetRegs();
lsvServidores.Items.Clear();
lsvBBDD.Items.Clear();
foreach (Server server in servers)
{
ListViewItem item = lsvServidores.Items.Add(server.Name);
item.SubItems.Add(server.Instance);
item.SubItems.Add(server.Version);
}
}
private void lsvServidores_SelectedIndexChanged(object sender, EventArgs e)
{
if (lsvServidores.SelectedItems.Count > 0)
{
ListViewItem item = lsvServidores.SelectedItems[0];
txtServidor.Text = String.IsNullOrEmpty(item.SubItems[1].Text)
? item.SubItems[0].Text
: String.Format("{0}/{1}", item.SubItems[0].Text, item.SubItems[1].Text);
}
}
private void btnListarBBDD_Click(object sender, EventArgs e)
{
List<Database> databases = DatabaseDA.Database_GetRegs(BuildConnectionString());
lsvBBDD.Items.Clear();
foreach (Database database in databases)
{
ListViewItem item = lsvBBDD.Items.Add(database.Name);
item.SubItems.Add(database.CreateDate.ToShortDateString());
}
}
private void lsvBBDD_DoubleClick(object sender, EventArgs e)
{
if (lsvBBDD.SelectedItems.Count != 1) return;
// Llamar a la venta de la base de datos
var frm = new FrmBaseDatos(BuildConnectionString());
FrmPrincipal.AddForm(frm);
}
private string BuildConnectionString()
{
// Construir cadena de conexion
var constructor = new SqlConnectionStringBuilder();
constructor.DataSource = (!string.IsNullOrEmpty(txtServidor.Text)) ? txtServidor.Text : "localhost";
if (lsvBBDD.SelectedItems.Count > 0)
{
constructor.InitialCatalog = lsvBBDD.SelectedItems[0].SubItems[0].Text;
}
if (String.IsNullOrEmpty(txtUsuario.Text))
{
constructor.IntegratedSecurity = true;
}
else
{
constructor.UserID = txtUsuario.Text;
constructor.Password = TxtContrasenha.Text;
}
return constructor.ConnectionString;
}
}
}

View File

@@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>