Esempio n. 1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            long resp;

            ContratistaBE contratista = new ContratistaBE();

            try
            {
                contratista.Cedula    = txtCedulaCont.Text;
                contratista.Nombres   = txtNombreContratista.Text;
                contratista.Apellidos = txtPrimerApellido.Text;
                contratista.Direccion = txtDireccion.Text;
                contratista.Telefono  = txtTelefono.Text;
                resp = servVehiculo.RegistrarContratista(contratista);

                MessageBox.Show("El Contratista fue registrado satisfactoriamente", "Registrar Contratista");
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
                Response.Redirect("~/Vehiculos/frmRegistrarContratista.aspx");
                txtCedula.Focus();
            }
        }