protected override void GrabarEntidad() { base.GrabarEntidad(); _pacienteDTO = new PacienteDTO(); if(txtId.Text != String.Empty) _pacienteDTO.ID = Convert.ToInt32(txtId.Text); _pacienteDTO.Nombre = txtNombre.Text; _pacienteDTO.Apellido = txtApellido.Text; _pacienteDTO.NumDocumento = txtDocumento.Text; _pacienteDTO.Direccion = txtDireccion.Text; _pacienteDTO.Comentario = txtComentario.Text; if(cmbObraSocial.SelectedValue!=null) _pacienteDTO.ObraSocialId = (int)cmbObraSocial.SelectedValue; if(cmbSexo.SelectedItem!=null) _pacienteDTO.Sexo = cmbSexo.SelectedItem.ToString(); }
private void gridMain_Click(object sender, EventArgs e) { DataRow selectedRow = ((DataRowView)this.MainBindingSource.Current).Row; int selectedId = (int)selectedRow["ID"]; _pacienteDTO = _pacienteAssembler.CreateDTO(_pacienteService.GetById(selectedId)); this.MostrarEntidad(); }