示例#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
 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
 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
 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
 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
 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
 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
 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
 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
 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);
 }