// ---------------------------------------------------------------------------------------- public static CompSubType GetCompSubType(int id) { // return a single comp sub type based on the comp sub type ID string sql = "SELECT cst.CompSubTypeID, cst.CompTypeID, ct.CompTypeName, cst.CompSubTypeName, cst.CompSubTypeDesc " + "FROM CompType AS ct INNER JOIN CompSubType AS cst ON cst.CompTypeID = ct.CompTypeID " + "WHERE cst.CompSubTypeID = " + id.ToString(); PetaPoco.Database db = new PetaPoco.Database("ElecLibConnString"); return db.Single<CompSubType>(sql); }
// ---------------------------------------------------------------------------------------- public static CompType GetCompType(int compTypeID) { PetaPoco.Database db = new PetaPoco.Database("ElecLibConnString"); return db.Single<CompType> ("SELECT CompTypeID, CompTypeName FROM CompType " + "WHERE CompTypeID = " + compTypeID.ToString()); }
// ---------------------------------------------------------------------------------------- public static CompType GetCompType(int id) { // return a single comp type based on the comp type ID PetaPoco.Database db = new PetaPoco.Database("ElecLibConnString"); return db.Single<CompType>(id); }