Beispiel #1
0
        public void CheckFinalStepAction(DataTable dtStep)
        {
            if (workflow2.WorkflowStatus(int.Parse(workflowID)) == CWF_WorkflowRouting.Routing2.DBStatus.Complete)
            {
                if (dtStep.Rows[0]["FinalStepAction"] != DBNull.Value)
                {
                    switch (dtStep.Rows[0]["FinalStepAction"].ToString().ToLower())
                    {
                    case "emailall":
                        workflow2.SendCompletedEmail_AllUsers(int.Parse(workflowID));
                        break;

                    case "emailowner":
                        workflow2.SendCompletedEmail_CreatorOnly(int.Parse(workflowID));
                        break;
                    }
                }
            }
        }
Beispiel #2
0
        public BaseClassWF(HttpRequest Request, WebSecure WSSecurity, HttpServerUtility httpServer, HttpResponse Response)
        {
            SecCred = new SecurityCredentials();

            if (System.Configuration.ConfigurationManager.AppSettings["usesAD"] != null)
            {
                _usesAD = bool.Parse(System.Configuration.ConfigurationManager.AppSettings["usesAD"]);
            }

            AU = new Authentication(SecCred, _usesAD);

            if (_usesAD)
            {
                _WSSecurity = WSSecurity;
                _userID     = _WSSecurity.AuthenticateUser();
            }
            else
            {
                _userID = AU.getPortalCookie(Request, Response);
            }

            Server = httpServer;

            _webServer        = Request.Url.Authority;
            SecCred.WebServer = _webServer;

            _BP = Request["BP"];

            _stepID = Request["stepID"];
            if (Request["mailMessage"] != null)
            {
                _isMailMessage = true;
            }

            _appFriendlyName = System.Configuration.ConfigurationManager.AppSettings["AppFriendlyName"];
            _databaseName    = System.Configuration.ConfigurationManager.AppSettings["dbName"];
            //tools = new Tools2(_BP, userID, SecCred, _usesAD);

            culture = new CultureInfo("en-US");
            try
            {
                if (Request.UserLanguages != null)
                {
                    culture = CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);
                }
            }
            catch
            { }

            _appPath    = Request.ApplicationPath;
            _workflowID = Request["workflowID"] + "";
            if (_workflowID.Length == 0 || _workflowID == "-1")
            {
                _workflowID = "0";
            }

            string       filename = Server.MapPath("~/CSS/osx2_1.css");
            StreamReader sr       = File.OpenText(filename);
            string       s        = sr.ReadToEnd();

            workflow2 = new Workflow2(SecCred, _BP, _userID, culture, s, 700, _usesAD);

            dbServerModeStruct sms = SecCred.GetServerMode(Request.Url.Host);

            if (System.Configuration.ConfigurationManager.AppSettings["RoutingDebugStatus"] != null && sms.Mode != "P")
            {
                workflow2.debug      = bool.Parse(System.Configuration.ConfigurationManager.AppSettings["RoutingDebugStatus"]);
                workflow2.debugUsers = System.Configuration.ConfigurationManager.AppSettings["RoutingDebugEmail"] + "";
                //if (!_webServer.Contains("localhost"))
                //  workflow2.debugEmailCopyCreator = bool.Parse(System.Configuration.ConfigurationManager.AppSettings["RoutingDebugEmailCopyCreator"]);
            }

            _isAdmin = workflow2.isAdmin();

            _DBStatus = workflow2.WorkflowStatus(int.Parse(_workflowID));

            switch (_DBStatus)
            {
            case Routing2.DBStatus.Circulating:
            case Routing2.DBStatus.NotStarted:
            case Routing2.DBStatus.Rejected:
                if ((_isAdmin || workflow2.enablePopUpMenus(int.Parse(_workflowID))) && !_isMailMessage)
                {
                    _enableTemplateMenu = true;
                    _enableStepMenu     = true;
                }
                break;
            }

            if (_DBStatus == Routing2.DBStatus.Circulating || _DBStatus == Routing2.DBStatus.Rejected)
            {
                _isSignOffVisible = true;
            }

            //myTranslation = new AppTranslations();
            LangCookies = new SQLCookies("Language", _userID, SecCred);
        }