Exemplo n.º 1
0
    protected void gdvGrilla_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            btnEliminar.Enabled = true;

            ID = int.Parse(gdvGrilla.SelectedDataKey.Value.ToString());
            PacienteEntidad p = PacienteDao.ObtenerPorID(ID.Value);

            txtNombre.Text   = p.Nombre;
            txtApellido.Text = p.Apellido;
            if (p.FechaNacimiento != null)
            {
                txtFechaNac.Text = p.FechaNacimiento.ToShortDateString();
            }
            //cboTipoDoc.SelectedIndex = ((int)p.IdTipoDoc -1);
            cboTipoDoc.SelectedIndex = (int)p.IdTipoDoc;
            txtNroDoc.Text           = p.NroDoc.ToString();
            if (p.Sexo.HasValue)
            {
                if (p.Sexo.Value)
                {
                    rdbSexoM.Checked = true;
                }
                else
                {
                    rdbSexoF.Checked = true;
                }
            }
            //cboLocalidad.SelectedIndex = ((int)p.IdLocalidad -1);
            cboLocalidad.SelectedIndex = (int)p.IdLocalidad;
            txtCalle.Text    = p.Calle;
            txtNroCalle.Text = p.NroCalle.ToString();
            if (p.Piso.HasValue)
            {
                txtPiso.Text = p.Piso.ToString();
            }
            if (p.Departamento != null)
            {
                txtDepto.Text = p.Departamento;
            }
            if (p.Telefono != null)
            {
                txtTelefono.Text = p.Telefono;
            }
            if (p.Celular != null)
            {
                txtCelular.Text = p.Celular;
            }
        }
        catch (Exception ex) { txtResultado.Text = "Error= " + ex.Message; }
    }
Exemplo n.º 2
0
    protected void gdvPacFac_SelectedIndexChanged(object sender, EventArgs e)
    {
        Limpiar();
        Limpiar2();
        txtFecha.Text = DateTime.Now.ToShortDateString();

        try
        {
            ID = int.Parse(gdvPacFac.SelectedDataKey.Value.ToString());
            PacienteEntidad p = PacienteDao.ObtenerPorID(ID.Value);

            txtNombre.Text   = p.Nombre;
            txtApellido.Text = p.Apellido;
            txtNroDoc.Text   = p.NroDoc.ToString();

            CargarGrillaIntervenciones(ID.Value);
        }
        catch (Exception ex) { txtResultado.Text = "Error = " + ex.Message; }

        txtNroFactura.Text = (FacturaDao.NroFactura()).ToString();
    }