Exemple #1
0
 public M_Structure SelReturnModel(int id)
 {
     using (SqlDataReader reader = Sql.SelReturnReader(strTableName, PK, id))
     {
         if (reader.Read())
         {
             return(initMod.GetModelFromReader(reader));
         }
         else
         {
             return(null);
         }
     }
 }
Exemple #2
0
 public M_Structure SelReturnModel(int id)
 {
     if (id == 0)
     {
         M_Structure model = new M_Structure();
         model.Name     = "根结构";
         model.ParentID = 0;
         return(model);
     }
     using (DbDataReader reader = Sql.SelReturnReader(TbName, PK, id))
     {
         if (reader.Read())
         {
             return(initMod.GetModelFromReader(reader));
         }
         else
         {
             return(null);
         }
     }
 }