예제 #1
0
 public override bool select()
 {
     if (chID == C.ERROR_INT)
         return false;
     string sqlCommand = String.Format("select * from CommonHouse where chID={0}", chID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectCommonHouse(sqlCommand);
     initBySqlDataReader(reader);
     sql.closeConnection();
     return true;
 }
예제 #2
0
파일: MainRoad.cs 프로젝트: Leooonard/CGXM
 public override bool update()
 {
     if (!isValid())
         return false;
     string sqlCommand = String.Format(@"update MainRoad set prID={0},mrName='{1}',mrPath='{2}' where mrID={3}"
         , prID, mrName, mrPath, mrID);
     Sql sql = new Sql();
     return sql.updateMainRoad(sqlCommand);
 }
예제 #3
0
파일: MainRoad.cs 프로젝트: Leooonard/CGXM
 public override bool select()
 {
     if (!isValid(new List<string>() { "prID", "mrName", "mrPath" }))
         return false;
     string sqlCommand = String.Format(@"select * from MainRoad where mrID={0}", mrID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectMainRoad(sqlCommand);
     initBySqlDataReader(reader);
     sql.closeConnection();
     return true;
 }
예제 #4
0
 public override bool select()
 {
     if (cpsID == C.ERROR_INT)
         return false;
     string sqlCommand = String.Format("select * from CityPlanStandard where cpsID = {0}", cpsID.ToString());
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectCityPlanStandard(sqlCommand);
     reader.Read();
     cpsID = Int32.Parse(reader[0].ToString());
     cpsNumber = reader[1].ToString();
     cpsShortDescription = reader[2].ToString();
     cpsLongDescription = reader[3].ToString();
     sql.closeConnection();
     return true;
 }
예제 #5
0
파일: MainRoad.cs 프로젝트: Leooonard/CGXM
 public override bool save()
 {
     if (!isValid(new List<string>() { "mrID" }))
         return false;
     string sqlCommand = String.Format(@"insert into MainRoad (prID,mrName,mrPath) values ({0}, '{1}', '{2}')"
         , prID, mrName, mrPath);
     Sql sql = new Sql();
     return sql.insertMainRoad(sqlCommand);
 }
예제 #6
0
 public override bool select()
 {
     if (!isValid(new List<string>() { "pID", "lContent", "lMapLayerName", "lIsChoosed"}))
         return false;
     string sqlCommand = String.Format(@"select * from Label where lID={0}", lID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectLabel(sqlCommand);
     this.initBySqlDataReader(reader);
     sql.closeConnection();
     return true;
 }
예제 #7
0
 public static bool IsCityPlanStandardNumberAndShortDescription(string number, string shortDescription)
 {
     string SqlCommand = String.Format(@"select cpsID from CityPlanStandard where cpsNumber='{0}'", number);
     Sql sql = new Sql();
     int cpsID = sql.selectCityPlanStandardIDByCpsNumber(SqlCommand);
     if (cpsID == C.ERROR_INT)
         return false;
     CityPlanStandard cityPlanStandard = new CityPlanStandard();
     cityPlanStandard.id = cpsID;
     cityPlanStandard.select();
     return cityPlanStandard.shortDescription == shortDescription;
 }
예제 #8
0
파일: Village.cs 프로젝트: Leooonard/CGXM
 public bool saveWithoutCheck()
 {
     string sqlCommand = String.Format(@"Insert into Village (prID,vName,vBoundary,vInUse) values({0},'{1}','{2}',{3})"
         , prID, vName, vBoundary, vInUse ? 1 : 0);
     Sql sql = new Sql();
     return sql.insertVillage(sqlCommand);
 }
예제 #9
0
파일: Village.cs 프로젝트: Leooonard/CGXM
 public override bool update()
 {
     if (!isValid())
         return false;
     string sqlCommand = String.Format(@"update Village set prID={0},vName='{1}',vBoundary='{2}',vInUse={3} where vID={4}"
         , prID, vName, vBoundary, vInUse ? 1 : 0, vID);
     Sql sql = new Sql();
     return sql.updateVillage(sqlCommand);
 }
예제 #10
0
파일: InnerRoad.cs 프로젝트: Leooonard/CGXM
 public override bool update()
 {
     if (!isValid())
         return false;
     string sqlCommand = String.Format(@"update InnerRoad set prID={0},vID={1},irName='{2}',irPath='{3}' where irID={4}"
         , prID, vID, irName, irPath, irID);
     Sql sql = new Sql();
     return sql.updateInnerRoad(sqlCommand);
 }
예제 #11
0
파일: Village.cs 프로젝트: Leooonard/CGXM
 public override bool save()
 {
     if (!isValid(new List<string>() { "vID" }))
         return false;
     string sqlCommand = String.Format(@"Insert into Village (prID,vName,vBoundary,vInUse) values({0},'{1}','{2}',{3})"
         , prID, vName, vBoundary, vInUse ? 1 : 0);
     Sql sql = new Sql();
     return sql.insertVillage(sqlCommand);
 }
예제 #12
0
파일: InnerRoad.cs 프로젝트: Leooonard/CGXM
 public bool saveWithoutCheck()
 {
     string sqlCommand = String.Format(@"insert into InnerRoad (prID,vID,irName,irPath) values ({0},{1},'{2}','{3}')"
         , prID, vID, irName, irPath);
     Sql sql = new Sql();
     return sql.insertInnerRoad(sqlCommand);
 }
예제 #13
0
파일: InnerRoad.cs 프로젝트: Leooonard/CGXM
 public override bool save()
 {
     if (!isValid(new List<string>() { "irID" }))
         return false;
     string sqlCommand = String.Format(@"insert into InnerRoad (prID,vID,irName,irPath) values ({0},{1},'{2}','{3}')"
         , prID, vID, irName, irPath);
     Sql sql = new Sql();
     return sql.insertInnerRoad(sqlCommand);
 }
예제 #14
0
 public static int GetLastCommonHouseID()
 {
     string sqlCommand = String.Format("select max(chID) from CommonHouse");
     Sql sql = new Sql();
     return sql.selectMaxCommonHouseID(sqlCommand);
 }
예제 #15
0
 public override bool update()
 {
     if (!isValid())
         return false;
     string sqlCommand = String.Format(@"update Label set pID={0},lContent='{1}',lMapLayerName='{2}',lIsChoosed={3} where lID={4}"
         , pID, lContent, lMapLayerName, lIsChoosed ? 1 : 0, lID);
     Sql sql = new Sql();
     return sql.updateLabel(sqlCommand);
 }
예제 #16
0
파일: Village.cs 프로젝트: Leooonard/CGXM
 public override bool delete()
 {
     if (!isValid(new List<string>() { "prID", "vName", "vBoundary", "vInUse" }))
         return false;
     string sqlCommand = String.Format(@"delete from Village where vID={0}", vID);
     Sql sql = new Sql();
     return sql.deleteVillage(sqlCommand);
 }
예제 #17
0
 public override bool delete()
 {
     if (!isValid(new List<string>() { "pID", "lContent", "lMapLayerName", "lIsChoosed"}))
         return false;
     string sqlCommand = String.Format(@"delete from Label where lID={0}", lID);
     Sql sql = new Sql();
     return sql.deleteLabel(sqlCommand);
 }
예제 #18
0
파일: Village.cs 프로젝트: Leooonard/CGXM
 public override bool select()
 {
     if (!isValid(new List<string>() { "prID", "vName", "vBoundary", "vInUse" }))
         return false;
     string sqlCommand = String.Format("select * from Village where vID={0}", vID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectVillage(sqlCommand);
     initBySqlDataReader(reader);
     sql.closeConnection();
     return true;
 }
예제 #19
0
 public static Label GetLabelByMapLayerName(string mapLayerName)
 {
     string sqlCommand = String.Format(@"select * from Label where lMapLayerName='{0}'", mapLayerName);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectLabelByMapLayerName(sqlCommand);
     Label label = new Label();
     label.initBySqlDataReader(reader);
     sql.closeConnection();
     return label;
 }
예제 #20
0
파일: Village.cs 프로젝트: Leooonard/CGXM
 public InnerRoad getRelatedInnerRoad()
 {
     if (!isValid(new List<string>() { "prID", "vName", "vBoundary", "vInUse" }))
         return null;
     string sqlCommand = String.Format("select irID from InnerRoad where vID={0}", vID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectInnerRoadIDByVillageID(sqlCommand);
     if (reader.HasRows)
     {
         reader.Read();
         int innerRoadID = Int32.Parse(reader[0].ToString());
         InnerRoad innerRoad = new InnerRoad();
         innerRoad.id = innerRoadID;
         innerRoad.select();
         return innerRoad;
     }
     else
     {
         return null;
     }
 }
예제 #21
0
 public static CityPlanStandard GetCityPlanStandardByNumber(string number)
 {
     string sqlCommand = String.Format(@"select cpsID from CityPlanStandard where cpsNumber='{0}'", number);
     Sql sql = new Sql();
     int cpsID = sql.selectCityPlanStandardIDByCpsNumber(sqlCommand);
     if (cpsID == C.ERROR_INT)
         return null;
     CityPlanStandard cityPlanStandard = new CityPlanStandard();
     cityPlanStandard.id = cpsID;
     cityPlanStandard.select();
     return cityPlanStandard;
 }
예제 #22
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;
     }
 }
예제 #23
0
 public static ObservableCollection<CityPlanStandard> GetAllCityPlanStandard()
 {
     if (allCityPlanStandardList != null)
         return allCityPlanStandardList;
     allCityPlanStandardList = new ObservableCollection<CityPlanStandard>();
     string sqlCommand = String.Format(@"select cpsID from CityPlanStandard");
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectAllCityPlanStandard(sqlCommand);
     while (reader.Read())
     {
         int cpsID = Int32.Parse(reader[0].ToString());
         CityPlanStandard cityPlanStandard = new CityPlanStandard();
         cityPlanStandard.id = cpsID;
         cityPlanStandard.select();
         allCityPlanStandardList.Add(cityPlanStandard);
     }
     return allCityPlanStandardList;
 }
예제 #24
0
파일: Village.cs 프로젝트: Leooonard/CGXM
 public ObservableCollection<House> getAllRelatedHouse()
 {
     if (!isValid(new List<string>() { "prID", "vName", "vBoundary", "vInUse" }))
         return null;
     ObservableCollection<House> houseList = new ObservableCollection<House>();
     string sqlCommand = String.Format("select hID from House where vID={0}", vID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectHouseIDByVID(sqlCommand);
     if (reader.HasRows)
     {
         while (reader.Read())
         {
             int hID = Int32.Parse(reader[0].ToString());
             House house = new House();
             house.id = hID;
             house.select();
             houseList.Add(house);
         }
         sql.closeConnection();
         return houseList;
     }
     else
     {
         sql.closeConnection();
         return null;
     }
 }
예제 #25
0
파일: MainRoad.cs 프로젝트: Leooonard/CGXM
 public bool saveWithoutCheck()
 {
     string sqlCommand = String.Format(@"insert into MainRoad (prID,mrName,mrPath) values ({0}, '{1}', '{2}')"
         , prID, mrName, mrPath);
     Sql sql = new Sql();
     return sql.insertMainRoad(sqlCommand);
 }
예제 #26
0
파일: Village.cs 프로젝트: Leooonard/CGXM
 public static int GetLastVillageID()
 {
     string sqlCommand = String.Format("select max(vID) from Village");
     Sql sql = new Sql();
     return sql.selectMaxVillageID(sqlCommand);
 }
예제 #27
0
파일: MainRoad.cs 프로젝트: Leooonard/CGXM
 public override bool delete()
 {
     if (!isValid(new List<string>() { "prID", "mrName", "mrPath" }))
         return false;
     string sqlCommand = String.Format(@"delete from MainRoad where mrID={0}", mrID);
     Sql sql = new Sql();
     return sql.deleteMainRoad(sqlCommand);
 }
예제 #28
0
 public override bool save()
 {
     if (!isValid(new List<string>() { "lID"}))
         return false;
     string sqlCommand = String.Format(@"insert into Label (pID,lContent,lMapLayerName,lIsChoosed) values ({0}, '{1}', '{2}',{3})"
         , pID, lContent, lMapLayerName, lIsChoosed ? 1 : 0);
     Sql sql = new Sql();
     return sql.insertLabel(sqlCommand);
 }
예제 #29
0
파일: MainRoad.cs 프로젝트: Leooonard/CGXM
 public static int GetLastMainRoadID()
 {
     string sqlCommand = String.Format("select max(mrID) from MainRoad");
     Sql sql = new Sql();
     return sql.selectMaxMainRoadID(sqlCommand);
 }
예제 #30
0
 public override bool delete()
 {
     if (chID == C.ERROR_INT)
         return false;
     string sqlCommand = String.Format(@"delete from CommonHouse where chID={0}", chID);
     Sql sql = new Sql();
     return sql.deleteCommonHouse(sqlCommand);
 }