Exemple #1
0
        public static List <PersonsAndClientsModel> GetClients()
        {
            List <PersonsAndClientsModel> result = new List <PersonsAndClientsModel>();

            using (SqlConnection conn = MedNotesConnection())
            {
                SqlCommand cmd = conn.CreateCommand();
                cmd.CommandText = PersonsAndClientsModel.Get_Clients_SQL;
                cmd.CommandType = CommandType.Text;
                SqlDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    result.Add(PersonsAndClientsModel.ClientsDataFromDataReader(dr));
                }
            }

            return(result);
        }
Exemple #2
0
        public static List <PersonsAndClientsModel> GetPerson(int note_id)
        {
            List <PersonsAndClientsModel> result = new List <PersonsAndClientsModel>();

            using (SqlConnection conn = MedNotesConnection())
            {
                SqlCommand cmd = conn.CreateCommand();
                cmd.CommandText = PersonsAndClientsModel.Get_Person_SQL;
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.Add(new SqlParameter("@note_id", System.Data.SqlDbType.Int)
                {
                    Value = note_id
                });
                SqlDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    result.Add(PersonsAndClientsModel.PersonDataFromDataReader(dr));
                }
            }

            return(result);
        }