public int SaveTransactionSeq(ITransactionSeqDb transactionSeqDb, int? transactionNumber = null) { TransactionSeq record; var recordOld = new TransactionSeq(); if (transactionSeqDb.TransactionSeqId == 0) { record = new TransactionSeq(); Context.AddToTransactionSeqs(record); } else { record = Context.TransactionSeqs.Where(r => r.TransactionSeqId == transactionSeqDb.TransactionSeqId).First(); ReflectionHelper.CopyAllProperties(record, recordOld); } Context.SaveChanges(); if (transactionSeqDb.TransactionSeqId == 0) { transactionSeqDb.TransactionSeqId = record.TransactionSeqId; LogUnlinkedToDb(UserId, "TransactionSeqs", record.TransactionSeqId, "I", XmlHelper.GetObjectXml(record), transactionNumber); } else { LogUnlinkedToDb(UserId, "TransactionSeqs", record.TransactionSeqId, "U", XmlHelper.GetDifferenceXml(recordOld, record), transactionNumber); } return transactionSeqDb.TransactionSeqId; }
public void AddToTransactionSeqs(TransactionSeq record) { _context.AddToTransactionSeqs(record); }
/// <summary> /// Deprecated Method for adding a new object to the TransactionSeqs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTransactionSeqs(TransactionSeq transactionSeq) { base.AddObject("TransactionSeqs", transactionSeq); }
/// <summary> /// Create a new TransactionSeq object. /// </summary> /// <param name="transactionSeqId">Initial value of the TransactionSeqId property.</param> public static TransactionSeq CreateTransactionSeq(global::System.Int32 transactionSeqId) { TransactionSeq transactionSeq = new TransactionSeq(); transactionSeq.TransactionSeqId = transactionSeqId; return transactionSeq; }