public void tblCustomsWayPointVisibility_persistence_test() { DateTime now = DateTime.Now; // Get datetime without milliseconds now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind); var _conexbo_tblcustomswaypoint_tblcustomswaypointvisibility = new DSS4_ECompliance.BO.tblCustomsWayPoint { Waypoint = "tblCustomsWayPoint_Waypoint", DateTime = now, Location = "tblCustomsWayPoint_Location", VesselName = "tblCustomsWayPoint_VesselName", ShippingAgent = "tblCustomsWayPoint_ShippingAgent", TotalConsignments = 4658, DirectConsignments = 4684, TranshipmentConsignments = 3918, TotalEquipments = 6450, FullEquipments = 9224, EmptyEquipments = 7943, TEUSEquipments = 2049, RiskDetection = 8625, From = "tblCustomsWayPoint_From", To = "tblCustomsWayPoint_To", TotalRisks = 7274, ConveyanceID = "tblCustomsWayPoint_ConveyanceID", ConveyanceRef = "tblCustomsWayPoint_ConveyanceRef", }; new PersistenceSpecification <DSS4_ECompliance.BO.tblCustomsWayPointVisibility>(Session) .CheckProperty(p => p.Waypoint, "tblCustomsWayPointVisibility_Waypoint") .CheckProperty(p => p.From, "tblCustomsWayPointVisibility_From") .CheckProperty(p => p.To, "tblCustomsWayPointVisibility_To") .CheckProperty(p => p.ConveyanceId, "tblCustomsWayPointVisibility_ConveyanceId") .CheckProperty(p => p.ConveyanceRef, "tblCustomsWayPointVisibility_ConveyanceRef") .CheckProperty(p => p.ShippingAgent, "tblCustomsWayPointVisibility_ShippingAgent") .CheckProperty(p => p.TotalConsignments, 1493) .CheckProperty(p => p.DirectConsignments, 915) .CheckProperty(p => p.TransshipmentConsignments, 8761) .CheckProperty(p => p.TotalCargos, 6025) .CheckProperty(p => p.FullCargos, 3970) .CheckProperty(p => p.EmptyCargos, 7495) .CheckProperty(p => p.TotalRiskDetected, 2526) .CheckProperty(p => p.Consignment, "tblCustomsWayPointVisibility_Consignment") .CheckProperty(p => p.CargoId, "tblCustomsWayPointVisibility_CargoId") .CheckProperty(p => p.RiskType, "tblCustomsWayPointVisibility_RiskType") .CheckProperty(p => p.RiskScore, 3676) .CheckProperty(p => p.Severity, "tblCustomsWayPointVisibility_Severity") .CheckProperty(p => p.Details, "tblCustomsWayPointVisibility_Details") .CheckProperty(p => p.Suggestions, "tblCustomsWayPointVisibility_Suggestions") .CheckReference(p => p.tblCustomsWayPoint, _conexbo_tblcustomswaypoint_tblcustomswaypointvisibility) .VerifyTheMappings(); }
public void tblCustomsWayPoint_persistence_test() { DateTime now = DateTime.Now; // Get datetime without milliseconds now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind); var _conexbo_customswaypoint_tblcustomswaypoint = new DSS4_ECompliance.BO.tblCustomsWayPoint { Waypoint = "tblCustomsWayPoint_Waypoint", DateTime = now, Location = "tblCustomsWayPoint_Location", VesselName = "tblCustomsWayPoint_VesselName", ShippingAgent = "tblCustomsWayPoint_ShippingAgent", TotalConsignments = 7057, DirectConsignments = 8786, TranshipmentConsignments = 6849, TotalEquipments = 5623, FullEquipments = 8533, EmptyEquipments = 7347, TEUSEquipments = 9434, RiskDetection = 12, From = "tblCustomsWayPoint_From", To = "tblCustomsWayPoint_To", TotalRisks = 133, ConveyanceID = "tblCustomsWayPoint_ConveyanceID", ConveyanceRef = "tblCustomsWayPoint_ConveyanceRef", }; new PersistenceSpecification <DSS4_ECompliance.BO.tblCustomsWayPoint>(Session) .CheckProperty(p => p.Waypoint, "tblCustomsWayPoint_Waypoint") .CheckProperty(p => p.DateTime, now) .CheckProperty(p => p.Location, "tblCustomsWayPoint_Location") .CheckProperty(p => p.VesselName, "tblCustomsWayPoint_VesselName") .CheckProperty(p => p.ShippingAgent, "tblCustomsWayPoint_ShippingAgent") .CheckProperty(p => p.TotalConsignments, 304) .CheckProperty(p => p.DirectConsignments, 1066) .CheckProperty(p => p.TranshipmentConsignments, 876) .CheckProperty(p => p.TotalEquipments, 9947) .CheckProperty(p => p.FullEquipments, 3419) .CheckProperty(p => p.EmptyEquipments, 1108) .CheckProperty(p => p.TEUSEquipments, 9620) .CheckProperty(p => p.RiskDetection, 2725) .CheckProperty(p => p.From, "tblCustomsWayPoint_From") .CheckProperty(p => p.To, "tblCustomsWayPoint_To") .CheckProperty(p => p.TotalRisks, 979) .CheckProperty(p => p.ConveyanceID, "tblCustomsWayPoint_ConveyanceID") .CheckProperty(p => p.ConveyanceRef, "tblCustomsWayPoint_ConveyanceRef") .CheckReference(p => p.CustomsWayPoint, _conexbo_customswaypoint_tblcustomswaypoint) .VerifyTheMappings(); }
public void tblCustomsWayPointRisk_persistence_test() { DateTime now = DateTime.Now; // Get datetime without milliseconds now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind); var _conexbo_tblcustomswaypoint_tblcustomswaypointrisk = new DSS4_ECompliance.BO.tblCustomsWayPoint { Waypoint = "tblCustomsWayPoint_Waypoint", DateTime = now, Location = "tblCustomsWayPoint_Location", VesselName = "tblCustomsWayPoint_VesselName", ShippingAgent = "tblCustomsWayPoint_ShippingAgent", TotalConsignments = 5641, DirectConsignments = 7204, TranshipmentConsignments = 4315, TotalEquipments = 4736, FullEquipments = 7507, EmptyEquipments = 2779, TEUSEquipments = 3570, RiskDetection = 7787, From = "tblCustomsWayPoint_From", To = "tblCustomsWayPoint_To", TotalRisks = 4810, ConveyanceID = "tblCustomsWayPoint_ConveyanceID", ConveyanceRef = "tblCustomsWayPoint_ConveyanceRef", }; new PersistenceSpecification <DSS4_ECompliance.BO.tblCustomsWayPointRisk>(Session) .CheckProperty(p => p.Consignment, "tblCustomsWayPointRisk_Consignment") .CheckProperty(p => p.CargoId, "tblCustomsWayPointRisk_CargoId") .CheckProperty(p => p.RiskTypeId, "tblCustomsWayPointRisk_RiskTypeId") .CheckProperty(p => p.RiskScore, "tblCustomsWayPointRisk_RiskScore") .CheckProperty(p => p.Severity, "tblCustomsWayPointRisk_Severity") .CheckProperty(p => p.Details, "tblCustomsWayPointRisk_Details") .CheckProperty(p => p.Suggestions, "tblCustomsWayPointRisk_Suggestions") .CheckReference(p => p.tblCustomsWayPoint, _conexbo_tblcustomswaypoint_tblcustomswaypointrisk) .VerifyTheMappings(); }
public void DeletetblCustomsWayPoint(DSS4_ECompliance.BO.tblCustomsWayPoint tblcustomswaypoint, bool doNotCallDeleteForThis = false, bool isCascaded = false, object calledBy = null) { if (tblcustomswaypoint == null || tblcustomswaypoint.IsTransient()) { return; } foreach (var toDissasociate in this.Get <DSS4_ECompliance.BO.tblCustomsWayPointRisk>(ap => ap.tblCustomsWayPoint == tblcustomswaypoint)) { toDissasociate.tblCustomsWayPoint = null; } foreach (var toDissasociate in this.Get <DSS4_ECompliance.BO.tblCustomsWayPointVisibility>(ap => ap.tblCustomsWayPoint == tblcustomswaypoint)) { toDissasociate.tblCustomsWayPoint = null; } tblcustomswaypoint.CustomsWayPoint = null; foreach (var toDissasociate in this.Get <DSS4_ECompliance.BO.tblCustomsWayPoint>(ap => ap.CustomsWayPoint == tblcustomswaypoint)) { toDissasociate.CustomsWayPoint = null; } if (!doNotCallDeleteForThis) { Delete <DSS4_ECompliance.BO.tblCustomsWayPoint>(tblcustomswaypoint, 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(tblCustomsWayPoint compareTo) { return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id)); }
/// <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 [tblCustomsWayPoint] instance to use as the destination.</param> /// <returns>A copy of the object</returns> public virtual tblCustomsWayPoint Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, tblCustomsWayPoint copy = null) { if (copiedObjects == null) { copiedObjects = new Hashtable(); } if (copy == null && copiedObjects.Contains(this)) { return((tblCustomsWayPoint)copiedObjects[this]); } copy = copy ?? new tblCustomsWayPoint(); if (!asNew) { copy.TransientId = this.TransientId; copy.Id = this.Id; } copy.Waypoint = this.Waypoint; copy.DateTime = this.DateTime; copy.Location = this.Location; copy.VesselName = this.VesselName; copy.ShippingAgent = this.ShippingAgent; copy.TotalConsignments = this.TotalConsignments; copy.DirectConsignments = this.DirectConsignments; copy.TranshipmentConsignments = this.TranshipmentConsignments; copy.TotalEquipments = this.TotalEquipments; copy.FullEquipments = this.FullEquipments; copy.EmptyEquipments = this.EmptyEquipments; copy.TEUSEquipments = this.TEUSEquipments; copy.RiskDetection = this.RiskDetection; copy.From = this.From; copy.To = this.To; copy.TotalRisks = this.TotalRisks; copy.ConveyanceID = this.ConveyanceID; copy.ConveyanceRef = this.ConveyanceRef; if (!copiedObjects.Contains(this)) { copiedObjects.Add(this, copy); } if (deep && this.customsWayPoint != null) { if (!copiedObjects.Contains(this.customsWayPoint)) { if (asNew && reuseNestedObjects) { copy.CustomsWayPoint = this.CustomsWayPoint; } else if (asNew) { copy.CustomsWayPoint = this.CustomsWayPoint.Copy(deep, copiedObjects, true); } else { copy.customsWayPoint = this.customsWayPoint.Copy(deep, copiedObjects, false); } } else { if (asNew) { copy.CustomsWayPoint = (tblCustomsWayPoint)copiedObjects[this.CustomsWayPoint]; } else { copy.customsWayPoint = (tblCustomsWayPoint)copiedObjects[this.CustomsWayPoint]; } } } return(copy); }