예제 #1
0
 // запрос на просто список мостов
 public virtual List<BridgeData> Load()
 {
     // Получить список мостов в базе (главное - ID)
     string sql =
         "SELECT Br.idBr as ID, Br.brName AS BRNAME FROM Br ";
     query.Select(sql);
     List<DataRows> rows = query.GetRows();
     string LastBrId = "";
     BridgeData bd = null;
     List<BridgeData> Returnrows=new List<BridgeData>();
     foreach (DataRows row in rows)
     {
         string BrId = row.FieldByName("ID");
         if (LastBrId != BrId)
         {
             // flush
             if (bd != null)
                 Returnrows.Add(bd);
             // make new
             bd = new BridgeData(int.Parse(BrId), row.FieldByName("BRNAME"));
         }
     }
     if (bd != null)
         Returnrows.Add(bd);
     return Returnrows;
 }
예제 #2
0
        public virtual List <BridgeData> Load() // запрос на просто список мостов
        {
            // Получить список мостов в базе (главное - ID)
            string sql =
                "SELECT Br.idBr as ID, Br.brName AS BRNAME FROM Br ";

            query.Select(sql);
            List <DataRows>   rows       = query.GetRows();
            string            LastBrId   = "";
            BridgeData        bd         = null;
            List <BridgeData> Returnrows = new List <BridgeData>();

            foreach (DataRows row in rows)
            {
                string BrId = row.FieldByName("ID");
                if (LastBrId != BrId)
                {
                    // flush
                    if (bd != null)
                    {
                        Returnrows.Add(bd);
                    }
                    // make new
                    bd = new BridgeData(int.Parse(BrId), row.FieldByName("BRNAME"));
                }
            }
            if (bd != null)
            {
                Returnrows.Add(bd);
            }
            return(Returnrows);
        }
예제 #3
0
 /// <summary>
 /// Adds the bridge.
 /// </summary>
 /// <param name="bridgeData">The bridge data.</param>
 public void AddBridge(BridgeData bridgeData)
 {
     if (Bridges == null)
     {
         Bridges = new List <BridgeData>();
     }
     Bridges.Add(bridgeData);
 }
예제 #4
0
 /// <summary>
 /// Adds the bridge.
 /// </summary>
 /// <param name="bridgeData">The bridge data.</param>
 public void AddBridge(BridgeData bridgeData)
 {
     if (Bridges == null)
         Bridges = new List<BridgeData>();
     Bridges.Add(bridgeData);
 }