diff --git a/ServerExplorer/CodeGen.cs b/ServerExplorer/CodeGen.cs deleted file mode 100644 index eed6f68..0000000 --- a/ServerExplorer/CodeGen.cs +++ /dev/null @@ -1,382 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Data; -using ServerExplorer.Code; - -namespace ServerExplorer -{ - public class CodeGen - { - private static string FixNombre(string strIn) - { - return strIn.Replace(' ', '_'); - } - - - public static void GeneraDTO(Config config, TablaDesc t) - { - string nombreObj = FixNombre(t.Esquema) + "_" + FixNombre(t.Nombre); - string nombreFichero = config.PathDTO + "/" + nombreObj + "_DTO.cs"; - EscritorCodigo escritor = new EscritorCodigo(nombreFichero); - - // Cabecera - escritor.Escribe("using System;"); - escritor.Escribe("using System.Data;"); - escritor.Escribe(""); - escritor.EscribeInd("namespace " + config.NamespaceDTO); - - // El objeto de la tabla - escritor.EscribeInd("public partial class " + nombreObj); - foreach (ColumnaDesc c in t.Columnas) - { - string nombre = FixNombre(c.Nombre); - TipoCol tipo = c.GetTipo(); - string sTipo = null; - - // Determinar el tipo a usar - switch (tipo) - { - case TipoCol.Numerico: - sTipo = "int"; break; - case TipoCol.Texto: - sTipo = "string"; break; - case TipoCol.AproxNumerico: - sTipo = "double"; break; - case TipoCol.Tiempo: - sTipo = "DateTime"; break; - case TipoCol.Booleano: - sTipo = "bool"; break; - case TipoCol.Binario: - sTipo = "byte[]"; break; - } - if (sTipo == null) - { - continue; - } - - // El atributo privado para cada columna - escritor.Escribe("private " + sTipo + " _" + nombre + ";"); - - // La propiedad publica para cada columna - escritor.EscribeInd("public " + sTipo + " " + nombre); - escritor.EscribeInd("get"); - escritor.Escribe("return _" + nombre + ";"); - escritor.DeInd(); - escritor.EscribeInd("set"); - escritor.Escribe("_" + nombre + " = value;"); - escritor.DeInd(); - escritor.DeInd(); - escritor.Escribe(""); - } - escritor.DeInd(); - - // El Pie - escritor.DeInd(); - - // Cerrar ficheros - escritor.Cerrar(); - } - - private static void GenerarDALParametrosTabla - (TablaDesc t, String varPrm, String varCmd, String varDTO, bool input, EscritorCodigo escritor) - { - foreach (ColumnaDesc c in t.Columnas) - { - string nombre = FixNombre(c.Nombre); - TipoCol tipo = c.GetTipo(); - - // Establecer el tipo del parametro - switch (tipo) - { - case TipoCol.Numerico: - escritor.Escribe(varPrm + " = new SqlParameter(\"@[" + c.Nombre + "]\",SqlDbType.Int);"); break; - case TipoCol.Texto: - escritor.Escribe(varPrm + " = new SqlParameter(\"@[" + c.Nombre + "]\", " + - "SqlDbType.VarChar, " + c.Tamanho + ");"); break; - case TipoCol.AproxNumerico: - escritor.Escribe(varPrm + " = new SqlParameter(\"@[" + c.Nombre + "]\", SqlDbType.Real);"); break; - case TipoCol.Tiempo: - escritor.Escribe(varPrm + " = new SqlParameter(\"@[" + c.Nombre + "]\", SqlDbType.DateTime);"); break; - case TipoCol.Booleano: - escritor.Escribe(varPrm + " = new SqlParameter(\"@[" + c.Nombre + "]\", SqlDbType.Bit);"); break; - case TipoCol.Binario: - if (c.Tamanho > 0) - { - escritor.Escribe(varPrm + " = new SqlParameter(\"@[" + c.Nombre + "]\", " + - "SqlDbType.VarBinary, " + c.Tamanho + ");"); - } - else - { - escritor.Escribe(varPrm + " = new SqlParameter(\"@[" + c.Nombre + "]\", SqlDbType.Binary);"); - } - break; - default: - continue; - } - if (input) - { - escritor.Escribe(varPrm + ".Direction = ParameterDirection.Input;"); - } - else - { - escritor.Escribe(varPrm + ".Direction = ParameterDirection.Output;"); - } - escritor.Escribe(varPrm + ".Value = " + varDTO + "." + nombre + ";"); - escritor.Escribe(varCmd + ".Parameters.Add(" + varPrm + ");"); - } - escritor.Escribe(""); - } - - private static void GenerarDALInsert(Config config, TablaDesc t, EscritorCodigo escritor) - { - string nombreObj = FixNombre(t.Esquema) + "_" + FixNombre(t.Nombre); - string strInsert1, strInsert2; - - // Cabecera y variables del metodo - escritor.EscribeInd("public bool Insertar(" + nombreObj + " reg)"); - escritor.Escribe("SqlCommand cmd;"); - escritor.Escribe("SqlParameter prm;"); - escritor.Escribe("int nRows;"); - escritor.Escribe(""); - - // Preparacion del comando - strInsert1 = String.Empty; - strInsert2 = String.Empty; - foreach (ColumnaDesc c in t.Columnas) - { - TipoCol tipo = c.GetTipo(); - - if (tipo == TipoCol.Otro) - continue; - - if (strInsert1 == String.Empty) - { - // Primera columna - strInsert1 += "[" + c.Nombre + "]"; - strInsert2 += "@[" + c.Nombre + "]"; - } - else - { - // Cualquier otra columna - strInsert1 += ", [" + c.Nombre + "]"; - strInsert2 += ", @[" + c.Nombre + "]"; - } - } - escritor.Escribe("cmd = new SqlCommand(\"INSERT INTO [" + t.Esquema + "].[" + t.Nombre + "] " + - "(" + strInsert1 + ") " + - "VALUES (" + strInsert2 + "\");"); - escritor.Escribe(""); - - // Preparacion de los parametros - GenerarDALParametrosTabla(t, "prm", "cmd", "reg", true, escritor); - - // Ejecucion - escritor.Escribe("cnx.Open();"); - escritor.Escribe("nRows = cmd.ExecuteNonQuery()"); - escritor.Escribe("cnx.Close();"); - escritor.Escribe(""); - - // Pie - escritor.Escribe("return (nRows>0);"); - escritor.DeInd(); - escritor.Escribe(""); - } - - private static void GenerarDALActualizar(Config config, TablaDesc t, EscritorCodigo escritor) - { - string nombreObj = FixNombre(t.Esquema) + "_" + FixNombre(t.Nombre); - string strActualizar, strFiltroPrimario; - - // Cabecera y variables del metodo - escritor.EscribeInd("public bool Actualizar(" + nombreObj + " reg)"); - escritor.Escribe("SqlCommand cmd;"); - escritor.Escribe("SqlParameter prm;"); - escritor.Escribe("int nRows;"); - escritor.Escribe(""); - - // Preparacion del comando - strActualizar = String.Empty; - foreach (ColumnaDesc c in t.Columnas) - { - TipoCol tipo = c.GetTipo(); - - if (tipo == TipoCol.Otro) - continue; - if (c.Primaria) - continue; - - if (strActualizar != String.Empty) - { - strActualizar += ","; - } - strActualizar += "[" + c.Nombre + "]=@[" + c.Nombre + "]"; - } - strFiltroPrimario = String.Empty; - foreach (ColumnaDesc c in t.Columnas) - { - TipoCol tipo = c.GetTipo(); - - if (!c.Primaria) - continue; - - if (strFiltroPrimario != String.Empty) - { - strFiltroPrimario += " AND "; - } - strFiltroPrimario += "[" + c.Nombre + "]=@[" + c.Nombre + "]"; - } - escritor.Escribe("cmd = new SqlCommand(\"UPDATE [" + t.Esquema + "].[" + t.Nombre + "] " + - "SET " + strActualizar + " " + - "WHERE " + strFiltroPrimario + "\");"); - escritor.Escribe(""); - - // Preparacion de los parametros - GenerarDALParametrosTabla(t, "prm", "cmd", "reg", true, escritor); - - // Ejecucion - escritor.Escribe("cnx.Open();"); - escritor.Escribe("nRows = cmd.ExecuteNonQuery();"); - escritor.Escribe("cnx.Close();"); - escritor.Escribe(""); - - // Pie - escritor.Escribe("return (nRows>0);"); - escritor.DeInd(); - escritor.Escribe(""); - } - - - public static void GeneraDAL(Config config, TablaDesc t) - { - string nombreObj = FixNombre(t.Esquema) + "_" + FixNombre(t.Nombre); - string nombreDAL = FixNombre(t.Esquema) + "_" + FixNombre(t.Nombre) + "_DAL"; - string nombreFichero = config.PathDTO + "/" + nombreDAL + ".cs"; - EscritorCodigo escritor = new EscritorCodigo(nombreFichero); - - // Cabecera. - escritor.Escribe("using System;"); - escritor.Escribe("using System.Data;"); - escritor.Escribe("using System.Data.Sql;"); - escritor.Escribe("using System.Data.SqlClient;"); - escritor.Escribe(""); - escritor.Escribe("using " + config.NamespaceDTO + ";"); - escritor.Escribe(""); - escritor.EscribeInd("namespace " + config.NamespaceDAL); - - // El objeto DAL. - escritor.EscribeInd("public partial class " + nombreDAL); - - // Atributos internos - escritor.Escribe("SqlConnexion cnx;"); - escritor.Escribe(""); - - // Constructor - escritor.EscribeInd("public " + nombreDAL + "(SqlConnexion cnx)"); - escritor.Escribe("this.cnx = cnx;"); - escritor.DeInd(); - escritor.Escribe(""); - - // Metodo Insertar. - GenerarDALInsert(config, t, escritor); - - // Metodo Actualizar. - GenerarDALActualizar(config, t, escritor); - - // FIXME: Metodo Borrar. - - // FIXME: Metodo Leer. - - // FIXME: Metodo LeerTodos - - // Cerrar objeto DAL. - escritor.DeInd(); - - // El Pie - escritor.DeInd(); - - // Cerrar ficheros. - escritor.Cerrar(); - } - - public static Boolean GenerarCodigo(Config config, DatabaseDesc database) - { - // Asegura la existencia de los directorios destinos - if (!Directory.Exists(config.PathRaiz)) { Utiles.CrearDirectorio(config.PathRaiz); } - if (!Directory.Exists(config.PathDTO)) { Utiles.CrearDirectorio(config.PathDTO); } - if (!Directory.Exists(config.PathDAL)) { Utiles.CrearDirectorio(config.PathDAL); } - if (!Directory.Exists(config.PathExtra)) { Utiles.CrearDirectorio(config.PathExtra); } - - // Itera por cada tabla para crear sus DTO y DAL - foreach (TablaDesc t in database.Tablas) - { - GeneraDTO(config, t); - GeneraDAL(config, t); - } - - return true; - } - - private class Indentado - { - private int indentado = 0; - private StringBuilder sb = new StringBuilder(); - - public void Inc() - { - indentado++; - } - public void Dec() - { - indentado--; - if (indentado < 0) - { - indentado = 0; - } - } - public string Str() - { - sb.Remove(0, sb.Length); - for (int i = 0; i < indentado; i++) - { - sb.Append("\t"); - } - return sb.ToString(); - } - } - - private class EscritorCodigo - { - StreamWriter escritor; - Indentado indentado; - - public EscritorCodigo(string nombreFichero) - { - escritor = new StreamWriter(nombreFichero); - indentado = new Indentado(); - } - public void Cerrar() - { - escritor.Close(); - } - - public void Escribe(String str) - { - escritor.WriteLine(indentado.Str() + str); - } - public void EscribeInd(String str) - { - escritor.WriteLine(indentado.Str() + str); - escritor.WriteLine(indentado.Str() + "{"); - indentado.Inc(); - } - public void DeInd() - { - indentado.Dec(); - escritor.WriteLine(indentado.Str() + "}"); - } - } - } -} diff --git a/ServerExplorer/ServerExplorer.csproj b/ServerExplorer/ServerExplorer.csproj index 3e64951..b67a864 100644 --- a/ServerExplorer/ServerExplorer.csproj +++ b/ServerExplorer/ServerExplorer.csproj @@ -69,7 +69,6 @@ - @@ -79,12 +78,6 @@ FrmBaseDatos.cs - - Form - - - FrmCodeGenConfig.cs - Form @@ -122,9 +115,6 @@ FrmBaseDatos.cs - - FrmCodeGenConfig.cs - FrmDatos.cs diff --git a/ServerExplorer/frmBaseDatos.cs b/ServerExplorer/frmBaseDatos.cs index 8d3fecd..171486f 100644 --- a/ServerExplorer/frmBaseDatos.cs +++ b/ServerExplorer/frmBaseDatos.cs @@ -215,9 +215,9 @@ namespace ServerExplorer private void menuConfiguracion_Click(object sender, EventArgs e) { - // Llamar a la ventana de configuracion - FrmCodeGenConfig frm = new FrmCodeGenConfig(config); - frm.ShowDialog(); + //// Llamar a la ventana de configuracion + //FrmCodeGenConfig frm = new FrmCodeGenConfig(config); + //frm.ShowDialog(); } private void btnVerDatos_Click(object sender, EventArgs e) @@ -291,10 +291,10 @@ namespace ServerExplorer tablas_delistview(); DatabaseDesc db = CrearDatabaseDesc(); - //XmlSerializer seriador = new XmlSerializer(typeof(DatabaseDesc)); - //seriador.Serialize(System.Console.Out, db); + XmlSerializer seriador = new XmlSerializer(typeof(DatabaseDesc)); + seriador.Serialize(System.Console.Out, db); - CodeGen.GenerarCodigo(config, db); + //CodeGen.GenerarCodigo(config, db); } private void btnDocGen_Click(object sender, EventArgs e) diff --git a/ServerExplorer/frmCodeGenConfig.Designer.cs b/ServerExplorer/frmCodeGenConfig.Designer.cs deleted file mode 100644 index f9401a3..0000000 --- a/ServerExplorer/frmCodeGenConfig.Designer.cs +++ /dev/null @@ -1,307 +0,0 @@ -namespace ServerExplorer -{ - partial class FrmCodeGenConfig - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lblConString = new System.Windows.Forms.Label(); - this.txtConString = new System.Windows.Forms.TextBox(); - this.lblPathRaiz = new System.Windows.Forms.Label(); - this.txtPathRaiz = new System.Windows.Forms.TextBox(); - this.btnPathRaiz = new System.Windows.Forms.Button(); - this.btnPathDAL = new System.Windows.Forms.Button(); - this.txtPathDAL = new System.Windows.Forms.TextBox(); - this.lblPathDAL = new System.Windows.Forms.Label(); - this.btnPathDTO = new System.Windows.Forms.Button(); - this.txtPathDTO = new System.Windows.Forms.TextBox(); - this.lblPathDTO = new System.Windows.Forms.Label(); - this.btnPathExtra = new System.Windows.Forms.Button(); - this.txtPathExtra = new System.Windows.Forms.TextBox(); - this.lblPathExtra = new System.Windows.Forms.Label(); - this.btnCancelar = new System.Windows.Forms.Button(); - this.btnAceptar = new System.Windows.Forms.Button(); - this.lblNSDAL = new System.Windows.Forms.Label(); - this.lblNSDTO = new System.Windows.Forms.Label(); - this.txtNSDAL = new System.Windows.Forms.TextBox(); - this.txtNSDTO = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // lblConString - // - this.lblConString.AutoSize = true; - this.lblConString.Location = new System.Drawing.Point(12, 9); - this.lblConString.Name = "lblConString"; - this.lblConString.Size = new System.Drawing.Size(106, 13); - this.lblConString.TabIndex = 0; - this.lblConString.Text = "Cadena de Conexion"; - // - // 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(125, 6); - this.txtConString.Multiline = true; - this.txtConString.Name = "txtConString"; - this.txtConString.ReadOnly = true; - this.txtConString.Size = new System.Drawing.Size(330, 45); - this.txtConString.TabIndex = 1; - // - // lblPathRaiz - // - this.lblPathRaiz.AutoSize = true; - this.lblPathRaiz.Location = new System.Drawing.Point(12, 64); - this.lblPathRaiz.Name = "lblPathRaiz"; - this.lblPathRaiz.Size = new System.Drawing.Size(53, 13); - this.lblPathRaiz.TabIndex = 2; - this.lblPathRaiz.Text = "Path Raiz"; - // - // txtPathRaiz - // - this.txtPathRaiz.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtPathRaiz.Location = new System.Drawing.Point(125, 61); - this.txtPathRaiz.Name = "txtPathRaiz"; - this.txtPathRaiz.ReadOnly = true; - this.txtPathRaiz.Size = new System.Drawing.Size(296, 20); - this.txtPathRaiz.TabIndex = 4; - // - // btnPathRaiz - // - this.btnPathRaiz.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnPathRaiz.Location = new System.Drawing.Point(427, 58); - this.btnPathRaiz.Name = "btnPathRaiz"; - this.btnPathRaiz.Size = new System.Drawing.Size(28, 23); - this.btnPathRaiz.TabIndex = 5; - this.btnPathRaiz.Text = "..."; - this.btnPathRaiz.UseVisualStyleBackColor = true; - this.btnPathRaiz.Click += new System.EventHandler(this.btnPathRaiz_Click); - // - // btnPathDAL - // - this.btnPathDAL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnPathDAL.Location = new System.Drawing.Point(427, 84); - this.btnPathDAL.Name = "btnPathDAL"; - this.btnPathDAL.Size = new System.Drawing.Size(28, 23); - this.btnPathDAL.TabIndex = 8; - this.btnPathDAL.Text = "..."; - this.btnPathDAL.UseVisualStyleBackColor = true; - this.btnPathDAL.Click += new System.EventHandler(this.btnPathDAL_Click); - // - // txtPathDAL - // - this.txtPathDAL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtPathDAL.Location = new System.Drawing.Point(125, 87); - this.txtPathDAL.Name = "txtPathDAL"; - this.txtPathDAL.ReadOnly = true; - this.txtPathDAL.Size = new System.Drawing.Size(296, 20); - this.txtPathDAL.TabIndex = 7; - // - // lblPathDAL - // - this.lblPathDAL.AutoSize = true; - this.lblPathDAL.Location = new System.Drawing.Point(12, 90); - this.lblPathDAL.Name = "lblPathDAL"; - this.lblPathDAL.Size = new System.Drawing.Size(53, 13); - this.lblPathDAL.TabIndex = 6; - this.lblPathDAL.Text = "Path DAL"; - // - // btnPathDTO - // - this.btnPathDTO.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnPathDTO.Location = new System.Drawing.Point(427, 110); - this.btnPathDTO.Name = "btnPathDTO"; - this.btnPathDTO.Size = new System.Drawing.Size(28, 23); - this.btnPathDTO.TabIndex = 11; - this.btnPathDTO.Text = "..."; - this.btnPathDTO.UseVisualStyleBackColor = true; - this.btnPathDTO.Click += new System.EventHandler(this.btnPathDTO_Click); - // - // txtPathDTO - // - this.txtPathDTO.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtPathDTO.Location = new System.Drawing.Point(125, 113); - this.txtPathDTO.Name = "txtPathDTO"; - this.txtPathDTO.ReadOnly = true; - this.txtPathDTO.Size = new System.Drawing.Size(296, 20); - this.txtPathDTO.TabIndex = 10; - // - // lblPathDTO - // - this.lblPathDTO.AutoSize = true; - this.lblPathDTO.Location = new System.Drawing.Point(12, 116); - this.lblPathDTO.Name = "lblPathDTO"; - this.lblPathDTO.Size = new System.Drawing.Size(55, 13); - this.lblPathDTO.TabIndex = 9; - this.lblPathDTO.Text = "Path DTO"; - // - // btnPathExtra - // - this.btnPathExtra.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnPathExtra.Location = new System.Drawing.Point(427, 136); - this.btnPathExtra.Name = "btnPathExtra"; - this.btnPathExtra.Size = new System.Drawing.Size(28, 23); - this.btnPathExtra.TabIndex = 14; - this.btnPathExtra.Text = "..."; - this.btnPathExtra.UseVisualStyleBackColor = true; - this.btnPathExtra.Click += new System.EventHandler(this.btnPathExtra_Click); - // - // txtPathExtra - // - this.txtPathExtra.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtPathExtra.Location = new System.Drawing.Point(125, 139); - this.txtPathExtra.Name = "txtPathExtra"; - this.txtPathExtra.ReadOnly = true; - this.txtPathExtra.Size = new System.Drawing.Size(296, 20); - this.txtPathExtra.TabIndex = 13; - // - // lblPathExtra - // - this.lblPathExtra.AutoSize = true; - this.lblPathExtra.Location = new System.Drawing.Point(12, 142); - this.lblPathExtra.Name = "lblPathExtra"; - this.lblPathExtra.Size = new System.Drawing.Size(56, 13); - this.lblPathExtra.TabIndex = 12; - this.lblPathExtra.Text = "Path Extra"; - // - // btnCancelar - // - this.btnCancelar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnCancelar.Location = new System.Drawing.Point(380, 286); - this.btnCancelar.Name = "btnCancelar"; - this.btnCancelar.Size = new System.Drawing.Size(75, 23); - this.btnCancelar.TabIndex = 15; - this.btnCancelar.Text = "Cancelar"; - this.btnCancelar.UseVisualStyleBackColor = true; - this.btnCancelar.Click += new System.EventHandler(this.btnCancelar_Click); - // - // btnAceptar - // - this.btnAceptar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnAceptar.Location = new System.Drawing.Point(299, 286); - this.btnAceptar.Name = "btnAceptar"; - this.btnAceptar.Size = new System.Drawing.Size(75, 23); - this.btnAceptar.TabIndex = 16; - this.btnAceptar.Text = "Aceptar"; - this.btnAceptar.UseVisualStyleBackColor = true; - this.btnAceptar.Click += new System.EventHandler(this.btnAceptar_Click); - // - // lblNSDAL - // - this.lblNSDAL.AutoSize = true; - this.lblNSDAL.Location = new System.Drawing.Point(12, 169); - this.lblNSDAL.Name = "lblNSDAL"; - this.lblNSDAL.Size = new System.Drawing.Size(46, 13); - this.lblNSDAL.TabIndex = 17; - this.lblNSDAL.Text = "NS DAL"; - // - // lblNSDTO - // - this.lblNSDTO.AutoSize = true; - this.lblNSDTO.Location = new System.Drawing.Point(12, 195); - this.lblNSDTO.Name = "lblNSDTO"; - this.lblNSDTO.Size = new System.Drawing.Size(48, 13); - this.lblNSDTO.TabIndex = 18; - this.lblNSDTO.Text = "NS DTO"; - // - // txtNSDAL - // - this.txtNSDAL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtNSDAL.Location = new System.Drawing.Point(125, 166); - this.txtNSDAL.Name = "txtNSDAL"; - this.txtNSDAL.Size = new System.Drawing.Size(330, 20); - this.txtNSDAL.TabIndex = 19; - // - // txtNSDTO - // - this.txtNSDTO.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtNSDTO.Location = new System.Drawing.Point(125, 192); - this.txtNSDTO.Name = "txtNSDTO"; - this.txtNSDTO.Size = new System.Drawing.Size(330, 20); - this.txtNSDTO.TabIndex = 20; - // - // frmCodeGenConfig - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(467, 321); - this.Controls.Add(this.txtNSDTO); - this.Controls.Add(this.txtNSDAL); - this.Controls.Add(this.lblNSDTO); - this.Controls.Add(this.lblNSDAL); - this.Controls.Add(this.btnAceptar); - this.Controls.Add(this.btnCancelar); - this.Controls.Add(this.btnPathExtra); - this.Controls.Add(this.txtPathExtra); - this.Controls.Add(this.lblPathExtra); - this.Controls.Add(this.btnPathDTO); - this.Controls.Add(this.txtPathDTO); - this.Controls.Add(this.lblPathDTO); - this.Controls.Add(this.btnPathDAL); - this.Controls.Add(this.txtPathDAL); - this.Controls.Add(this.lblPathDAL); - this.Controls.Add(this.btnPathRaiz); - this.Controls.Add(this.txtPathRaiz); - this.Controls.Add(this.lblPathRaiz); - this.Controls.Add(this.txtConString); - this.Controls.Add(this.lblConString); - this.Name = "frmCodeGenConfig"; - this.Text = "Configuracion del Generador de Codigo"; - this.Load += new System.EventHandler(this.FrmCodeGenConfig_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label lblConString; - private System.Windows.Forms.TextBox txtConString; - private System.Windows.Forms.Label lblPathRaiz; - private System.Windows.Forms.TextBox txtPathRaiz; - private System.Windows.Forms.Button btnPathRaiz; - private System.Windows.Forms.Button btnPathDAL; - private System.Windows.Forms.TextBox txtPathDAL; - private System.Windows.Forms.Label lblPathDAL; - private System.Windows.Forms.Button btnPathDTO; - private System.Windows.Forms.TextBox txtPathDTO; - private System.Windows.Forms.Label lblPathDTO; - private System.Windows.Forms.Button btnPathExtra; - private System.Windows.Forms.TextBox txtPathExtra; - private System.Windows.Forms.Label lblPathExtra; - private System.Windows.Forms.Button btnCancelar; - private System.Windows.Forms.Button btnAceptar; - private System.Windows.Forms.Label lblNSDAL; - private System.Windows.Forms.Label lblNSDTO; - private System.Windows.Forms.TextBox txtNSDAL; - private System.Windows.Forms.TextBox txtNSDTO; - } -} \ No newline at end of file diff --git a/ServerExplorer/frmCodeGenConfig.cs b/ServerExplorer/frmCodeGenConfig.cs deleted file mode 100644 index 38f8255..0000000 --- a/ServerExplorer/frmCodeGenConfig.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace ServerExplorer -{ - public partial class FrmCodeGenConfig : Form - { - Config _config; - - public FrmCodeGenConfig(Config config) - { - InitializeComponent(); - - _config = config; - } - - private void FrmCodeGenConfig_Load(object sender, EventArgs e) - { - txtConString.Text = _config.ConString; - txtPathRaiz.Text = _config.PathRaiz; - txtPathDAL.Text = _config.PathDAL; - txtPathDTO.Text = _config.PathDTO; - txtPathExtra.Text = _config.PathExtra; - txtNSDAL.Text = _config.NamespaceDAL; - txtNSDTO.Text = _config.NamespaceDTO; - } - - private void btnPathRaiz_Click(object sender, EventArgs e) - { - FolderBrowserDialog dialog = new FolderBrowserDialog(); - dialog.SelectedPath = txtPathRaiz.Text; - if (dialog.ShowDialog() == DialogResult.OK) - { - txtPathRaiz.Text = dialog.SelectedPath; - } - } - - private void btnPathDAL_Click(object sender, EventArgs e) - { - FolderBrowserDialog dialog = new FolderBrowserDialog(); - dialog.SelectedPath = txtPathDAL.Text; - if (dialog.ShowDialog() == DialogResult.OK) - { - txtPathDAL.Text = dialog.SelectedPath; - } - } - - private void btnPathDTO_Click(object sender, EventArgs e) - { - FolderBrowserDialog dialog = new FolderBrowserDialog(); - dialog.SelectedPath = txtPathDTO.Text; - if (dialog.ShowDialog() == DialogResult.OK) - { - txtPathDTO.Text = dialog.SelectedPath; - } - } - - private void btnPathExtra_Click(object sender, EventArgs e) - { - FolderBrowserDialog dialog = new FolderBrowserDialog(); - dialog.SelectedPath = txtPathExtra.Text; - if (dialog.ShowDialog() == DialogResult.OK) - { - txtPathExtra.Text = dialog.SelectedPath; - } - } - - private void btnAceptar_Click(object sender, EventArgs e) - { - _config.PathRaiz = txtPathRaiz.Text; - _config.PathDAL = txtPathDAL.Text; - _config.PathDTO = txtPathDTO.Text; - _config.PathExtra = txtPathExtra.Text; - _config.NamespaceDAL = txtNSDAL.Text; - _config.NamespaceDTO = txtNSDTO.Text; - this.Close(); - } - - private void btnCancelar_Click(object sender, EventArgs e) - { - this.Close(); - } - } -} diff --git a/ServerExplorer/frmCodeGenConfig.resx b/ServerExplorer/frmCodeGenConfig.resx deleted file mode 100644 index 7080a7d..0000000 --- a/ServerExplorer/frmCodeGenConfig.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file