internal void Insert(Transporter parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } this.OidTransportista = 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(); }
internal void Update(Transporter parent) { this.RaiseListChangedEvents = false; // update (thus deleting) any deleted child objects foreach (PrecioDestino 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 (PrecioDestino obj in this) { if (obj.IsNew) { obj.Insert(parent); } else { obj.Update(parent); } } this.RaiseListChangedEvents = true; }
internal void Update(Transporter parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } this.OidTransportista = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR); } SessionCode = parent.SessionCode; PrecioDestinoRecord obj = Session().Get <PrecioDestinoRecord>(Oid); obj.CopyValues(this._base.Record); Session().Update(obj); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
internal void DeleteSelf(Transporter 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 <PrecioDestinoRecord>(Oid)); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkNew(); }
protected void CopyValues(Transporter source) { if (source == null) { return; } _base.CopyValues(source); Oid = source.Oid; }
public void CopyValues(Transporter source) { if (source == null) { return; } _record.CopyValues(source.Base.Record); _provider_base.CopyCommonValues(source); _provider_base.OidAcreedor = _record.Oid; }
public static PrecioDestino NewChild(Transporter parent) { if (!CanAddObject()) { throw new System.Security.SecurityException(moleQule.Resources.Messages.USER_NOT_ALLOWED); } PrecioDestino obj = new PrecioDestino(); obj.OidTransportista = parent.Oid; return(obj); }
public static TransporterList GetList(ETipoTransportista tipo, bool childs) { CriteriaEx criteria = Transporter.GetCriteria(Transporter.OpenSession()); criteria.Childs = childs; //No criteria. Retrieve all de List if (nHManager.Instance.UseDirectSQL) { criteria.Query = TransporterList.SELECT(tipo); } TransporterList list = DataPortal.Fetch <TransporterList>(criteria); CloseSession(criteria.SessionCode); return(list); }
public static TransporterList GetList(EEstado estado, bool childs) { CriteriaEx criteria = Transporter.GetCriteria(Transporter.OpenSession()); criteria.Childs = childs; if (nHManager.Instance.UseDirectSQL) { criteria.Query = TransporterList.SELECT(new QueryConditions { Estado = estado }); } TransporterList list = DataPortal.Fetch <TransporterList>(criteria); CloseSession(criteria.SessionCode); return(list); }
public PrecioDestino NewItem(Transporter parent) { this.NewItem(PrecioDestino.NewChild(parent)); return(this[Count - 1]); }
public PrecioOrigen NewItem(Transporter parent) { this.NewItem(PrecioOrigen.NewChild(parent)); return(this[Count - 1]); }
public static string SELECT(ETipoTransportista tipo) { return(Transporter.SELECT(tipo, false)); }
public static bool CanEditObject() { return(Transporter.CanEditObject()); }
public static bool CanDeleteObject() { return(Transporter.CanDeleteObject()); }
public void CopyFrom(Transporter source) { CopyValues(source); }
public static string SELECT(Transporter parent) { return(SELECT(new QueryConditions { Acreedor = parent.GetInfo(false) })); }
public static string SELECT(Transporter transportista) { return(SELECT(new QueryConditions { Acreedor = transportista.GetInfo(false) })); }