Beispiel #1
0
        private static void Update(MSMOA.JobStep jobStep, SQLInformation.Data.ApplicationDataSet.JSJobStepsRow dataRow)
        {
            try
            {
                jobStep.UpdateDataSet(dataRow);

                UpdateDatabaseWithSnapShot(dataRow, "");
            }
            catch (Exception ex)
            {
                VNC.AppLog.Error(ex, LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 6);

                UpdateDatabaseWithSnapShot(dataRow, ex.ToString().Substring(0, 256));
            }
        }
Beispiel #2
0
 public static void UpdateDataSet(this MSMOA.JobStep jobStep, Data.ApplicationDataSet.JSJobStepsRow dataRow)
 {
     try
     {
         dataRow.DatabaseName     = jobStep.DatabaseName;
         dataRow.DatabaseUserName = jobStep.DatabaseUserName;
         dataRow.LastRunDate      = jobStep.LastRunDate;
         dataRow.LastRunDuration  = jobStep.LastRunDuration;
         dataRow.LastRunOutcome   = jobStep.LastRunOutcome.ToString();
         dataRow.LastRunRetries   = jobStep.LastRunRetries;
         dataRow.ProxyName        = jobStep.ProxyName;
         dataRow.Server           = jobStep.Server;
     }
     catch (Exception ex)
     {
         VNC.AppLog.Error(ex, LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 7);
         // TODO(crhodes):
         // Wrap anything above that throws an exception that we want to ignore,
         // e.g. property not available because of SQL Edition.
     }
 }
Beispiel #3
0
        private static SQLInformation.Data.ApplicationDataSet.JSJobStepsRow Add(MSMOA.JobStep jobStep, Guid jobID)
        {
            SQLInformation.Data.ApplicationDataSet.JSJobStepsRow dataRow = null;

            try
            {
                dataRow    = Common.ApplicationDataSet.JSJobSteps.NewJSJobStepsRow();
                dataRow.ID = Guid.NewGuid();

                dataRow.Name_JSJobStep = jobStep.Name;

                dataRow.JSJob_ID = jobID;

                dataRow.DatabaseName     = jobStep.DatabaseName;
                dataRow.DatabaseUserName = jobStep.DatabaseUserName;
                dataRow.LastRunDate      = jobStep.LastRunDate;
                dataRow.LastRunDuration  = jobStep.LastRunDuration;
                dataRow.LastRunOutcome   = jobStep.LastRunOutcome.ToString();
                dataRow.LastRunRetries   = jobStep.LastRunRetries;
                dataRow.ProxyName        = jobStep.ProxyName;
                dataRow.Server           = jobStep.Server;

                dataRow.SnapShotDate  = DateTime.Now;
                dataRow.SnapShotError = "";

                Common.ApplicationDataSet.JSJobSteps.AddJSJobStepsRow(dataRow);
                Common.ApplicationDataSet.JSJobStepsTA.Update(Common.ApplicationDataSet.JSJobSteps);
            }
            catch (Exception ex)
            {
                VNC.AppLog.Error(ex, LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 5);
                // TODO(crhodes):
                // Wrap anything above that throws an exception that we want to ignore,
                // e.g. property not available because of SQL Edition.

                UpdateDatabaseWithSnapShot(dataRow, ex.ToString().Substring(0, 256));
            }

            return(dataRow);
        }
Beispiel #4
0
        private static SQLInformation.Data.ApplicationDataSet.JSJobStepsRow GetInfoFromSMO(MSMOA.JobStep jobStep, Guid jobID)
        {
#if TRACE
            long startTicks = VNC.AppLog.Trace4(string.Format("Enter ({0})", jobStep.Name), LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2);
#endif

            SQLInformation.Data.ApplicationDataSet.JSJobStepsRow dataRow = null;

            try
            {
                var dbs = from db in Common.ApplicationDataSet.JSJobSteps
                          where db.JSJob_ID == jobID
                          select db;

                var dbs2 = from db2 in dbs
                           where db2.Name_JSJobStep == jobStep.Name
                           select db2;

                if (dbs2.Count() > 0)
                {
                    dataRow = dbs2.First();
                    Update(jobStep, dataRow);
                }
                else
                {
                    dataRow = Add(jobStep, jobID);
                }
            }
            catch (Exception ex)
            {
                VNC.AppLog.Error(ex, LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 3);
            }

#if TRACE
            VNC.AppLog.Trace4("Exit", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 4, startTicks);
#endif
            return(dataRow);
        }