Beispiel #1
0
        /// <summary>
        /// Получить ID вагона системы Railcars (если id нет создать из данных КИС или создать временную строку)
        /// </summary>
        /// <param name="num_vag"></param>
        /// <param name="dt"></param>
        /// <param name="train_number"></param>
        /// <param name="id_sostav"></param>
        /// <param name="natur"></param>
        /// <param name="transit"></param>
        /// <returns></returns>
        public int DefinitionSetIDVagon(int num_vag, DateTime dt, int train_number, int?id_sostav, int?natur, bool transit)
        {
            int?id_vagons = rs_vag.GetIDVagons(num_vag, dt);

            if (id_vagons == null)
            {
                id_vagons = rs_vag.GetIDNewVagons(num_vag, dt);
                if (id_vagons == null)
                {
                    KometaVagonSob kvs = kc.GetVagonsSob(num_vag, dt);
                    VAGONS         wag;
                    if (kvs != null)
                    {
                        int?owner = DefinitionIDOwner(kvs.SOB, null);  // Определим id владельца (системы railCars)
                        wag = new VAGONS()
                        {
                            id_vag      = 0,
                            num         = num_vag,
                            id_ora      = null,
                            id_owner    = owner,
                            id_stat     = null,
                            is_locom    = train_number,
                            locom_seria = null,
                            rod         = kvs.ROD,
                            st_otpr     = "-",
                            date_ar     = kvs.DATE_AR,
                            date_end    = kvs.DATE_END,
                            date_in     = dt,
                            IDSostav    = id_sostav,
                            Natur       = natur,
                            Transit     = transit
                        };
                    }
                    else
                    {
                        wag = new VAGONS()
                        {
                            id_vag      = 0,
                            num         = num_vag,
                            id_ora      = null,
                            id_owner    = null,
                            id_stat     = null,
                            is_locom    = train_number,
                            locom_seria = null,
                            rod         = null,
                            st_otpr     = "-",
                            date_ar     = null,
                            date_end    = null,
                            date_in     = dt,
                            IDSostav    = id_sostav,
                            Natur       = natur,
                            Transit     = transit
                        };
                    }
                    id_vagons = rs_vag.SaveVAGONS(wag); // Вернуть id или ошибку
                }
            }
            return((int)id_vagons);
        }
Beispiel #2
0
        public void Test_KometaContent_KometaVagonSob(int num)
        {
            KometaContent kom_con = new KometaContent();

            foreach (KometaVagonSob t in kom_con.GetVagonsSob(num))
            {
                WL(t);
            }
        }
Beispiel #3
0
        public void Test_KometaContent_KometaVagonSob(int num, DateTime dt)
        {
            KometaContent kom_con = new KometaContent();

            WL(kom_con.GetVagonsSob(num, dt));
        }