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); } } }
partial void UpdateSynchronization(Synchronization instance);
partial void DeleteSynchronization(Synchronization instance);
partial void InsertSynchronization(Synchronization instance);