Пример #1
0
        private void DataPortal_Create(CriteriaCs criteria)
        {
            Random r = new Random();

            Oid = (long)r.Next();
            _puerto_despachantes = Store.PuertoDespachantes.NewChildList();
        }
Пример #2
0
        /// <summary>
        /// Builds a PuertoList from IList<!--<Puerto>--> and retrieve PuertoInfo Childs from DB
        /// </summary>
        /// <param name="list"></param>
        /// <returns>PuertoList</returns>
        public static PuertoList GetChildList(IList <Puerto> list)
        {
            PuertoList flist = new PuertoList();

            if (list != null)
            {
                int        sessionCode = Puerto.OpenSession();
                CriteriaEx criteria    = null;

                flist.IsReadOnly = false;

                foreach (Puerto item in list)
                {
                    criteria = PuertoDespachante.GetCriteria(sessionCode);
                    criteria.AddEq("OidPuerto", item.Oid);
                    criteria.AddOrder("Codigo", true);
                    item.PuertoDespachantes = PuertoDespachantes.GetChildList(criteria.List <PuertoDespachante>());


                    flist.AddItem(item.GetInfo());
                }

                flist.IsReadOnly = true;

                Puerto.CloseSession(sessionCode);
            }

            return(flist);
        }
Пример #3
0
        private void Fetch(Puerto source)
        {
            try
            {
                SessionCode = source.SessionCode;

                _base.CopyValues(source);

                IDataReader reader;
                string      query = string.Empty;

                PuertoDespachante.DoLOCK(Session());
                query  = PuertoDespachantes.SELECT(this);
                reader = nHMng.SQLNativeSelect(query, Session());
                _puerto_despachantes = PuertoDespachantes.GetChildList(reader);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }
            MarkOld();
        }