diff --git a/Empleados/AgregarEmpleado1.Designer.cs b/Empleados/AgregarEmpleado1.Designer.cs index 5db8768..dd2521b 100644 --- a/Empleados/AgregarEmpleado1.Designer.cs +++ b/Empleados/AgregarEmpleado1.Designer.cs @@ -406,30 +406,30 @@ this.Controls.Add(this.lbImg); this.Controls.Add(this.pictureBox2); this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.label12); this.Controls.Add(this.cbEstado); - this.Controls.Add(this.label11); this.Controls.Add(this.txtTelefono); - this.Controls.Add(this.label10); this.Controls.Add(this.dtFechaCon); - this.Controls.Add(this.label9); this.Controls.Add(this.dtFechaNac); - this.Controls.Add(this.label8); - this.Controls.Add(this.label7); this.Controls.Add(this.txtReferencia); this.Controls.Add(this.txtNoInt); - this.Controls.Add(this.label6); this.Controls.Add(this.txtNoExt); - this.Controls.Add(this.label5); this.Controls.Add(this.txtCp); - this.Controls.Add(this.label4); this.Controls.Add(this.txtColonia); - this.Controls.Add(this.label3); this.Controls.Add(this.txtCalle); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); this.Controls.Add(this.txtApellido); this.Controls.Add(this.txtNombre); + this.Controls.Add(this.label12); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "AgregarEmpleado1"; diff --git a/Empleados/AgregarLogin1.Designer.cs b/Empleados/AgregarLogin1.Designer.cs index de6312e..e11026e 100644 --- a/Empleados/AgregarLogin1.Designer.cs +++ b/Empleados/AgregarLogin1.Designer.cs @@ -1,4 +1,4 @@ -namespace compabetov2.Empleados +namespace compabetov2 { partial class AgregarLogin1 { @@ -186,20 +186,19 @@ this.ControlBox = false; this.Controls.Add(this.label5); this.Controls.Add(this.label4); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); this.Controls.Add(this.pictureBox2); this.Controls.Add(this.pictureBox1); this.Controls.Add(this.cbTipo); this.Controls.Add(this.txtContraConf); this.Controls.Add(this.txtContra); this.Controls.Add(this.txtNombre); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "AgregarLogin1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Load += new System.EventHandler(this.AgregarLogin1_Load); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); diff --git a/Empleados/AgregarLogin1.cs b/Empleados/AgregarLogin1.cs index aa73758..ca3526d 100644 --- a/Empleados/AgregarLogin1.cs +++ b/Empleados/AgregarLogin1.cs @@ -1,5 +1,5 @@ -using compabetov2.database.modelos; -using compabetov2.database; +using compabetov2.database; +using compabetov2.database.modelos; using System; using System.Collections.Generic; using System.ComponentModel; @@ -10,23 +10,55 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -namespace compabetov2.Empleados +namespace compabetov2 { - public partial class AgregarLogin1 : Form + public partial class AgregarLogin1: Form { personal ventanaPadre; int idEmpleado; - public AgregarLogin1() + public AgregarLogin1(personal ventanaPadre, int idEmpleado) { - InitializeComponent(); InitializeComponent(); this.ventanaPadre = ventanaPadre; this.idEmpleado = idEmpleado; + } + private void btnAceptar_Click(object sender, EventArgs e) + { } - private void AgregarLogin1_Load(object sender, EventArgs e) + private void btnAceptar_Click_1(object sender, EventArgs e) + { + string contra = txtContra.Text; + string contraConf = txtContraConf.Text; + if (contra.Equals(contraConf)) + { + string tipo = cbTipo.Text; + string nombre = txtNombre.Text; + LoginModel loginModel = new LoginModel(nombre, contra, tipo, idEmpleado); + if (service.verificarExistenciaLogin(loginModel)) + { + if (service.crearLogin(loginModel, idEmpleado)) + { + ventanaPadre.llenarPanel(); + Close(); + } + } + else + { + MessageBox.Show("El nombre de usuario ya existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + + } + else + { + MessageBox.Show("Las cotraseña no coinciden", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void AgregarLogin_Load(object sender, EventArgs e) { } @@ -61,8 +93,8 @@ namespace compabetov2.Empleados } } - private void pictureBox1_Click(object sender, EventArgs e) - { + private void pictureBox1_Click(object sender, EventArgs e) { + this.Close(); } } diff --git a/Empleados/EditarEmpleado1.Designer.cs b/Empleados/EditarEmpleado1.Designer.cs index 082458c..2404a7d 100644 --- a/Empleados/EditarEmpleado1.Designer.cs +++ b/Empleados/EditarEmpleado1.Designer.cs @@ -361,7 +361,7 @@ this.lbImg.BackColor = System.Drawing.Color.Transparent; this.lbImg.Font = new System.Drawing.Font("Poppins", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbImg.ForeColor = System.Drawing.Color.Transparent; - this.lbImg.Location = new System.Drawing.Point(141, 543); + this.lbImg.Location = new System.Drawing.Point(653, 530); this.lbImg.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbImg.Name = "lbImg"; this.lbImg.Size = new System.Drawing.Size(113, 40); @@ -371,7 +371,7 @@ // button1 // this.button1.Font = new System.Drawing.Font("Poppins", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button1.Location = new System.Drawing.Point(26, 541); + this.button1.Location = new System.Drawing.Point(660, 564); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(103, 46); this.button1.TabIndex = 29; @@ -392,30 +392,30 @@ this.Controls.Add(this.lbImg); this.Controls.Add(this.pictureBox2); this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.label12); this.Controls.Add(this.cbEstado); - this.Controls.Add(this.label11); this.Controls.Add(this.txtTelefono); - this.Controls.Add(this.label10); this.Controls.Add(this.dtFechaCon); - this.Controls.Add(this.label9); this.Controls.Add(this.dtFechaNac); - this.Controls.Add(this.label8); - this.Controls.Add(this.label7); this.Controls.Add(this.txtReferencia); this.Controls.Add(this.txtNoInt); - this.Controls.Add(this.label6); this.Controls.Add(this.txtNoExt); - this.Controls.Add(this.label5); this.Controls.Add(this.txtCp); - this.Controls.Add(this.label4); this.Controls.Add(this.txtColonia); - this.Controls.Add(this.label3); this.Controls.Add(this.txtCalle); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); this.Controls.Add(this.txtApellido); this.Controls.Add(this.txtNombre); + this.Controls.Add(this.label12); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "EditarEmpleado1"; diff --git a/Empleados/personal.cs b/Empleados/personal.cs index 4ed4ee3..0956057 100644 --- a/Empleados/personal.cs +++ b/Empleados/personal.cs @@ -1,5 +1,6 @@ using compabetov2.database; using compabetov2.database.modelos; +using compabetov2.Empleados; using System; using System.Collections.Generic; using System.ComponentModel; @@ -105,7 +106,7 @@ namespace compabetov2 btnEditar.ForeColor = Color.White; btnEditar.Click += new EventHandler(delegate (object sender, EventArgs e) { - EditarEmpleado editarEmpleado = new EditarEmpleado(empleado,this); + EditarEmpleado1 editarEmpleado = new EditarEmpleado1(empleado,this); editarEmpleado.Show(); }); @@ -140,7 +141,7 @@ namespace compabetov2 btnLogin.Click += new EventHandler(delegate (object sender, EventArgs e) { - AgregarLogin agregarLogin = new AgregarLogin(this, empleado.idempleado); + AgregarLogin1 agregarLogin = new AgregarLogin1(this, empleado.idempleado); agregarLogin.Show(); }); } @@ -220,8 +221,11 @@ namespace compabetov2 private void btnAgregar_Click(object sender, EventArgs e) { - AgregarEmpleado agregarEmpleado = new AgregarEmpleado(this); + AgregarEmpleado1 agregarEmpleado = new AgregarEmpleado1(this); agregarEmpleado.Show(); + + + } private void button1_Click(object sender, EventArgs e) diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index 0a3a625..7bb152e 100644 Binary files a/bin/Debug/compabetov2.exe and b/bin/Debug/compabetov2.exe differ diff --git a/bin/Debug/compabetov2.pdb b/bin/Debug/compabetov2.pdb index 05d4d7d..7f30336 100644 Binary files a/bin/Debug/compabetov2.pdb and b/bin/Debug/compabetov2.pdb differ diff --git a/bin/Debug/data.db b/bin/Debug/data.db index e7551c2..4fd4eec 100644 Binary files a/bin/Debug/data.db and b/bin/Debug/data.db differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache index d59ca11..54dcc38 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/obj/Debug/compabetov2.csproj.AssemblyReference.cache b/obj/Debug/compabetov2.csproj.AssemblyReference.cache index 35665db..a853f99 100644 Binary files a/obj/Debug/compabetov2.csproj.AssemblyReference.cache and b/obj/Debug/compabetov2.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache index 0851b4c..5122a8e 100644 --- a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache +++ b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -c506c9a4722d6b00cf81dc1234eccc10baea5625c04c57095cc6ec95193a0f16 +c3fae808d3f85efa42b7f49a590857079d7d8c73d25abc018ba096b666adc8e2 diff --git a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt index b9c4674..be66823 100644 --- a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt +++ b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt @@ -118,3 +118,7 @@ C:\Users\carsu\source\repos\compabetoOG\bin\Debug\SqlServerTypes\x64\SqlServerSp C:\Users\carsu\source\repos\compabetoOG\bin\Debug\SqlServerTypes\x86\msvcr120.dll C:\Users\carsu\source\repos\compabetoOG\bin\Debug\SqlServerTypes\x86\SqlServerSpatial140.dll C:\Users\carsu\source\repos\compabetoOG\bin\Debug\Microsoft.SqlServer.Types.dll +C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.Empleados.AgregarEmpleado1.resources +C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.Empleados.AgregarLogin1.resources +C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.Empleados.EditarEmpleado1.resources +C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.AgregarLogin1.resources diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache index cee590d..e9652bc 100644 Binary files a/obj/Debug/compabetov2.csproj.GenerateResource.cache and b/obj/Debug/compabetov2.csproj.GenerateResource.cache differ diff --git a/obj/Debug/compabetov2.exe b/obj/Debug/compabetov2.exe index 0a3a625..7bb152e 100644 Binary files a/obj/Debug/compabetov2.exe and b/obj/Debug/compabetov2.exe differ diff --git a/obj/Debug/compabetov2.pdb b/obj/Debug/compabetov2.pdb index 05d4d7d..7f30336 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ