Пример #1
0
 public SimplTransaction(Transaction transaction, SIMPLEntities db)
 {
     TransactionId = transaction.TransactionId;
     var transactionType = DBCache.TransactionTypes.FirstOrDefault(t => t.TransactionTypeId == transaction.TransactionType);
     if (transactionType != null)
         TransactionType = transactionType.TransactionTypeName;
     var equipmentType = DBCache.EquipmentTypes.FirstOrDefault(e => e.EquipmentTypeId == transaction.EquipTypeId);
     if (equipmentType != null)
         EquipType = equipmentType.ModelNumber;
     SerialNumber = transaction.SerialNumber;
     var uniqueId = db.UniqueIds.FirstOrDefault(uid => uid.EntityId == transaction.ActionEntityId);
     if (uniqueId != null)
         ActionEntity = uniqueId.UniqueIdValue + "-" + transaction.ActionEntityId;
     OriginalLoc = transaction.OriginalLocId ?? "";
     UpdatedLoc = transaction.UpdatedLocId;
     TransactionTime = transaction.TransactionTime;
     var transactionResultType = DBCache.TransactionResultTypes.FirstOrDefault(t => t.ResultTypeId == transaction.ResultTypeId);
     if (transactionResultType != null)
         ResultType = transactionResultType.ResultTypeName;
 }
Пример #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Transactions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTransactions(Transaction transaction)
 {
     base.AddObject("Transactions", transaction);
 }
Пример #3
0
 /// <summary>
 /// Create a new Transaction object.
 /// </summary>
 /// <param name="transactionId">Initial value of the TransactionId property.</param>
 /// <param name="transactionType">Initial value of the TransactionType property.</param>
 /// <param name="equipTypeId">Initial value of the EquipTypeId property.</param>
 /// <param name="serialNumber">Initial value of the SerialNumber property.</param>
 /// <param name="actionEntityId">Initial value of the ActionEntityId property.</param>
 /// <param name="originalLocId">Initial value of the OriginalLocId property.</param>
 /// <param name="updatedLocId">Initial value of the UpdatedLocId property.</param>
 /// <param name="transactionTime">Initial value of the TransactionTime property.</param>
 /// <param name="resultTypeId">Initial value of the ResultTypeId property.</param>
 public static Transaction CreateTransaction(global::System.Int32 transactionId, global::System.Int32 transactionType, global::System.Int32 equipTypeId, global::System.String serialNumber, global::System.Int32 actionEntityId, global::System.String originalLocId, global::System.String updatedLocId, global::System.DateTime transactionTime, global::System.Int32 resultTypeId)
 {
     Transaction transaction = new Transaction();
     transaction.TransactionId = transactionId;
     transaction.TransactionType = transactionType;
     transaction.EquipTypeId = equipTypeId;
     transaction.SerialNumber = serialNumber;
     transaction.ActionEntityId = actionEntityId;
     transaction.OriginalLocId = originalLocId;
     transaction.UpdatedLocId = updatedLocId;
     transaction.TransactionTime = transactionTime;
     transaction.ResultTypeId = resultTypeId;
     return transaction;
 }
Пример #4
0
 public SimplTransaction(Transaction transaction)
     : this(transaction, DBContextFactory.CreateContext())
 {
 }