Mermas Design

This commit is contained in:
Michael Robles
2024-01-22 02:36:18 -07:00
parent 2db5006ebb
commit 38de489250
67 changed files with 364 additions and 186 deletions
+61
View File
@@ -0,0 +1,61 @@
using compabetov2.database;
using compabetov2.database.modelos;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace compabetov2
{
public partial class AgregarLogin : Form
{
personal ventanaPadre;
int idEmpleado;
public AgregarLogin(personal ventanaPadre, int idEmpleado)
{
InitializeComponent();
this.ventanaPadre = ventanaPadre;
this.idEmpleado = idEmpleado;
}
private void btnAceptar_Click(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);
}
}
}
}