bajar cambios 4
This commit is contained in:
+36
-2
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using compabetov2.database;
|
||||
using compabetov2.database.modelos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
@@ -12,9 +14,41 @@ namespace compabetov2
|
||||
{
|
||||
public partial class AgregarLogin : Form
|
||||
{
|
||||
public AgregarLogin()
|
||||
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.crearLogin(loginModel))
|
||||
{
|
||||
MessageBox.Show("Login creado");
|
||||
ventanaPadre.llenarPanel();
|
||||
Close();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Las cotraseña no coinciden", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user