예제 #1
0
        internal static void UpdateProject(int eventId, int projectId, bool checkAccess)
        {
            bool update = true;

            if (checkAccess)
            {
                int oldProjectId = DBEvent.GetProject(eventId);
                if (oldProjectId != projectId && !CalendarEntry.CanChangeProject(eventId))
                {
                    throw new AccessDeniedException();
                }

                if (oldProjectId == projectId)
                {
                    update = false;
                }
            }

            if (update)
            {
                UpdateProjectAndManager(eventId, projectId, 0);
            }
        }