Example #1
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            Workflow_BSO bso = new Workflow_BSO();

            Response = bso.WorkflowSignoffCreate(Ado, DTO, SamAccountName);
            if (Response.error != null)
            {
                return(false);
            }

            return(true);
        }
Example #2
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            Workflow_BSO bso              = new Workflow_BSO();
            Account_BSO  aBso             = new Account_BSO();
            bool         responseComplete = false;

            //Create the workflow request
            Response = bso.WorkflowRequestCreate(DTO, Ado, SamAccountName);
            if (Response.error != null)
            {
                return(false);
            }

            //If this is a user with an automatic flow to the next stage, then do the response immediately
            if (bso.HasFastrackPermission(Ado, SamAccountName, DTO.RlsCode, "workflow.fastrack.response"))
            {
                Log.Instance.Debug("Fastrack from Request to Response");
                WorkflowResponse_DTO rspDto = new WorkflowResponse_DTO()
                {
                    RlsCode = DTO.RlsCode, RspCode = Constants.C_WORKFLOW_STATUS_APPROVE, CmmValue = Label.Get("auto-approve-comment")
                };
                Response = bso.WorkflowResponseCreate(rspDto, Ado, SamAccountName);
                if (Response.error != null)
                {
                    return(false);
                }
                responseComplete = true;
            }


            //If this is a user with an automatic flow to the next stage (and the response has been completed), then do the signoff immediately
            if (bso.HasFastrackPermission(Ado, SamAccountName, DTO.RlsCode, "workflow.fastrack.signoff") && responseComplete)
            {
                if (!(IsPowerUser() || IsAdministrator()))
                {
                    Response.error = Label.Get("error.authentication");
                    return(false);
                }
                Log.Instance.Debug("Fastrack from Request to Signoff via Response");
                WorkflowSignoff_DTO sgnDTO = new WorkflowSignoff_DTO()
                {
                    RlsCode = DTO.RlsCode, SgnCode = Constants.C_WORKFLOW_STATUS_APPROVE, CmmValue = Label.Get("auto-approve-signoff")
                };
                Response = bso.WorkflowSignoffCreate(Ado, sgnDTO, SamAccountName);
                if (Response.error != null)
                {
                    return(false);
                }
            }
            return(true);
        }
Example #3
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            Workflow_BSO bso  = new Workflow_BSO();
            Account_BSO  aBso = new Account_BSO();

            Response = bso.WorkflowResponseCreate(DTO, Ado, SamAccountName);
            if (Response.error != null)
            {
                return(false);
            }

            //If this is a Reject, we must not go any further, no matter what kind of user is involved.
            if (DTO.RspCode == Constants.C_WORKFLOW_STATUS_REJECT)
            {
                return(true);
            }

            //If this is a user with an automatic flow to the next stage, then do the signoff immediately
            if (bso.HasFastrackPermission(Ado, SamAccountName, DTO.RlsCode, "workflow.fastrack.signoff"))
            {
                if (!(IsPowerUser() || IsAdministrator()))
                {
                    Response.error = Label.Get("error.authentication");
                    return(false);
                }
                Log.Instance.Debug("Fastrack from Response to Signoff");

                WorkflowSignoff_DTO sgnDTO = new WorkflowSignoff_DTO()
                {
                    RlsCode = DTO.RlsCode, SgnCode = Constants.C_WORKFLOW_STATUS_APPROVE, CmmValue = Label.Get("auto-approve-signoff")
                };
                Response = bso.WorkflowSignoffCreate(Ado, sgnDTO, SamAccountName);
                if (Response.error != null)
                {
                    return(false);
                }
            }
            return(true);
        }