public void tblCustomsOveralMonitoring_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _conexbo_tblcustomsfinder_tblcustomsoveralmonitoring = new DSS4_ECompliance.BO.tblCustomsFinder
            {
                RiskAnalysys  = 5636,
                RisksDetected = 9514,
                CrossBorders  = 3133,
                Delays        = 3606,
            };

            new PersistenceSpecification <DSS4_ECompliance.BO.tblCustomsOveralMonitoring>(Session)
            .CheckProperty(p => p.Waypoint, "tblCustomsOveralMonitoring_Waypoint")
            .CheckProperty(p => p.DateTime, now)
            .CheckProperty(p => p.Location, "tblCustomsOveralMonitoring_Location")
            .CheckProperty(p => p.VesselName, "tblCustomsOveralMonitoring_VesselName")
            .CheckProperty(p => p.ShippingAgent, "tblCustomsOveralMonitoring_ShippingAgent")
            .CheckProperty(p => p.TotalConsignments, 1669)
            .CheckProperty(p => p.DirectConsignments, 5743)
            .CheckProperty(p => p.TranshipmentConsignments, 4736)
            .CheckProperty(p => p.TotalEquipements, 3728)
            .CheckProperty(p => p.FullEquipements, 4149)
            .CheckProperty(p => p.EmptyEquipements, 6293)
            .CheckProperty(p => p.TEUSEquipements, 1917)
            .CheckProperty(p => p.RiskDetection, 9956)
            .CheckReference(p => p.tblCustomsFinder, _conexbo_tblcustomsfinder_tblcustomsoveralmonitoring)
            .VerifyTheMappings();
        }
Exemple #2
0
 public void DeletetblCustomsFinder(DSS4_ECompliance.BO.tblCustomsFinder tblcustomsfinder, bool doNotCallDeleteForThis = false, bool isCascaded = false, object calledBy = null)
 {
     if (tblcustomsfinder == null || tblcustomsfinder.IsTransient())
     {
         return;
     }
     foreach (var toDissasociate in this.Get <DSS4_ECompliance.BO.tblCustomsOveralMonitoring>(ap => ap.tblCustomsFinder == tblcustomsfinder))
     {
         toDissasociate.tblCustomsFinder = null;
     }
     if (!doNotCallDeleteForThis)
     {
         Delete <DSS4_ECompliance.BO.tblCustomsFinder>(tblcustomsfinder, isCascaded);
     }
 }
/// <summary>
///     Returns true if self and the provided entity have the same Id values
///     and the Ids are not of the default Id value
/// </summary>
        protected bool HasSameNonDefaultIdAs(tblCustomsFinder compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.FinderID.Equals(compareTo.FinderID));
        }
/// <summary>
/// Copies the current object to a new instance
/// </summary>
/// <param name="deep">Copy members that refer to objects external to this class (not dependent)</param>
/// <param name="copiedObjects">Objects that should be reused</param>
/// <param name="asNew">Copy the current object as a new one, ready to be persisted, along all its members.</param>
/// <param name="reuseNestedObjects">If asNew is true, this flag if set, forces the reuse of all external objects.</param>
/// <param name="copy">Optional - An existing [tblCustomsFinder] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual tblCustomsFinder Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, tblCustomsFinder copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((tblCustomsFinder)copiedObjects[this]);
            }
            copy = copy ?? new tblCustomsFinder();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.FinderID    = this.FinderID;
            }
            copy.RiskAnalysys  = this.RiskAnalysys;
            copy.RisksDetected = this.RisksDetected;
            copy.CrossBorders  = this.CrossBorders;
            copy.Delays        = this.Delays;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            return(copy);
        }