Exemplo n.º 1
0
        internal void DeleteSelf(Naviera parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            // if we're new then don't update the database
            if (this.IsNew)
            {
                return;
            }

            try
            {
                SessionCode = parent.SessionCode;
                Session().Delete(Session().Get <PrecioTrayectoRecord>(Oid));
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkNew();
        }
        internal void Update(Naviera parent)
        {
            this.RaiseListChangedEvents = false;

            // update (thus deleting) any deleted child objects
            foreach (PrecioTrayecto obj in DeletedList)
            {
                obj.DeleteSelf(parent);
            }

            // now that they are deleted, remove them from memory too
            DeletedList.Clear();

            // add/update any current child objects
            foreach (PrecioTrayecto obj in this)
            {
                if (obj.IsNew)
                {
                    obj.Insert(parent);
                }
                else
                {
                    obj.Update(parent);
                }
            }

            this.RaiseListChangedEvents = true;
        }
Exemplo n.º 3
0
        internal void Update(Naviera parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            this.OidNaviera = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                SessionCode = parent.SessionCode;
                PrecioTrayectoRecord obj = Session().Get <PrecioTrayectoRecord>(Oid);
                obj.CopyValues(this._base.Record);
                Session().Update(obj);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Exemplo n.º 4
0
        internal void Insert(Naviera parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            this.OidNaviera = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                parent.Session().Save(_base.Record);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Copia los atributos del objeto
        /// </summary>
        /// <param name="source">Objeto origen</param>
        protected void CopyValues(Naviera source)
        {
            if (source == null)
            {
                return;
            }

            _base.CopyValues(source);
            Oid = source.Oid;
        }
Exemplo n.º 6
0
        public void CopyValues(Naviera source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);
            _provider_base.CopyCommonValues(source);

            _provider_base.OidAcreedor = _record.Oid;
        }
Exemplo n.º 7
0
        public static PrecioTrayecto NewChild(Naviera parent)
        {
            if (!CanAddObject())
            {
                throw new System.Security.SecurityException(
                          moleQule.Resources.Messages.USER_NOT_ALLOWED);
            }

            PrecioTrayecto obj = new PrecioTrayecto();

            obj.OidNaviera = parent.Oid;

            return(obj);
        }
        protected void CopyValues(ExpedientInfo source, ExpenseList list
                                  , InputDeliveryLineList conceptos
                                  , InputDeliveryList albaranes)
        {
            if (source == null)
            {
                return;
            }

            Oid        = source.Oid;
            Expediente = source.Codigo;

            foreach (ExpenseInfo item in list)
            {
                if (item.OidExpediente == source.Oid)
                {
                    CheckGasto(item);
                }
            }

            foreach (InputDeliveryLineInfo item in conceptos)
            {
                if (item.OidExpediente == source.Oid)
                {
                    CheckGasto(list, albaranes.GetItem(item.OidAlbaran));
                }
            }

            if (Proveedor != null)
            {
                Proveedor = Proveedor.Substring(0, Proveedor.Length - 1);
            }
            if (Naviera != null)
            {
                Naviera = Naviera.Substring(0, Naviera.Length - 1);
            }
            if (Despachante != null)
            {
                Despachante = Despachante.Substring(0, Despachante.Length - 1);
            }
            if (TransportistaOrigen != null)
            {
                TransportistaOrigen = TransportistaOrigen.Substring(0, TransportistaOrigen.Length - 1);
            }
            if (TransportistaDestino != null)
            {
                TransportistaDestino = TransportistaDestino.Substring(0, TransportistaDestino.Length - 1);
            }
        }
Exemplo n.º 9
0
        public static NavieraList GetList(EEstado estado, bool childs)
        {
            CriteriaEx criteria = Proveedor.GetCriteria(Naviera.OpenSession());

            criteria.Childs = childs;

            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = NavieraList.SELECT(new QueryConditions {
                    Estado = estado
                });
            }

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
 public PrecioTrayecto NewItem(Naviera parent)
 {
     this.NewItem(PrecioTrayecto.NewChild(parent));
     return(this[Count - 1]);
 }
 public static string SELECT(Naviera parent)
 {
     return(SELECT(new QueryConditions {
         Naviera = parent.GetInfo(false)
     }));
 }
Exemplo n.º 12
0
 public void CopyFrom(Naviera source)
 {
     CopyValues(source);
 }