public void SetUp()
 {
     entryRef = new EntryRef(EntryType.Artist, 39);
     manager  = new ConcurrentEntryEditManager();
     miku     = new User("Miku", "3939", "*****@*****.**", 39)
     {
         Id = 1
     };
 }
예제 #2
0
 public void SetUp()
 {
     entryRef = new EntryRef(EntryType.Artist, 39);
     manager  = new ConcurrentEntryEditManager();
     miku     = new User("Miku", "3939", "*****@*****.**", PasswordHashAlgorithms.Default)
     {
         Id = 1
     };
 }
예제 #3
0
        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));
                }
            }
        }
예제 #4
0
 public void PostRefreshEntryEdit(EntryType entryType, int entryId) => ConcurrentEntryEditManager.CheckConcurrentEdits(new EntryRef(entryType, entryId), permissionContext.LoggedUser);