예제 #1
0
    protected void brnGrabar_Click(object sender, EventArgs e)
    {
        try
        {
            objEmpleadoBE.IdEmpleado     = "";
            objEmpleadoBE.ApeEmpPat      = txtApe.Text;
            objEmpleadoBE.ApeEmpMat      = txtApeMat.Text;
            objEmpleadoBE.NomEmpleado    = txtNom.Text;
            objEmpleadoBE.Sexo           = cboGenero.SelectedValue.ToString();
            objEmpleadoBE.NroDNI         = txtDocumento.Text;
            objEmpleadoBE.Direccion      = txtDireccion.Text;
            objEmpleadoBE.IdDistrito     = cboDistrito.SelectedValue.ToString();
            objEmpleadoBE.Telefono       = txtTelefono.Text;
            objEmpleadoBE.Celular        = txtCelular.Text;
            objEmpleadoBE.Email          = txtCorreo.Text;
            objEmpleadoBE.IdEspecialidad = cboEspecialidad.SelectedValue.ToString();

            if (objEmpleadoBL.InsetarEmpleado(objEmpleadoBE) == true)
            {
                Response.Redirect("frmEmpleados.aspx");
            }
            else
            {
                lblMensaje.Text = "Error, verifique los datos";
            }
        }
        catch (Exception ex)
        {
            lblMensaje.Text = "Se ha producido el error: " + ex.Message;
        }
    }