public void Insert(string p_id, ExaminationType e)
        {
            IDatabase db = new MSSqlDatabase();
            db.Connect();

            DbCommand command = db.CreateCommand(sqlINSERT);
            PrepareCommand(db, command, e);
            e.Id = db.ExecuteScalar(command);

            db.Close();
        }
        public void Delete(ExaminationType e)
        {
            IDatabase db = new MSSqlDatabase();
            db.Connect();

            DbCommand command = db.CreateCommand(sqlDELETE);
            command.Parameters.Add(db.CreateParameter("@id", "int"));
            command.Parameters["@id"].Value = e.Id;

            db.ExecuteNonQuery(command);

            db.Close();
        }
        private List<ExaminationType> Read(DbDataReader reader, IDatabase db)
        {
            List<ExaminationType> types = new List<ExaminationType>();

            while (reader.Read())
            {
                ExaminationType e = new ExaminationType();
                e.Id = reader.GetInt32(0);
                e.Name = reader.GetString(1);
                e.Description = reader.GetString(2);
                e.Prices = this.SelectPrices(e.Id, db);

                types.Add(e);
            }

            return types;
        }
        private void PrepareCommand(IDatabase db, DbCommand cmd, ExaminationType er)
        {
            cmd.Parameters.Add(db.CreateParameter("@name", "varchar", er.Name.Length));
            cmd.Parameters["@name"].Value = er.Name;

            cmd.Parameters.Add(db.CreateParameter("@description", "varchar", er.Description.Length));
            cmd.Parameters["@description"].Value = er.Description;
        }