Ejemplo n.º 1
0
        public void TestCreateAndPopulate()
        {
            UploadContext context = new UploadContext();

            UploadHeader header = new UploadHeader();

            header.Begin = DateTime.Now;

            context.UploadHeaders.Add(header);

            DateTime       dt      = DateTime.Now;
            int            minutes = 0;
            IList <String> tables  = new List <String>()
            {
                "IN_GUEST", "IN_TRN", "IN_MSG", "IN_RES"
            };

            foreach (String table in tables.OrderBy(s => s))
            {
                minutes++;
                UploadDetail dtl = new UploadDetail()
                {
                    TableName = table, Begin = dt.AddMinutes(minutes++), End = dt.AddMinutes(minutes++), UploadHeader = header
                };
                context.UploadDetails.Add(dtl);
            }
            context.SaveChanges();
            TestContext.WriteLine("Done - {0}", minutes);
        }
 public SqlTableProcessorEventHandler(String connectionName)
 {
     Context      = new UploadContext(connectionName);
     Header       = new UploadHeader();
     Header.Begin = DateTime.Now;
     Context.UploadHeaders.Add(Header);
     Context.SaveChanges();
 }
Ejemplo n.º 3
0
        public void HandleUploadBegin(object sender, BeginUploadEventArgs args)
        {
            Header       = new UploadHeader();
            Header.Begin = DateTime.Now;
            StringBuilder sb = new StringBuilder();

            foreach (String connStr in args.ConnectionStrings)
            {
                sb.AppendLine(connStr);
            }
            Header.ConnectionStrings = sb.ToString();
            Header.RestartDetails    = args.RestartParameter == null ? String.Empty : args.RestartParameter.ToString();
            Context.UploadHeaders.Add(Header);
            Context.SaveChanges();
        }
Ejemplo n.º 4
0
 public void OnUploadCompleted(UploadHeader header)
 {
 }
Ejemplo n.º 5
0
 public void OnFileComing(UploadHeader header)
 {
 }