Esempio n. 1
0
        public static void BaseOnPostDerive(this WorkEffort @this, ObjectOnPostDerive method)
        {
            if ([email protected])
            {
                @this.AddDeniedPermission(new Permissions(@this.Strategy.Session).Get((Class)@this.Strategy.Class, MetaWorkEffort.Instance.Invoice, Operations.Execute));
            }
            else
            {
                @this.RemoveDeniedPermission(new Permissions(@this.Strategy.Session).Get((Class)@this.Strategy.Class, MetaWorkEffort.Instance.Invoice, Operations.Execute));
            }

            var completePermission = new Permissions(@this.Strategy.Session).Get((Class)@this.Strategy.Class, MetaWorkEffort.Instance.Complete, Operations.Execute);

            if (@this.ServiceEntriesWhereWorkEffort.Any(v => !v.ExistThroughDate))
            {
                @this.AddDeniedPermission(new Permissions(@this.Strategy.Session).Get((Class)@this.Strategy.Class, MetaWorkEffort.Instance.Complete, Operations.Execute));
            }
            else
            {
                if (@this.WorkEffortState.IsInProgress)
                {
                    @this.RemoveDeniedPermission(new Permissions(@this.Strategy.Session).Get((Class)@this.Strategy.Class, MetaWorkEffort.Instance.Complete, Operations.Execute));
                }
            }

            if (@this.WorkEffortState.IsFinished)
            {
                if (@this.ExecutedBy.Equals(@this.Customer))
                {
                    @this.RemoveDeniedPermission(new Permissions(@this.Strategy.Session).Get((Class)@this.Strategy.Class, MetaWorkEffort.Instance.Revise, Operations.Execute));
                }
            }
        }
Esempio n. 2
0
 public static void AppsOnPostDerive(this WorkEffort @this, ObjectOnPostDerive method)
 {
     if ([email protected])
     {
         @this.AddDeniedPermission(new Permissions(@this.Strategy.Session).Get(@this.Strategy.Class, MetaWorkEffort.Instance.Invoice, Operations.Execute));
     }
     else
     {
         @this.RemoveDeniedPermission(new Permissions(@this.Strategy.Session).Get(@this.Strategy.Class, MetaWorkEffort.Instance.Invoice, Operations.Execute));
     }
 }