Falta lo amarillo

This commit is contained in:
Michael Robles
2024-01-23 01:33:43 -07:00
parent 0e8161d9ff
commit 881295d920
15 changed files with 83 additions and 44 deletions
+41 -9
View File
@@ -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();
}
}