Ejemplo n.º 1
0
 private static void UpdateDataSet(this MSMO.DatabaseDdlTrigger databaseDdlTrigger, Data.ApplicationDataSet.DBDdlTriggersRow dataRow)
 {
     try
     {
         //dataRow.X = databaseDdlTrigger.X;
     }
     catch (Exception ex)
     {
         VNC.AppLog.Error(ex, LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 11);
         // TODO(crhodes):
         // Wrap anything above that throws an exception that we want to ignore,
         // e.g. property not available because of SQL Edition.
     }
 }
Ejemplo n.º 2
0
        private static void Update(MSMO.DatabaseDdlTrigger ddlTrigger, SQLInformation.Data.ApplicationDataSet.DBDdlTriggersRow dataRow)
        {
            try
            {
                ddlTrigger.UpdateDataSet(dataRow);

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

                UpdateDatabaseWithSnapShot(dataRow, ex.ToString().Substring(0, 256));
            }
        }
Ejemplo n.º 3
0
 public static void UpdateDataSet(this MSMO.DatabaseDdlTrigger databaseDdlTrigger, Data.ApplicationDataSet.DBDdlTriggersRow triggerRow)
 {
     try
     {
         //instanceRow.ServiceName = server.ServiceName;
     }
     catch (Exception ex)
     {
         // TODO(crhodes):  Need to wrap anything above that throws an exception
         // that we want to ignore, e.g. property not available because of
         // SQL Edition.
         PLLog.Error(ex, PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2);
         throw ex;
     }
 }
Ejemplo n.º 4
0
        private static SQLInformation.Data.ApplicationDataSet.DBDdlTriggersRow GetInfoFromSMO(MSMO.DatabaseDdlTrigger ddlTrigger, Guid databaseID)
        {
#if TRACE
            long startTicks = VNC.AppLog.Trace4("Enter", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 4);
#endif
            SQLInformation.Data.ApplicationDataSet.DBDdlTriggersRow dataRow = null;

            try
            {
                var dbs = from tb in Common.ApplicationDataSet.DBDdlTriggers
                          where tb.Database_ID == databaseID
                          select tb;

                var dbs2 = from db2 in dbs
                           where db2.Name_Trigger == ddlTrigger.Name
                           select db2;

                if (dbs2.Count() > 0)
                {
                    dataRow = dbs2.First();
                    Update(ddlTrigger, dataRow);
                }
                else
                {
                    dataRow = Add(databaseID, ddlTrigger);
                }
            }
            catch (Exception ex)
            {
                VNC.AppLog.Error(ex, LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 5);
            }
#if TRACE
            VNC.AppLog.Trace4("Exit", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 6, startTicks);
#endif
            return(dataRow);
        }
Ejemplo n.º 5
0
        private static SQLInformation.Data.ApplicationDataSet.DBDdlTriggersRow Add(Guid databaseID, MSMO.DatabaseDdlTrigger ddlTrigger)
        {
            SQLInformation.Data.ApplicationDataSet.DBDdlTriggersRow dataRow = null;

            try
            {
                dataRow = Common.ApplicationDataSet.DBDdlTriggers.NewDBDdlTriggersRow();

                dataRow.ID           = Guid.NewGuid();
                dataRow.Name_Trigger = ddlTrigger.Name;
                //newTrigger.Table_ID = trigger.ID.ToString();
                dataRow.Database_ID = databaseID;  // From above
                dataRow.CreateDate  = ddlTrigger.CreateDate;

                try
                {
                    dataRow.DateLastModified = ddlTrigger.DateLastModified;
                }
                catch (Exception ex)
                {
#if TRACE
                    VNC.AppLog.Debug(ex.ToString(), LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 7);
#endif
                }

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

                Common.ApplicationDataSet.DBDdlTriggers.AddDBDdlTriggersRow(dataRow);
                Common.ApplicationDataSet.DBDdlTriggersTA.Update(Common.ApplicationDataSet.DBDdlTriggers);
            }
            catch (Exception ex)
            {
                VNC.AppLog.Error(ex, LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 8);
                // 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);
        }