예제 #1
0
파일: Village.cs 프로젝트: Leooonard/CGXM
 public CommonHouse getRelatedCommonHouse()
 {
     if (!isValid(new List<string>() { "prID", "vName", "vBoundary", "vInUse" }))
         return null;
     string sqlCommand = String.Format("select chID from CommonHouse where vID={0}", vID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectCommonHouseIDByVID(sqlCommand);
     if (reader.HasRows)
     {
         reader.Read();
         int commonHouseID = Int32.Parse(reader[0].ToString());
         CommonHouse commonHouse = new CommonHouse();
         commonHouse.id = commonHouseID;
         commonHouse.select();
         return commonHouse;
     }
     else
     {
         return null;
     }
 }