예제 #1
0
        public void HandleTableProcessorEnd(object sender, TableProcessorEndEventArgs args)
        {
            TimeSpan ts       = args.When - BeginEventArgs.When;
            String   duration = String.Format("{0:D2}:{1:D2}:{2:D2}:{3:D3}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds);

            System.Console.WriteLine(String.Format("{0} - Completed - {1}", GetBaseText(args), duration));
        }
예제 #2
0
 public void HandleTableProcessorEnd(object sender, TableProcessorEndEventArgs args)
 {
     foreach (IUploadEventHandler handler in Handlers)
     {
         handler.HandleTableProcessorEnd(sender, args);
     }
 }
        public void HandleTableProcessorEnd(object sender, TableProcessorEndEventArgs args)
        {
            TableProcessorBeginEventArgs beginArgs = (args.ClassName == TableBeginEventArgs.ClassName) ? TableBeginEventArgs : BeginEventArgs;
            TimeSpan ts       = args.When - beginArgs.When;
            String   duration = String.Format("{0:D2}:{1:D2}:{2:D2}:{3:D3}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds);
            String   txt      = String.Format("Table - {0} ; Begin - {1} ; End - {2} ; Duration - {3} ; Class - {4}",
                                              beginArgs.TableName,
                                              beginArgs.When.ToLongTimeString(),
                                              args.When.ToLongTimeString(),
                                              duration,
                                              beginArgs.ClassName);

            Write(txt);
        }
예제 #4
0
        public void HandleTableProcessorEnd(object sender, TableProcessorEndEventArgs args)
        {
            UploadDetail detailToUpdate;

            if (args.ClassName == Detail.ClassName)
            {
                detailToUpdate = Detail;
            }
            else
            {
                detailToUpdate = Context.UploadDetails.Where(detail => detail.UploadHeader.Id == Header.Id && detail.TableName == args.TableName && detail.ClassName == args.ClassName).First();
            }
            detailToUpdate.End = DateTime.Now;
            Context.SaveChanges();
        }