Пример #1
0
        public override Process DoBusinessProcess(RuleBusiness rule, BusinessObjectExecute <ObjectPresenter <TView> > businessObject)
        {
            TProcess proc = new TProcess();

            //permet d'initier la vue dans declancher l'initialisatoin de la page.
            proc.AssignView(businessObject.Parameter.GetView);


            switch (rule.CodeMessage)
            {
            case "ERR_PRES":
                try
                {
                    proc.Initialisation(false, businessObject.Parameter.GetView, businessObject.Parameter.Presenter);
                    businessObject.Parameter.Process = proc;
                }
                catch (Exception ex)
                {
                    Utile.DiscriminationError <TView>(ex, proc, businessObject.Parameter.GetView);

                    return(Process.SuccessAddMessage);
                }
                break;
            }



            return(Process.Succeed);
        }
Пример #2
0
        public override Process DoBusinessProcess(RuleBusiness rule, BusinessObjectExecute <ObjectProcess <TView> > businessObject)
        {
            IOperation <TView> p = businessObject.Parameter.GetProcess;

            switch (rule.CodeMessage)
            {
            case "ERR_CMD_ACTION":
                try
                {
                    p.OnCommand(businessObject.Parameter.Command, businessObject.Parameter.Args, businessObject.Parameter.GetView, businessObject.Parameter.Presenter);

                    return(Process.Succeed);
                }
                catch (Exception ex)
                {
                    Utile.DiscriminationError <TView>(ex, p, businessObject.Parameter.GetView);

                    return(Process.SuccessAddMessage);
                }

            case "ERR_CMD_SHOW":
                bool isError = false;
                if (businessObject.Parameter.GetView.ViewLogics.BusinessMessages != null)
                {
                    isError = true;
                    p.ShowBusinessValidation(Resources.CoreResources.CA_PROCESS, "", businessObject.Parameter.GetView.ViewLogics.BusinessMessages);
                }
                if (businessObject.Parameter.GetView.ViewLogics.ContextValidationMessage != null)
                {
                    isError = true;
                    p.ShowContextValidation(Resources.CoreResources.CA_PROCESS, "", businessObject.Parameter.GetView.ViewLogics.ContextValidationMessage);
                }
                if (businessObject.Parameter.GetView.ViewLogics.ReservationMessages != null)
                {
                    isError = true;
                    p.ShowReservation(Resources.CoreResources.CA_PROCESS, "", businessObject.Parameter.GetView.ViewLogics.ReservationMessages);
                }
                if (businessObject.Parameter.GetView.ViewLogics.SecurityMessages != null)
                {
                    isError = true;
                    p.ShowSecurity(Resources.CoreResources.CA_PROCESS, "", businessObject.Parameter.GetView.ViewLogics.SecurityMessages);
                }

                if (isError)
                {
                    return(Process.FailedStopRules);
                }


                break;

            default:
                break;
            }

            return(Process.Succeed);
        }