private void Mostrar() { this.dataListado.DataSource = NRegistroTrabajador.Mostrar(); if (dataListado.Rows.Count > 0) { this.dataListado.ClearSelection(); ocultarColumnas(); dataListado.ClearSelection(); } }
private void Login() { if (this.txtDni.Text.Trim() == "") { MessageBox.Show("Ingrese el DNI"); } else if (this.txtPass.Text.Trim() == "") { MessageBox.Show("Ingrese la clave"); } else { DataTable datos = NRegistroTrabajador.Login(this.txtDni.Text, this.txtPass.Text); if (datos.Rows.Count == 0) { MessageBox.Show("El usuario no existe", "Sistema de Ventas", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { lblIdPersona.Text = datos.Rows[0][0].ToString(); string tipo = ""; if (rbIngreso.Checked == true) { tipo = "I"; } else if (rbSalida.Checked == true) { tipo = "S"; } string rpta = NRegistroTrabajador.Insertar(DateTime.Now, tipo, Convert.ToInt32(lblIdPersona.Text)); if (rpta == "OK") { MessageBox.Show("Registro exitoso"); this.Close(); } } } }