private void btnPersonasGetInactivos_Click(object sender, EventArgs e) { List <PersonaDTO> personasList; personasList = PersonasServiceProxy.GetInActivos(); dgvPersonas.DataSource = personasList; }
private void btnInsert_Click(object sender, EventArgs e) { PersonaDTO newPersona; ResponseProxyDTO responseDTO; string strErrores = ""; newPersona = new PersonaDTO(); newPersona.NombreCompleto = txtNombre.Text; newPersona.Mail = txtEmail.Text; newPersona.Activo = chkActivo.Checked; responseDTO = PersonasServiceProxy.Insert(newPersona); if (responseDTO.NewId > 0) { MessageBox.Show("Se inserto el ID:" + responseDTO.NewId.ToString()); } else { MessageBox.Show("Errores: " + responseDTO.Errores); } }
private void btnGetById_Click(object sender, EventArgs e) { PersonaDTO oPersona; int intId; if (int.TryParse(txtPersonaId.Text, out intId)) { oPersona = PersonasServiceProxy.GetById(intId); if (oPersona != null) { txtPersonaOutput.Text = oPersona.ToString(); } else { txtPersonaOutput.Text = "No se encontro la Persona"; } } else { txtPersonaOutput.Text = "-ERROR-"; } }