コード例 #1
0
        private void extendResults(DataTable dt)
        {
            dt.Columns.Add("Location");
            dt.Columns.Add("AssignedToFriendlyName");
            dt.Columns.Add("Type_Friendly");
            dt.Columns.Add("Response_Friendly");
            dt.Columns.Add("Condition_Friendly");
            dt.Columns.Add("StepDescription");
            dt.Columns.Add("StepUsers");
            dt.Columns.Add("StepStartTime", typeof(DateTime));
            dt.Columns.Add("DaysInQueue");

            foreach (DataRow dr in dt.Rows)
            {
                dr["DaysInQueue"] = DBNull.Value;

                Workflow2.DBStatus dbStatus = workflow2.WorkflowStatusEnum((int)dr["Status"]);
                if (dbStatus == Routing2.DBStatus.Circulating || dbStatus == Routing2.DBStatus.Rejected)
                {
                    List <Routing2.clsStepStatus> lstExtStatus = workflow2.WorkflowStatus(dr["WFID"].ToString(), (int)dr["Status"]);
                    if (lstExtStatus.Count > 0)
                    {
                        foreach (Routing2.clsStepStatus kvp in lstExtStatus)
                        {
                            dr["StepDescription"] += "<nobr>" + kvp.StepDescription + "</nobr><BR>";
                            dr["StepStartTime"]    = kvp.StartTime;

                            int i;
                            if (int.TryParse(kvp.DaysInQueue, out i))
                            {
                                dr["DaysInQueue"] = i;
                            }

                            DataTable dtStepUsers = workflow2.GetStepUsers(kvp.StepID, false, false);
                            foreach (DataRow dr1 in dtStepUsers.Rows)
                            {
                                if (!dr["StepUsers"].ToString().Contains(dr1["Name"].ToString()))
                                {
                                    dr["StepUsers"] += "<nobr>" + dr1["Name"] + "</nobr><br>";
                                }
                            }
                        }
                    }
                }

                if (joinUsers && !string.IsNullOrEmpty(dr["userName"].ToString()))
                {
                    dr["AssignedToFriendlyName"] = tools.GetUserName(dr["userName"].ToString());
                }
                dr["Type_Friendly"]      = CWF_HelpDesk.WOType.getWOType(dr["Type"].ToString());
                dr["Response_Friendly"]  = CWF_HelpDesk.Response.getReponse(dr["Response"].ToString());
                dr["Condition_Friendly"] = CWF_HelpDesk.Condition.getCondition(dr["Condition"].ToString());
                dr["Location"]           = tools.getPlantName(dr["BP"].ToString());
            }
        }
コード例 #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);
        }