예제 #1
0
        private static void processStart(ref B_BATCH_MAINTENANCE entry)
        {
            CheckBatchRunningRepository chkFacade = new CheckBatchRunningRepository();
            B_CheckBatchRunning chkIte = chkFacade.findBatchRunning(BATCH_NAME).FirstOrDefault();
            B_CheckBatchRunning chkIteOld;
            if (chkIte == null)
            {
                chkIte = new B_CheckBatchRunning();
                chkIte.BatchName = BATCH_NAME;
                chkIte.NoOfRuns = 1;
                chkIte.RunningFlag = "Running";
                chkIte.UpdatedDate = DateTime.Now;
                chkFacade.Add(chkIte);
                chkFacade.Commit();

            }
            else
            {
                chkIteOld = chkFacade.findBatchRunning(BATCH_NAME).FirstOrDefault();
                chkIte.NoOfRuns = chkIte.NoOfRuns + 1;
                chkIte.RunningFlag = "Running";
                chkIte.UpdatedDate = DateTime.Now;
                chkFacade.Update(chkIteOld, chkIte);
                chkFacade.Commit();
            }

            BatchMaintenanceRepository facade = new BatchMaintenanceRepository();
            entry = new B_BATCH_MAINTENANCE();
            entry.BatchName = BATCH_NAME;
            entry.StartDate = DateTime.Now;
            entry.Status = "Running";
            entry.NoOfRuns = chkIte.NoOfRuns;
            facade.Add(entry);
            facade.Commit();
        }
예제 #2
0
        private static void processEnd(ref B_BATCH_MAINTENANCE entry)
        {
            BatchMaintenanceRepository facade = new BatchMaintenanceRepository();
            entry.EndDate = DateTime.Now;
            entry.Status = "Completed";
            B_BATCH_MAINTENANCE entry2 = facade.GetById(entry.ID);

            facade.Update(entry2, entry);
            facade.Commit();

            CheckBatchRunningRepository chkFacade = new CheckBatchRunningRepository();
            B_CheckBatchRunning chkIte = chkFacade.findBatchRunning(BATCH_NAME).FirstOrDefault();
            B_CheckBatchRunning chkIteOld;
            if (chkIte == null)
            {
                chkIte = new B_CheckBatchRunning();
                chkIte.BatchName = BATCH_NAME;
                chkIte.NoOfRuns = 1;
                chkIte.RunningFlag = "Completed";
                chkIte.UpdatedDate = DateTime.Now;
                chkFacade.Add(chkIte);
                chkFacade.Commit();
            }
            else
            {
                chkIteOld = chkFacade.findBatchRunning(BATCH_NAME).FirstOrDefault();
                chkIte.RunningFlag = "Completed";
                chkIte.UpdatedDate = DateTime.Now;
                chkFacade.Update(chkIteOld, chkIte);
                chkFacade.Commit();
            }
        }