示例#1
0
        private void InsertarDatosBD()
        {
            Empleado myEmpleado = new Empleado();

            myEmpleado.Codigo   = txtCodigo.Text;
            myEmpleado.Nombre   = txtNombre.Text;
            myEmpleado.Apellido = txtApellido.Text;
            myEmpleado.Cargo    = txtCargo.Text;
            myEmpleado.Salario  = txtSalario.Text;
            myEmpleado.Area     = txtArea.Text;
            myEmpleado.Ciudad   = txtCiudad.Text;

            if (!datos.ExisteEmpleado(txtCodigo.Text))
            {
                if (datos.InsertarEmpleadoBD(myEmpleado))
                {
                    LabelRta.Text = "El Registro Fue Insertado Correctamente";
                }
                else
                {
                    LabelRta.Text = "Error al insertar" + datos.error;
                }
            }
            else
            {
                LabelRta.Text = "El código:  " + txtCodigo.Text + " ya existe";
            }
        }
示例#2
0
        private void InsertarDatosBD()
        {
            Empleado myEmpleado = new Empleado();

            myEmpleado.Codigo   = InCodigo.Text;
            myEmpleado.Nombre   = InNombre.Text;
            myEmpleado.Apellido = InApellido.Text;
            myEmpleado.Cargo    = InCargo.Text;
            myEmpleado.Salario  = InSalario.Text;
            myEmpleado.Area     = InArea.Text;
            myEmpleado.Ciudad   = InCiudad.Text;

            if (datos.ExisteEmpleado(InCodigo.Text))
            {
                if (datos.InsertarEmpleadoBD(myEmpleado))
                {
                    LabelRta.Text = "El Registro se agregó de forma correcta";
                }
                else
                {
                    LabelRta.Text = "Error al ingresar la información" + datos.error;
                }
            }
            else
            {
                ErrorCodigo.Text = "El código " + InCodigo.Text + " ya existe en la base";
            }
        }
        private void InsertarDatosBD()
        {
            Empleado myEmpleado = new Empleado();

            myEmpleado.Codigo   = InCodigo.Text;
            myEmpleado.Nombre   = InNombre.Text;
            myEmpleado.Apellido = InApellido.Text;
            myEmpleado.Cargo    = InCargo.Text;
            myEmpleado.Salario  = InSalario.Text;
            myEmpleado.Area     = InArea.Text;
            myEmpleado.Ciudad   = InCiudad.Text;

            if (!datos.ExisteEmpleado(InCodigo.Text))
            {
                if (datos.InsertarEmpleadoBD(myEmpleado))
                {
                    LabelRta.Text = "El registro fue insertado correctamente";
                }
                else
                {
                    LabelRta.Text = "Error al insertar " + datos.error;
                }
            }
            else
            {
                ErrorCodigo.Text = "El codigo  " + InCodigo.Text + " ya existe";
            }
        }
示例#4
0
        private void InsertarDatosBD()
        {
            Empleado myEmpleado = new Empleado();

            myEmpleado.Codigo   = InCodigo.Text;
            myEmpleado.Nombre   = InNombre.Text;
            myEmpleado.Apellido = InApellido.Text;
            myEmpleado.Cargo    = InCargo.Text;
            myEmpleado.Salario  = InSalario.Text;
            myEmpleado.Area     = InArea.Text;
            myEmpleado.Ciudad   = InCiudad.Text;

            if (!datos.ExisteEmpleado(myEmpleado.Codigo))
            {
                if (datos.InsertarEmpleadoBD(myEmpleado))
                {
                    lblrespuesta.Text = "El registro fue insertado correctamente";
                    LimpiarCampos();
                }
                else
                {
                    lblrespuesta.Text = "Error al insertar " + datos.error;
                }
            }
            else
            {
                lblrespuesta.Text = "El registro ya existe";
            }
        }