示例#1
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);
        }
        internal void CopyValues(PuertoDespachante source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);
        }
示例#3
0
        /// <summary>
        /// Builds a PuertoDespachanteList
        /// </summary>
        /// <param name="list"></param>
        /// <returns>PuertoDespachanteList</returns>
        public static PuertoDespachanteList GetList(bool childs)
        {
            CriteriaEx criteria = PuertoDespachante.GetCriteria(PuertoDespachante.OpenSession());

            criteria.Childs = childs;

            criteria.Query = SELECT();

            PuertoDespachanteList list = DataPortal.Fetch <PuertoDespachanteList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
示例#4
0
        // called to copy objects data from list
        private void Fetch(IDataReader reader)
        {
            this.RaiseListChangedEvents = false;

            IsReadOnly = false;

            while (reader.Read())
            {
                this.AddItem(PuertoDespachante.GetChild(reader).GetInfo());
            }

            IsReadOnly = true;

            this.RaiseListChangedEvents = true;
        }
示例#5
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();
        }
示例#6
0
 public void CopyFrom(PuertoDespachante source)
 {
     _base.CopyValues(source);
 }
示例#7
0
 internal static string SELECT(QueryConditions conditions)
 {
     return(PuertoDespachante.SELECT(conditions, false));
 }