void OnTransitionExecuting(object sender, ExecuteTransitionEventArgs executeTransitionEventArgs) {
     var states = executeTransitionEventArgs.Transition.TargetState.StateMachine.States.OfType<XpoState>();
     foreach (var state in states) {
         if (IsNotGranted(state))
             throw new UserFriendlyException("Permissions are not granted for transitioning to the " + state.Caption);
     }
 }
        void OnTransitionExecuting(object sender, ExecuteTransitionEventArgs executeTransitionEventArgs)
        {
            var transition = executeTransitionEventArgs.Transition;

            if (!executeTransitionEventArgs.Cancel && IsGranted(transition, false))
            {
                throw new UserFriendlyException("Permissions are not granted for transitioning to the " + transition.Caption);
            }
        }
Пример #3
0
        void OnTransitionExecuting(object sender, ExecuteTransitionEventArgs executeTransitionEventArgs)
        {
            var targetState = executeTransitionEventArgs.Transition.TargetState;

            if (!executeTransitionEventArgs.Cancel && !IsGranted(targetState))
            {
                throw new UserFriendlyException("Permissions are not granted for transitioning to the " + targetState.Caption);
            }
        }
Пример #4
0
 void StateMachineControllerOnTransitionExecuting(object sender, ExecuteTransitionEventArgs executeTransitionEventArgs)
 {
     executeTransitionEventArgs.Cancel = !executeTransitionEventArgs.Transition.TargetState.StateMachine.CanExecuteTransition();
     if (executeTransitionEventArgs.Cancel)
     {
         new StateMachineLogic(ObjectSpace).ProcessTransition(View.CurrentObject,
                                                              executeTransitionEventArgs.Transition.TargetState.StateMachine.StatePropertyName,
                                                              ObjectSpace.GetObject(executeTransitionEventArgs.Transition.TargetState));
     }
 }
        void OnTransitionExecuted(object sender, ExecuteTransitionEventArgs executeTransitionEventArgs)
        {
            var stateMachines = GetEnabledStateMachines().Where(machine
                                                                => machine == executeTransitionEventArgs.Transition.TargetState.StateMachine);

            foreach (var stateMachine in stateMachines)
            {
                ExecuteTransition(stateMachine);
            }
        }
Пример #6
0
 void StateController_TransitionExecuting(object sender, ExecuteTransitionEventArgs e)
 {
     if (e.Transition.TargetState.StateMachine.GetType() == typeof(TrwSubjectSM))
     {
         MyTransition trans = e.Transition as MyTransition;
         if (trans != null && trans.ValidationContext != null)
         {
             Validator.RuleSet.Validate(e.TargetObject, trans.ValidationContext);
         }
     }
 }
Пример #7
0
        void OnTransitionExecuting(object sender, ExecuteTransitionEventArgs executeTransitionEventArgs)
        {
            var states = executeTransitionEventArgs.Transition.TargetState.StateMachine.States.OfType <XpoState>();

            foreach (var state in states)
            {
                if (IsNotGranted(state))
                {
                    throw new UserFriendlyException("Permissions are not granted for transitioning to the " + state.Caption);
                }
            }
        }
        private void VCCaseApproval_TransitionExecuted(object sender, ExecuteTransitionEventArgs e)
        {
            var caseEnxtension = e.TargetObject as CaseExtension;

            if (caseEnxtension == null)
            {
                return;
            }
            if ((EnumsAll.CaseExtensionState)e.Transition.TargetState.Marker != EnumsAll.CaseExtensionState.确认延期)
            {
                return;
            }
            CommonFunction.UpdateCaseExtensionInPatentCase(caseEnxtension.s_OurNo, caseEnxtension.n_ExtendItem, caseEnxtension.dt_ExtendDate);
            if (caseEnxtension.n_ExtendItem2.HasValue)
            {
                CommonFunction.UpdateCaseExtensionInPatentCase(caseEnxtension.s_OurNo, caseEnxtension.n_ExtendItem2.Value, caseEnxtension.dt_ExtendDate2);
            }
        }
 void OnTransitionExecuted(object sender, ExecuteTransitionEventArgs executeTransitionEventArgs) {
     var stateMachines = GetEnabledStateMachines().Where(machine 
         => machine == executeTransitionEventArgs.Transition.TargetState.StateMachine);
     foreach (var stateMachine in stateMachines) {
         ExecuteTransition(stateMachine);
     }
 }
Пример #10
0
 void OnTransitionExecuting(object sender, ExecuteTransitionEventArgs executeTransitionEventArgs) {
     var targetState = executeTransitionEventArgs.Transition.TargetState;
     if (!IsGranted(targetState))
         throw new UserFriendlyException("Permissions are not granted for transitioning to the " + targetState.Caption);
 }
 void OnTransitionExecuted(object sender, ExecuteTransitionEventArgs e) {
     View.ObjectSpace.CommitChanges();
 }
        void OnTransitionExecuting(object sender, ExecuteTransitionEventArgs e) {
            fmCOrderExt order = e.TargetObject as fmCOrderExt;
            if (order != null) {

            }
        }