Beispiel #1
0
        //风险矩阵分析
        public RiskMatrixElement riskMatrixAnalysis(string Danger_Intensity, string Time_Level)
        {
            string DangerType_isgreen = "";
            string color            = "";
            int    danger_intensity = int.Parse(Danger_Intensity.Substring(1, 1));
            int    time_level       = int.Parse(Time_Level.Substring(1, 1));

            if ((danger_intensity == 1 && time_level <= 3) || (danger_intensity == 2 && time_level <= 2))
            {
                color = "red";
                DangerType_isgreen = "false";
            }
            else if (danger_intensity >= 5 || (danger_intensity == 4 && time_level >= 2) || (danger_intensity == 3 && time_level >= 3))
            {
                color = "green";
                DangerType_isgreen = "true";
            }
            else
            {
                color = "yellow";
                DangerType_isgreen = "false";
            }
            //
            RiskMatrixElement rme = new RiskMatrixElement();

            rme.danger_intensity   = danger_intensity;
            rme.time_level         = time_level;
            rme.color              = color;
            rme.DangerType_isgreen = DangerType_isgreen;
            return(rme);
        }
Beispiel #2
0
 public string submitAssess_signal(string json1)
 {
     try
     {
         JObject item     = (JObject)JsonConvert.DeserializeObject(json1);
         string  flowname = item["Flow_Name"].ToString();
         //paras
         Dictionary <string, string> signal = new Dictionary <string, string>();
         string Danger_Intensity            = item["Danger_Intensity"].ToString();
         string Time_Level = item["Time_Level"].ToString();
         signal["Danger_Intensity"] = Danger_Intensity;
         signal["Time_Level"]       = Time_Level;
         //RiskMatrix_Color,DangerType_isgreen:根据逻辑判断
         RiskMatrixElement rme = riskMatrixAnalysis(Danger_Intensity, Time_Level);
         signal["RiskMatrix_Color"]   = rme.color;
         signal["DangerType_isgreen"] = rme.DangerType_isgreen;
         signal["Assess_done"]        = "true";
         //record:
         Dictionary <string, string> record = new Dictionary <string, string>();
         record["username"] = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name;
         record["time"]     = DateTime.Now.ToString();
         //submit
         CWFEngine.SubmitSignal(Convert.ToInt32(flowname), signal, record);
     }
     catch (Exception e)
     {
         return("");
     }
     return("/A11dot2/Index");
 }