Exemple #1
0
        public void Test_RC_WaysToStations(int id_station, string num)
        {
            RC_Ways ws = new RC_Ways();
            WAYS    w  = ws.GetWaysOfStations(id_station, num);
            int?    nw = ws.GetIDWaysToStations(id_station, num);

            WL(w);
            Console.WriteLine(" id: {0}", nw);
        }
Exemple #2
0
 /// <summary>
 /// Определить ID пути системы Railcars (если ID нет в системе создать путь)
 /// </summary>
 /// <param name="id_station_kis"></param>
 /// <param name="num_way"></param>
 /// <returns></returns>
 public int?DefinitionIDWays(int id_station, int?num_way)
 {
     if (num_way != null)
     {
         int?way = rs_ways.GetIDWaysToStations(id_station, ((int)num_way).ToString());
         if (way == null)
         {
             int res = rs_ways.SaveWays(new WAYS()
             {
                 id_way       = 0,
                 id_stat      = id_station,
                 id_park      = null,
                 num          = ((int)num_way).ToString(),
                 name         = "?",
                 vag_capacity = null,
                 order        = null,
                 bind_id_cond = null,
                 for_rospusk  = null,
             });
             if (res > 0)
             {
                 return(res);
             }
         }
         return(way);
     }
     else
     {
         WAYS ws = rs_ways.GetWaysOfStations(id_station).OrderBy(w => w.num).FirstOrDefault();
         if (ws != null)
         {
             return(ws.id_way);
         }
     }
     return(null);
 }