protected void CheckConcurrentEdit(EntryType entryType, int id) { var conflictingEditor = ConcurrentEntryEditManager.CheckConcurrentEdits(new EntryRef(entryType, id), Login.User); if (conflictingEditor.UserId != ConcurrentEntryEditManager.Nothing.UserId) { var ago = DateTime.Now - conflictingEditor.Time; if (ago.TotalMinutes < 1) { TempData.SetStatusMessage(string.Format(ViewRes.EntryEditStrings.ConcurrentEditWarningNow, conflictingEditor.UserName)); } else { TempData.SetStatusMessage(string.Format(ViewRes.EntryEditStrings.ConcurrentEditWarning, conflictingEditor.UserName, (int)ago.TotalMinutes)); } } }
public void PostRefreshEntryEdit(EntryType entryType, int entryId) => ConcurrentEntryEditManager.CheckConcurrentEdits(new EntryRef(entryType, entryId), permissionContext.LoggedUser);