Esempio n. 1
0
        protected void btnMostrarTodos_Click(object sender, EventArgs e)
        {
            ServiceMyAgendaClient cliente = new ServiceMyAgendaClient();

            gvDatos.DataSource = cliente.MostrarContactos();
            gvDatos.DataBind();
        }
Esempio n. 2
0
        protected void btnEliminar_Click(object sender, EventArgs e)
        {
            ServiceMyAgendaClient cliente = new ServiceMyAgendaClient();

            if (cliente.ElimirarContacto(int.Parse(txtId.Text)) > 0)
            {
                lbMensaje.Text = "Contacto eliminado con Exito...";
            }
        }
Esempio n. 3
0
        protected void btnEditar_Click(object sender, EventArgs e)
        {
            ServiceMyAgendaClient cliente = new ServiceMyAgendaClient();
            MyAgenda agenda = new MyAgenda();

            agenda.Id        = int.Parse(txtId.Text);
            agenda.Nombre    = txtNombre.Text;
            agenda.Apellidos = txtApellidos.Text;
            agenda.Telefono  = txtTelefono.Text;
            agenda.Correo    = txtCorreo.Text;

            if (cliente.EditarContacto(agenda) > 0)
            {
                lbMensaje.Text = "Contacto editado con Exito...";
            }
        }
Esempio n. 4
0
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            ServiceMyAgendaClient cliente = new ServiceMyAgendaClient();
            MyAgenda agenda = new MyAgenda();

            if (txtId.Text.Trim() != "")
            {
                agenda            = cliente.BuscarContacto(int.Parse(txtId.Text));
                txtNombre.Text    = agenda.Nombre;
                txtApellidos.Text = agenda.Apellidos;
                txtTelefono.Text  = agenda.Telefono;
                txtCorreo.Text    = agenda.Correo;
            }
            else
            {
                lbMensaje.Text = "Escriba el ID del Contacto...";
            }
        }