Пример #1
0
        public void Test_RC_Owners_GetOwnersToKis(int id_sob_kis)
        {
            RC_Owners ow = new RC_Owners();

            WL(ow.GetOwnersOfKis(id_sob_kis));
            Console.WriteLine("id : {0}", ow.GetIDOwnersOfKis(id_sob_kis));
        }
Пример #2
0
        /// <summary>
        /// Определить Id владельца (если id нет в системе RailCars создать из данных КИС)
        /// </summary>
        /// <param name="id_sob_kis"></param>
        /// <param name="id_owner_country"></param>
        /// <returns></returns>
        public int?DefinitionIDOwner(int id_sob_kis, int?id_owner_country)
        {
            int?id_own = rs_own.GetIDOwnersOfKis(id_sob_kis);

            if (id_own == null)
            {
                KometaSobstvForNakl sfn = kc.GetSobstvForNakl(id_sob_kis);
                if (sfn != null)
                {
                    int res = rs_own.SaveOwners(new OWNERS()
                    {
                        id_owner    = 0,
                        name        = sfn.NPLAT,
                        abr         = sfn.ABR,
                        id_country  = id_owner_country,
                        id_ora      = id_sob_kis,
                        id_ora_temp = null,
                    });
                    if (res > 0)
                    {
                        id_own = res;
                    }
                }
            }
            return(id_own);
        }