arreglar proyecto

This commit is contained in:
carlos
2024-01-14 21:51:36 -06:00
parent eab9fb5b33
commit 148d5c9cbb
19 changed files with 172 additions and 97 deletions
+2 -3
View File
@@ -1,8 +1,7 @@
{
"ExpandedNodes": [
"",
"\\database"
""
],
"SelectedNode": "\\.sln",
"SelectedNode": "\\Solution.sln",
"PreviewInSolutionExplorer": false
}
Binary file not shown.
File diff suppressed because one or more lines are too long
+100 -61
View File
@@ -30,19 +30,22 @@
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
this.label3 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.btnAceptar = new System.Windows.Forms.Button();
this.btnCancelar = new System.Windows.Forms.Button();
this.tableLayoutPanel1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.flowLayoutPanel3.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
@@ -62,7 +65,7 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 48.92086F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 84F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 72F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(584, 311);
this.tableLayoutPanel1.Size = new System.Drawing.Size(354, 311);
this.tableLayoutPanel1.TabIndex = 0;
//
// flowLayoutPanel1
@@ -73,9 +76,28 @@
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(578, 73);
this.flowLayoutPanel1.Size = new System.Drawing.Size(348, 73);
this.flowLayoutPanel1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
this.label1.Size = new System.Drawing.Size(178, 34);
this.label1.TabIndex = 0;
this.label1.Text = "Nombre de usuario:";
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox1.Location = new System.Drawing.Point(3, 37);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(345, 26);
this.textBox1.TabIndex = 1;
//
// flowLayoutPanel2
//
this.flowLayoutPanel2.Controls.Add(this.label2);
@@ -84,9 +106,29 @@
this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 82);
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.Size = new System.Drawing.Size(578, 69);
this.flowLayoutPanel2.Size = new System.Drawing.Size(348, 69);
this.flowLayoutPanel2.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(3, 0);
this.label2.Name = "label2";
this.label2.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
this.label2.Size = new System.Drawing.Size(103, 34);
this.label2.TabIndex = 0;
this.label2.Text = "contraseña";
//
// textBox2
//
this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox2.Location = new System.Drawing.Point(3, 37);
this.textBox2.Name = "textBox2";
this.textBox2.PasswordChar = '*';
this.textBox2.Size = new System.Drawing.Size(345, 26);
this.textBox2.TabIndex = 1;
//
// flowLayoutPanel3
//
this.flowLayoutPanel3.Controls.Add(this.label3);
@@ -95,82 +137,76 @@
this.flowLayoutPanel3.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel3.Location = new System.Drawing.Point(3, 157);
this.flowLayoutPanel3.Name = "flowLayoutPanel3";
this.flowLayoutPanel3.Size = new System.Drawing.Size(578, 78);
this.flowLayoutPanel3.Size = new System.Drawing.Size(348, 78);
this.flowLayoutPanel3.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(3, 0);
this.label3.Name = "label3";
this.label3.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
this.label3.Size = new System.Drawing.Size(186, 34);
this.label3.TabIndex = 0;
this.label3.Text = "confirmar contraseña";
//
// textBox3
//
this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox3.Location = new System.Drawing.Point(3, 37);
this.textBox3.Name = "textBox3";
this.textBox3.PasswordChar = '*';
this.textBox3.Size = new System.Drawing.Size(342, 26);
this.textBox3.TabIndex = 1;
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 3;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80.65844F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 19.34156F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 91F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 63.52941F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 36.47059F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 92F));
this.tableLayoutPanel2.Controls.Add(this.btnAceptar, 1, 0);
this.tableLayoutPanel2.Controls.Add(this.btnCancelar, 2, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 241);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(578, 67);
this.tableLayoutPanel2.Size = new System.Drawing.Size(348, 67);
this.tableLayoutPanel2.TabIndex = 3;
//
// label1
// btnAceptar
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(178, 24);
this.label1.TabIndex = 0;
this.label1.Text = "Nombre de usuario:";
this.btnAceptar.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnAceptar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAceptar.Location = new System.Drawing.Point(165, 3);
this.btnAceptar.Name = "btnAceptar";
this.btnAceptar.Size = new System.Drawing.Size(87, 61);
this.btnAceptar.TabIndex = 0;
this.btnAceptar.Text = "Aceptar";
this.btnAceptar.UseVisualStyleBackColor = true;
//
// label2
// btnCancelar
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(3, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(103, 24);
this.label2.TabIndex = 0;
this.label2.Text = "contraseña";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(3, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(106, 13);
this.label3.TabIndex = 0;
this.label3.Text = "confirmar contraseña";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(3, 27);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 1;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(3, 27);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 1;
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(3, 16);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(100, 20);
this.textBox3.TabIndex = 1;
this.btnCancelar.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnCancelar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnCancelar.Location = new System.Drawing.Point(258, 3);
this.btnCancelar.Name = "btnCancelar";
this.btnCancelar.Size = new System.Drawing.Size(87, 61);
this.btnCancelar.TabIndex = 1;
this.btnCancelar.Text = "Cancelar";
this.btnCancelar.UseVisualStyleBackColor = true;
//
// AgregarLogin
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(584, 311);
this.ClientSize = new System.Drawing.Size(354, 311);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "AgregarLogin";
this.Text = "AgregarLogin";
this.Text = "Crear Login";
this.tableLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
@@ -178,6 +214,7 @@
this.flowLayoutPanel2.PerformLayout();
this.flowLayoutPanel3.ResumeLayout(false);
this.flowLayoutPanel3.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -195,5 +232,7 @@
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Button btnAceptar;
private System.Windows.Forms.Button btnCancelar;
}
}
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+7 -3
View File
@@ -105,8 +105,12 @@ namespace compabetov2.database
while (reader.Read())
{
long fkIdLogin = reader.GetInt64(0);
int? fkIdLogin = null;
try
{
long fkIdLoginTemp = reader.GetInt64(13);
fkIdLogin = Convert.ToInt32(fkIdLoginTemp); ;
}catch (Exception ex){}
long id = reader.GetInt64(0);
Empleado empleado = new Empleado(
Convert.ToInt32(id),
@@ -122,7 +126,7 @@ namespace compabetov2.database
reader["referencia"].ToString(),
reader["fecha_nac"].ToString(),
reader["telefono"].ToString(),
Convert.ToInt32(fkIdLogin)
fkIdLogin
) ;
empleados.Add(empleado);
}
Binary file not shown.
Binary file not shown.
@@ -91,4 +91,4 @@ C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.pdb
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.AgregarEmpleado.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.EditarEmpleado.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.AgregarLogin.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.preguntaLogin.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.Confirmacion.resources
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6 -20
View File
@@ -130,34 +130,20 @@ namespace compabetov2
btnLogin.FlatStyle = FlatStyle.Flat;
btnLogin.FlatAppearance.BorderSize = 0;
btnLogin.Font = new Font(btnVer.Font.FontFamily, 16);
if(empleado.fkIdLogin != null) {
btnLogin.BackColor = Color.Yellow;
if(empleado.fkIdLogin == null) {
btnLogin.Click += new EventHandler(delegate (object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("¿Deseas editar o borrar?", "Confirmación", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
// Código para editar
}
else if (result == DialogResult.No)
{
// Código para borrar
}
AgregarLogin agregarLogin = new AgregarLogin();
agregarLogin.Show();
});
}
else
{
btnLogin.BackColor = Color.Yellow;
btnLogin.Click += new EventHandler(delegate (object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("¿Deseas editar o borrar?", "Confirmación", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
// Código para editar
}
else if (result == DialogResult.No)
{
// Código para borrar
}
});
}
+1 -1
View File
@@ -124,6 +124,6 @@
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>75</value>
<value>105</value>
</metadata>
</root>
+47 -5
View File
@@ -1,6 +1,6 @@
namespace compabetov2
{
partial class preguntaLogin
partial class Confirmacion
{
/// <summary>
/// Required designer variable.
@@ -28,20 +28,62 @@
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// preguntaLogin
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(23, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(342, 20);
this.label1.TabIndex = 0;
this.label1.Text = "¿Desea modificar o eliminar el Inicio de sesion?";
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// button1
//
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.Location = new System.Drawing.Point(27, 67);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(209, 35);
this.button1.TabIndex = 1;
this.button1.Text = "Modificar contraseña";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button2.Location = new System.Drawing.Point(242, 67);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(123, 35);
this.button2.TabIndex = 2;
this.button2.Text = "Eliminar";
this.button2.UseVisualStyleBackColor = true;
//
// Confirmacion
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(489, 114);
this.Name = "preguntaLogin";
this.Text = "preguntaLogin";
this.ClientSize = new System.Drawing.Size(380, 114);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.Name = "Confirmacion";
this.Text = "Confirmacion";
this.Load += new System.EventHandler(this.preguntaLogin_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
}
}
+7 -2
View File
@@ -10,9 +10,9 @@ using System.Windows.Forms;
namespace compabetov2
{
public partial class preguntaLogin : Form
public partial class Confirmacion : Form
{
public preguntaLogin()
public Confirmacion()
{
InitializeComponent();
}
@@ -21,5 +21,10 @@ namespace compabetov2
{
}
private void label1_Click(object sender, EventArgs e)
{
}
}
}