Beispiel #1
0
        protected override void OnSaving()
        {
            int blockId = this.ParentBlockId;

            // O.R. [2008-07-29]
            if (!SkipSecurityCheckScope.IsActive)
            {
                // Check rights
                if (!TimeTrackingBlock.CheckUserRight(blockId, Security.RightWrite))
                {
                    throw new AccessDeniedException();
                }
            }

            // O.R. [2008-08-04]: If finances are registered, set TotalApproved for new entries to zero.
            // So we can see the differences in the "Accounts" tab of info popup
            TimeTrackingBlock block = MetaObjectActivator.CreateInstance <TimeTrackingBlock>(TimeTrackingBlock.GetAssignedMetaClass(), blockId);

            if ((bool)block.Properties["AreFinancesRegistered"].Value && this.Properties["TotalApproved"].Value == null)
            {
                this.Properties["TotalApproved"].Value = 0;
            }

            base.OnSaving();
        }
Beispiel #2
0
        protected override void OnDeleting()
        {
            // O.R. [2008-07-29]
            if (!SkipSecurityCheckScope.IsActive)
            {
                // Check rights
                int blockId = this.ParentBlockId;
                if (!TimeTrackingBlock.CheckUserRight(blockId, Security.RightDelete))
                {
                    throw new AccessDeniedException();
                }
            }

            base.OnDeleting();
        }