예제 #1
0
        public Persona obtenerPersona(decimal historia)
        {
            objPersona = null;
            try
            {
                cmd = new SqlCommand();
                cmd.Connection = Conexion.instancia().obtenerConexion();
                cmd.CommandText = "PersonaObtener";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@historia",historia);
                dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    objPersona = new Persona();
                    objPersona.persona = (decimal)dr["idHistoria"];
                    objPersona.nroHistoria = dr["HClinica"].ToString();
                    objPersona.aPaterno = dr["aPaterno"].ToString();
                    objPersona.aMaterno = dr["aMaterno"].ToString();
                    objPersona.nombres = dr["nombres"].ToString();
                    objPersona.sexo = dr["sexo"].ToString();
                    objPersona.fechaNacimiento = (DateTime)dr["fnacimiento"];

                   // objPersona.activo = (char)dr["activo"];
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                this.cerrar();
            }
            return objPersona;
        }
예제 #2
0
        public int registraPersona(Persona objPersona)
        {
            int retorno = 0;
            try
            {

            }
            catch (Exception)
            {
                throw;
            }
            return retorno;
        }