Exemplo n.º 1
0
        protected override void BeforeDelete(DataRow row)
        {
            atriumDB.DisbursementRow dr = (atriumDB.DisbursementRow)row;

            if (dr.Final && !dr.IsIRPIdNull() || dr.OfficeId != this.myA.AtMng.OfficeLoggedOn.OfficeId)
            {
                throw new AtriumException(Resources.DisbNoDelete);
            }
        }
Exemplo n.º 2
0
        public override bool CanDelete(DataRow row)
        {
            atriumDB.DisbursementRow dr = (atriumDB.DisbursementRow)row;

            bool ok = false;

            atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanDelete(dr.FileID, atSecurity.SecurityManager.Features.Disbursement);
            switch (perm)
            {
            case atSecurity.SecurityManager.LevelPermissions.All:
                ok = true;
                break;

            case atSecurity.SecurityManager.LevelPermissions.MyOffice:
                if (dr.OfficeId == myA.AtMng.OfficerLoggedOn.OfficeId)
                {
                    ok = true;
                }
                break;

            case atSecurity.SecurityManager.LevelPermissions.No:
                ok = false;
                break;

            default:
                ok = false;
                break;
            }

            bool canOverride = myA.AtMng.SecurityManager.CanOverride(dr.FileID, atSecurity.SecurityManager.Features.Disbursement) == atSecurity.SecurityManager.ExPermissions.Yes;

            if (dr.Final && !dr.IsIRPIdNull() && !canOverride)
            {
                ok = false;
            }
            return(ok);
        }