/// <summary> /// Creates the clearance. /// </summary> /// <param name="entities">The entities.</param> /// <param name="procedure">The procedure.</param> /// <param name="procedureCode">The procedure code.</param> /// <param name="good">The good.</param> /// <returns></returns> public static Clearence CreataClearance(Entities entities, string procedure, ClearenceProcedure procedureCode, SADGood good) { Clearence _newClearance = CreateClearance(procedure, procedureCode); _newClearance.Clearence2SadGoodID = good; _newClearance.DocumentNo = good.SADDocumentIndex.DocumentNumber; _newClearance.ReferenceNumber = good.SADDocumentIndex.ReferenceNumber; _newClearance.UpdateTitle(entities); entities.Clearence.InsertOnSubmit(_newClearance); entities.SubmitChanges(); _newClearance.UpdateTitle(entities); return(_newClearance); }
/// <summary> /// Starts the clearance and creates an object of <see cref="Clearence" />. /// </summary> /// <param name="entities">The entities.</param> /// <param name="procedure">The customs procedure.</param> /// <param name="procedureCode">The procedure code.</param> /// <param name="trace">The trace action.</param> /// <returns>Return new <see cref="Clearence"/> entity.</returns> public static Clearence CreateClearance(Entities entities, string procedure, ClearenceProcedure procedureCode, NamedTraceLogger.TraceAction trace) { trace("Entering Clearence.CreateClearance", 98, TraceSeverity.Verbose); Clearence _newClearance = CreateClearance(procedure, procedureCode); entities.Clearence.InsertOnSubmit(_newClearance); _newClearance.UpdateTitle(entities); trace("Clearence.CreateClearance at SubmitChanges", 103, TraceSeverity.Verbose); entities.SubmitChanges(); _newClearance.UpdateTitle(entities); trace("Finished Clearence.CreateClearance", 106, TraceSeverity.Verbose); return(_newClearance); }