private static bool UpdateLock(Synchronization oldLock, double timeframe)
        {
            using (var proc = DataProvider.Instance.CreateDataProcedure(insertSql)
                              .AddParameter("@lockName", NOTIFICATIONLOCKNAME)
                              .AddParameter("@lockedUntil", DateTime.UtcNow.AddMinutes(timeframe))
                              .AddParameter("@computerName", Environment.MachineName)
                              .AddParameter("@lockId", Guid.NewGuid().ToString())
                              .AddParameter("@oldLockedUntil", oldLock.LockedUntil, System.Data.DbType.DateTime2))
            {
                proc.CommandType = System.Data.CommandType.Text;

                try
                {
                    var rows = proc.ExecuteNonQuery();
                    return(rows == 1);
                }
                catch (Exception ex)
                {
                    SnLog.WriteException(ex);
                    return(false);
                }
            }
        }
Exemplo n.º 2
0
 partial void UpdateSynchronization(Synchronization instance);
Exemplo n.º 3
0
 partial void DeleteSynchronization(Synchronization instance);
Exemplo n.º 4
0
 partial void InsertSynchronization(Synchronization instance);