Example #1
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;
 }
Example #2
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;
 }
Example #3
0
 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;
 }
Example #4
0
 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;
     }
 }
Example #5
0
        public ObservableCollection<InnerRoad> getAllRelatedInnerRoad()
        {
            if (!isValid(new List<string>() { "prName", "pID" }))
                return null;

            ObservableCollection<InnerRoad> innerRoadList = new ObservableCollection<InnerRoad>();
            string sqlCommand = String.Format(@"select irID from InnerRoad where prID={0}", prID);
            Sql sql = new Sql();
            SqlDataReader reader = sql.selectAllInnerRoadByPrID(sqlCommand);
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    int irID = Int32.Parse(reader[0].ToString());
                    InnerRoad innerRoad = new InnerRoad();
                    innerRoad.id = irID;
                    innerRoad.select();
                    innerRoadList.Add(innerRoad);
                }
                sql.closeConnection();
                return innerRoadList;
            }
            else
            {
                sql.closeConnection();
                return null;
            }
        }
Example #6
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;
 }
Example #7
0
 public ObservableCollection<Condition> getAllRelatedCondition()
 {
     if (!isValid(new List<string>() { "prName", "pID" }))
         return null;
     ObservableCollection<Condition> conditionList = new ObservableCollection<Condition>();
     string sqlCommand = String.Format("select cdID from Condition where prID={0}", prID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectConditionIDByPrID(sqlCommand);
     while (reader.Read())
     {
         int cdID = Int32.Parse(reader[0].ToString());
         Condition condition = new Condition();
         condition.id = cdID;
         condition.select();
         conditionList.Add(condition);
     }
     sql.closeConnection();
     return conditionList;
 }
Example #8
0
 public override bool select()
 {
     if (!isValid(new List<string> { "nsWidth", "nsHeight", "prID"}))
         return false;
     string sqlCommand = String.Format(@"select * from NetSize where nsID={0}", nsID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectNetSize(sqlCommand);
     if (!reader.HasRows)
         return false;
     initBySqlDataReader(reader);
     sql.closeConnection();
     return true;
 }
Example #9
0
 public override bool select()
 {
     if (!isValid(new List<string>() { "fInUse", "fScore", "prID" }))
         return false;
     string sqlCommand = String.Format("select * from Feature where fID={0}", fID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectFeature(sqlCommand);
     reader.Read();
     InitBySqlDataReader(reader);
     sql.closeConnection();
     return true;
 }
Example #10
0
 public override bool select()
 {
     if (!isValid(new List<string>() { "prName", "pID" }))
         return false;
     string sqlCommand = String.Format("select * from Program where prID={0}", prID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectProgram(sqlCommand);
     reader.Read();
     InitBySqlDataReader(reader);
     sql.closeConnection();
     return true;
 }
Example #11
0
 public ObservableCollection<Label> getAllRelatedLabel()
 {
     if (!isValid())
         return null;
     ObservableCollection<Label> labelList = new ObservableCollection<Label>();
     string sqlCommand = String.Format("select lID from Label where pID = {0}", pID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectAllLabelIDByPID(sqlCommand);
     while (reader.Read())
     {
         int lID = Int32.Parse(reader[0].ToString());
         Label label = new Label();
         label.id = lID;
         label.select();
         labelList.Add(label);
     }
     sql.closeConnection();
     return labelList;
 }
Example #12
0
 public ObservableCollection<Program> getAllRelatedProgram()
 {
     if (!isValid())
         return null;
     ObservableCollection<Program> programList = new ObservableCollection<Program>();
     string sqlCommand = String.Format("select prID from Program where pID = {0}", pID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectProgramIDByPmID(sqlCommand);
     while (reader.Read())
     {
         int prID = Int32.Parse(reader[0].ToString());
         Program program = new Program();
         program.id = prID;
         program.select();
         programList.Add(program);
     }
     sql.closeConnection();
     return programList;
 }
Example #13
0
 public override bool select()
 {
     if (!isValid(new List<string>() { "pName", "pPath", "pBaseMapIndex" }))
         return false;
     string sqlCommand = String.Format("select * from Project where pID={0}", pID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectProjectAndMap(sqlCommand);
     reader.Read();
     id = Int32.Parse(reader[0].ToString());
     name = reader[1].ToString();
     path = reader[2].ToString();
     baseMapIndex = Int32.Parse(reader[3].ToString());
     sql.closeConnection();
     return true;
 }
Example #14
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;
 }
Example #15
0
        public ObservableCollection<Village> getAllRelatedVillage()
        {
            if (!isValid(new List<string>() { "prName", "pID" }))
                return null;

            ObservableCollection<Village> villageList = new ObservableCollection<Village>();
            string sqlCommand = String.Format(@"select vID from Village where prID={0}", prID);
            Sql sql = new Sql();
            SqlDataReader reader = sql.selectAllVillageByPrID(sqlCommand);
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    int vID = Int32.Parse(reader[0].ToString());
                    Village village = new Village();
                    village.id = vID;
                    village.select();
                    villageList.Add(village);
                }
                sql.closeConnection();
                return villageList;
            }
            else
            {
                sql.closeConnection();
                return null;
            }
        }
Example #16
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;
 }
Example #17
0
 public override bool select()
 {
     if (!isValid(new List<string>() { "prID", "cdID", "cfValue" }))
         return false;
     string sqlCommand = String.Format("select * from Config where cfID={0}", cfID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectConfig(sqlCommand);
     reader.Read();
     InitBySqlDataReader(reader);
     sql.closeConnection();
     return true;
 }