private void btnGrabar_Click(object sender, EventArgs e) { BorrarMensajeError(); if (ValidarCampos()) { if (Program.IdEmpleado != 0) { U.IdEmpleado = Program.IdEmpleado; U.User = txtUser.Text; U.Password = txtPassword.Text; MessageBox.Show(U.RegistrarUsuarios(), "Sistema de Ventas.", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); Limpiar(); } else { MessageBox.Show("Lo Sentimos, Pero Usted debe Eligir un \n Empleado para Crear una Cuenta de Usuario.\n \n G R A C I A S.", "Sistema de Ventas.", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { FrmListadoEmpleados LE = new FrmListadoEmpleados(); LE.Visible = true; Visible = false; } }
private void btn_emp_Click(object sender, EventArgs e) { FrmListadoEmpleados LE = new FrmListadoEmpleados(); LE.Visible = true; Visible = false; }
private void btnGrabar_Click(object sender, EventArgs e) { FrmListadoEmpleados LE = new FrmListadoEmpleados(); if (ValidarCampos()) { E.IdEmpleado = Convert.ToInt32(txtIdE.Text); E.IdCargo = Convert.ToInt32(comboBox1.SelectedValue); E.Dni = txtDni.Text; E.Apellidos = txtApellidos.Text; E.Nombres = txtNombres.Text; E.Sexo = rbnMasculino.Checked == true ? 'M' : 'F'; E.FechaNac = Convert.ToDateTime(dateTimePicker1.Value); E.Direccion = txtDireccion.Text; MessageBox.Show(E.MantenimientoEmpleados(), "Sistema de Ventas.", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); Limpiar(); LE.Visible = true; Visible = false; } }