Exemplo n.º 1
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";
            }
        }
Exemplo n.º 2
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";
            }
        }
Exemplo n.º 3
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 fue insertado correctamente";
                }
                else
                {
                    LabelRta.Text = "Error al insertar " + datos.error;
                }
            }
            else
            {
                ErrorCodigo.Text = "El codigo  " + InCodigo.Text + " ya existe";
            }
        }
Exemplo n.º 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";
            }
        }
Exemplo n.º 5
0
 protected void BtnBuscarCodigo(object sender, EventArgs e)
 {
     if (datos.ExisteEmpleado(inCodigoBuscar.Text))
     {
         Response.Redirect("Formulario.aspx?id=" + inCodigoBuscar.Text);
     }
     else
     {
         LabelBuscar.Text = "No existe este codigo";
     }
 }
Exemplo n.º 6
0
 protected void btnBuscarCodigo_Click(object sender, EventArgs e)
 {
     if (datos.ExisteEmpleado(txtBuscarCodigo.Text))
     {
         Response.Redirect("Formulario.aspx?id=" + txtBuscarCodigo.Text);
     }
     else
     {
         LabelBuscar.Text = "No existe el código en la BD";
     }
 }
Exemplo n.º 7
0
 protected void BtbBuscarCodigo_Click(object sender, EventArgs e)
 {
     if (datos.ExisteEmpleado(InCodigoBuscar.Text))
     {
         Response.Redirect("Formulario.aspx?id=" + InCodigoBuscar.Text);
     }
     else
     {
         lblrespuestaBuscar.Text = "No existe el codigo en la Base de datosz";
     }
 }
Exemplo n.º 8
0
 protected void btnbuscarcodigo_Click(object sender, EventArgs e)
 {
     if (datos.ExisteEmpleado(InCodigoBuscar.Text))
     {
         Response.Redirect("Formulario.aspx?id=" + InCodigoBuscar.Text);
     }
     else
     {
         lblbuscar.Text = "No Existe El Codigo En La Base De Datos";
     }
 }
Exemplo n.º 9
0
 protected void BtnBuscarCodigo_Click(object sender, EventArgs e)
 {
     if (datos.ExisteEmpleado(InCodigoaBuscar.Text))
     {
         Response.Redirect("Formulario.aspx?id=" + InCodigoaBuscar.Text);
     }
     else
     {
         LabelBuscar.Text = "No existe el codigo ingresado.";
     }
 }