Ejemplo n.º 1
0
 /// <summary>
 /// Create a new OperationData object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="isAcknowledged">Initial value of the IsAcknowledged property.</param>
 /// <param name="timestamp">Initial value of the Timestamp property.</param>
 /// <param name="operationId">Initial value of the OperationId property.</param>
 /// <param name="serialized">Initial value of the Serialized property.</param>
 public static OperationData CreateOperationData(global::System.Int32 id, global::System.Boolean isAcknowledged, global::System.DateTime timestamp, global::System.Guid operationId, global::System.Byte[] serialized)
 {
     OperationData operationData = new OperationData();
     operationData.Id = id;
     operationData.IsAcknowledged = isAcknowledged;
     operationData.Timestamp = timestamp;
     operationData.OperationId = operationId;
     operationData.Serialized = serialized;
     return operationData;
 }
Ejemplo n.º 2
0
        Operation IOperationStore.StoreOperation(Operation operation)
        {
            lock (Lock)
            {
                using (AlarmWorkflowEntities entities = AlarmWorkflowEntities.CreateContext())
                {
                    DateTime timestamp = (operation.Timestamp != DateTime.MinValue) ? operation.Timestamp : DateTime.Now;

                    OperationData data = new OperationData()
                    {
                        OperationId = operation.OperationGuid,
                        Timestamp = timestamp,
                        IsAcknowledged = operation.IsAcknowledged,
                        Serialized = Utilities.Serialize(operation),
                    };
                    entities.Operations.AddObject(data);
                    entities.SaveChanges();

                    // Update Operation ID afterwards
                    operation.Id = data.Id;
                    return operation;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Operations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToOperations(OperationData operationData)
 {
     base.AddObject("Operations", operationData);
 }