Cambios minimos

parent c9920da3
......@@ -33,10 +33,6 @@
this.panel1 = new System.Windows.Forms.Panel();
this.txtLiteral = new System.Windows.Forms.TextBox();
this.BotonTraduce = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.txtNombreTabla = new System.Windows.Forms.TextBox();
this.txtLitValue = new System.Windows.Forms.TextBox();
......@@ -67,6 +63,7 @@
//
// panel1
//
this.panel1.AutoScroll = true;
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Location = new System.Drawing.Point(5, 145);
this.panel1.Name = "panel1";
......@@ -90,46 +87,6 @@
this.BotonTraduce.UseVisualStyleBackColor = true;
this.BotonTraduce.Click += new System.EventHandler(this.BotonTraduce_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(337, 111);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(15, 13);
this.label1.TabIndex = 10;
this.label1.Text = "x:";
this.label1.Visible = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(358, 111);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 13);
this.label2.TabIndex = 11;
this.label2.Text = "label2";
this.label2.Visible = false;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(337, 124);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(15, 13);
this.label3.TabIndex = 12;
this.label3.Text = "y:";
this.label3.Visible = false;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(358, 124);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(35, 13);
this.label4.TabIndex = 13;
this.label4.Text = "label4";
this.label4.Visible = false;
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(3, 275);
......@@ -190,10 +147,6 @@
this.Controls.Add(this.txtLitValue);
this.Controls.Add(this.txtNombreTabla);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.BotonAdd);
this.Controls.Add(this.ComboboxIdioma);
this.Controls.Add(this.panel1);
......@@ -215,10 +168,6 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TextBox txtLiteral;
private System.Windows.Forms.Button BotonTraduce;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.TextBox txtNombreTabla;
private System.Windows.Forms.TextBox txtLitValue;
......
......@@ -29,16 +29,7 @@ namespace Literals
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void MainMenu_Load(object sender, EventArgs e)
{
#if DEBUG
this.label1.Visible = true;
this.label3.Visible = true;
this.label2.Visible = true;
this.label4.Visible = true;
this.label2.Text = "0";
this.label4.Text = "0";
#endif
{
}
/// <summary>
......@@ -77,6 +68,7 @@ namespace Literals
/// </summary>
private void OrdenaBotones()
{
//Coordenadas para posicionar los botones
int x = 0;
int y = 0;
this.panel1.Controls.Clear();
......@@ -92,10 +84,8 @@ namespace Literals
x = 0;
}
B.Left = x * 75;
this.label2.Text = x.ToString();
x++;
B.Top = y * 23;
this.label4.Text = y.ToString();
B.Click += new EventHandler(BotonB_Click);
this.panel1.Controls.Add(B);
rellenaCB();
......@@ -129,7 +119,10 @@ namespace Literals
}
}
}
/// <summary>
/// Generars the SQL.
/// </summary>
/// <returns></returns>
public string GenerarSQL()
{
string query = "";
......@@ -137,18 +130,47 @@ namespace Literals
string litname = "UNLOCKPROCESS";
string litvalue = "Proceso Bloqueado";
foreach (Idiomas i in this.lBotones)
try
{
query += "UPDATE dbo." + this.txtNombreTabla.Text + " SET " + this.txtLiteral.Text + " = '" + Translator.Translate(this.txtLitValue.Text, null, CodigoIdioma(i)) + "' WHERE IDIOMA = '"+NumeroIdioma(i)+"'\n";
foreach (Idiomas i in this.lBotones)
{
query += "UPDATE dbo." + this.txtNombreTabla.Text + " SET " + this.txtLiteral.Text + " = '" + Translator.Translate(this.txtLitValue.Text, null, CodigoIdioma(i)) + "' WHERE IDIOMA = '" + NumeroIdioma(i) + "'\n";
}
}
catch (Exception ex)
{
MessageBox.Show("Se ha producido un error de API. Reintentelo en breve.");
}
return query;
}
/// <summary>
/// Handles the Click event of the BotonTraduce control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void BotonTraduce_Click(object sender, EventArgs e)
{
this.richTextBox1.Text = GenerarSQL();
if (!string.IsNullOrWhiteSpace(this.txtNombreTabla.Text))
{
if (!string.IsNullOrWhiteSpace(this.txtLiteral.Text))
{
if (!string.IsNullOrEmpty(this.txtLitValue.Text))
{
this.richTextBox1.Text = GenerarSQL();
}
else
{
MessageBox.Show("El valor del literal no puede estar vacío.");
}
}
else {
MessageBox.Show("El nombre del literal no puede estar vacío o contener espacios");
}
}
else
{
MessageBox.Show("El nombre de la tabla no puede estar vacío o contener espacios");
}
}
/// <summary>
......@@ -247,11 +269,6 @@ namespace Literals
return "00001";
}
}
private void label5_Click(object sender, EventArgs e)
{
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment