Exemplo n.º 1
0
 // ----------------------------------------------------------------------------------------
 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);
 }
Exemplo n.º 2
0
 // ----------------------------------------------------------------------------------------
 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());
 }
Exemplo n.º 3
0
 // ----------------------------------------------------------------------------------------
 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);
 }