private void PersistActivityProgress(ActivityProgress activityProgress, OperationName operationName, OperationState?operationState = null, int?operationContactCount = null, string operationDuration = null) { activityProgress.Operations[operationName.ToString()].Duration = operationDuration ?? activityProgress.Operations[operationName.ToString()].Duration; activityProgress.Operations[operationName.ToString()].ContactCount = operationContactCount ?? activityProgress.Operations[operationName.ToString()].ContactCount; activityProgress.Operations[operationName.ToString()].OperationState = operationState ?? activityProgress.Operations[operationName.ToString()].OperationState; _jobRepository.PersistActivityProgress(activityProgress); }
internal static void UpdateActivitiesLogs(IPRDEV sqlEntities, OperationName operation, ProgressChangedEventHandler progressChanged) { Linq2SQL.ArchivingOperationLogs _logs = new ArchivingOperationLogs() { Date = DateTime.Now, Operation = operation.ToString(), UserName = Extensions.UserName() }; sqlEntities.ArchivingOperationLogs.InsertOnSubmit(_logs); sqlEntities.SubmitChanges(); progressChanged(1, new ProgressChangedEventArgs(1, "Updated ActivitiesLogs")); }
/// <summary> /// Updates the activities logs. /// </summary> /// <typeparam name="TEntity">The type of the entity.</typeparam> /// <param name="sqlEntities">The SQL entities.</param> /// <param name="operation">The operation.</param> /// <param name="progressChanged">The progress changed.</param> public static void UpdateActivitiesLogs <TEntity>(DataContext sqlEntities, OperationName operation, Action <ProgressChangedEventArgs> progressChanged) where TEntity : class, IArchivingOperationLogs, new() { TEntity _logs = new TEntity() { Date = DateTime.Now, Operation = operation.ToString(), UserName = UserName() }; sqlEntities.GetTable <TEntity>().InsertOnSubmit(_logs); sqlEntities.SubmitChanges(); progressChanged(new ProgressChangedEventArgs(1, String.Format("Updated ActivitiesLogs for operation {0}", operation))); }
public override string ToString() { var sb = new StringBuilder("Span("); sb.Append(", TraceIdLow: "); TraceIdLow.ToString(sb); sb.Append(", TraceIdHigh: "); TraceIdHigh.ToString(sb); sb.Append(", SpanId: "); SpanId.ToString(sb); sb.Append(", ParentSpanId: "); ParentSpanId.ToString(sb); if ((OperationName != null)) { sb.Append(", OperationName: "); OperationName.ToString(sb); } if ((References != null) && __isset.references) { sb.Append(", References: "); References.ToString(sb); } sb.Append(", Flags: "); Flags.ToString(sb); sb.Append(", StartTime: "); StartTime.ToString(sb); sb.Append(", Duration: "); Duration.ToString(sb); if ((Tags != null) && __isset.tags) { sb.Append(", Tags: "); Tags.ToString(sb); } if ((Logs != null) && __isset.logs) { sb.Append(", Logs: "); Logs.ToString(sb); } sb.Append(')'); return(sb.ToString()); }
/// <summary> /// Gets the recent actions. /// </summary> /// <typeparam name="TEntity">The type of the <see cref="Table{TEntity}" />.</typeparam> /// <param name="sqlEntities">The SQL entities.</param> /// <param name="operation">The operation.</param> /// <returns>Last entry of from the <see cref="Table{TEntity}" /> for the selected <paramref name="operation" />.</returns> public static TEntity GetRecentActions <TEntity>(DataContext sqlEntities, OperationName operation) where TEntity : class, IArchivingOperationLogs, new() { TEntity _recentActions = sqlEntities.GetTable <TEntity>().Where <TEntity>(x => x.Operation.Contains(operation.ToString())).OrderByDescending <TEntity, DateTime>(x => x.Date).FirstOrDefault(); return(_recentActions); }
public static void ExecuteOperation(OperationName operation, Stack operandStack) { try { switch (operation) { case OperationName.POLYLINE2D: Polyline2D(operandStack); break; case OperationName.CIRCLELINE2D: Circleline2D(operandStack); break; case OperationName.COMPOSITE_CURVE2D: CompositeCurve2D(operandStack); break; case OperationName.SHAPE: Shape(operandStack); break; case OperationName.EXTRUDE: Extrude(operandStack); break; case OperationName.REVOLVE: Revolve(operandStack); break; case OperationName.TRANSLATION: Translate(operandStack); break; case OperationName.ROTATION: Rotate(operandStack); break; case OperationName.UNION: Union(operandStack); break; case OperationName.DIFFERENCE: Difference(operandStack); break; case OperationName.INTERSECTION: Intersection(operandStack); break; case OperationName.PLANE: Plane(operandStack); break; case OperationName.CUT_BY_PLANE: CutByPlane(operandStack); break; default: break; } } catch (Exception ex) { throw new ArgumentException("Invalid Argument", operation.ToString(), ex); } }
/// <summary> /// Gets the recent actions. /// </summary> /// <param name="entities">The _entities.</param> /// <param name="operation">The operation.</param> /// <returns></returns> public static ArchivingOperationLogs GetRecentActions(IPRDEV entities, OperationName operation) { ArchivingOperationLogs _recentActions = entities.ArchivingOperationLogs.Where <ArchivingOperationLogs>(x => x.Operation.Contains(operation.ToString())).OrderByDescending <ArchivingOperationLogs, DateTime>(x => x.Date).FirstOrDefault(); return(_recentActions); }