Example #1
0
        private void loadPerformanceTable()
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(Path.Combine(XMCDADirectory, "performance_table.xml"));

            // this file contains only one main block - <criteriaScales>
            foreach (XmlNode xmlNode in xmlDocument.DocumentElement.ChildNodes[0])
            {
                Alternative alternative = new Alternative();
                alternative.CriteriaValues = new Dictionary <string, float>();

                foreach (XmlNode performance in xmlNode.ChildNodes)
                {
                    // first node containts alternative ID
                    if (performance.Name == "alternativeID")
                    {
                        alternative.Name = performance.InnerText;
                    }
                    else
                    {
                        string criterionID   = performance.ChildNodes[0].InnerText;
                        string criterionName = CriterionList.Find(criterion => criterion.ID == criterionID).Name;
                        float  value         = float.Parse(performance.ChildNodes[1].FirstChild.InnerText, CultureInfo.InvariantCulture);
                        alternative.CriteriaValues.Add(criterionName, value);
                    }
                }

                AlternativeList.Add(alternative);
            }
        }
Example #2
0
 protected void GridViewCriterion_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         DataRowView arg_21_0 = (DataRowView)e.Row.DataItem;
         string      text     = this.GridViewCriterion.DataKeys[e.Row.RowIndex].Values[0].ToString();
         e.Row.Attributes["id"]    = text;
         e.Row.Attributes["style"] = "cursor:hand";
         CheckBox checkBox = (CheckBox)e.Row.Cells[0].FindControl("chk");
         checkBox.Attributes["class"] = "chk";
         checkBox.Attributes["id"]    = text;
         Label label = (Label)e.Row.Cells[0].FindControl("Label3");
         label.Attributes["style"] = "display:none";
         if (CriterionList.IsNumber(e.Row.Cells[4].Text))
         {
             e.Row.Cells[4].Text = com.jwsoft.pm.entpm.PageHelper.QueryDept(this, Convert.ToInt32(e.Row.Cells[4].Text.Trim()));
         }
         else
         {
             e.Row.Cells[4].Text = "";
         }
         e.Row.Attributes["onclick"] = "clickRow(this);";
         string text2 = CriterionList.StripHTML(e.Row.Cells[5].Text);
         e.Row.Cells[5].ToolTip = text2;
         if (text2.Length > 20)
         {
             text2 = text2.Substring(0, 19) + "…";
         }
         e.Row.Cells[5].Text = text2;
         Label label2 = (Label)e.Row.Cells[2].FindControl("Label1");
         this.Session["DATUMCLASS"].ToString();
         label2.Attributes["onclick"] = string.Concat(new object[]
         {
             "OpType('See','",
             this.Session["DATUMCLASS"],
             "','",
             text,
             "');"
         });
         if (CriterionList._typeVal == "List")
         {
             e.Row.Cells[0].Text    = "";
             e.Row.Cells[0].Visible = false;
             return;
         }
     }
     else
     {
         if (e.Row.RowType == DataControlRowType.Header)
         {
             e.Row.Cells[2].Text = this.listTitleStr;
             if (CriterionList._typeVal == "List")
             {
                 e.Row.Cells[0].Text    = "";
                 e.Row.Cells[0].Visible = false;
             }
         }
     }
 }
Example #3
0
 private void AddCriterion()
 {
     if (string.IsNullOrWhiteSpace(_criterion))
     {
         _page.DisplayAlert("Error", "String can not be empty", "Ok");
     }
     else
     {
         CriterionList.Add(new FeedbackModel {
             Criterion = _criterion, SliderValue = _sliderValue
         });
     }
 }
Example #4
0
    public static string StripHTML(string strHtml)
    {
        string[] array = new string[]
        {
            "<script[^>]*?>.*?</script>",
            "<(\\/\\s*)?!?((\\w+:)?\\w+)(\\w+(\\s*=?\\s*(([\"'])(file://[\"'tbnr]|[^/7])*?/7|/w+)|.{0})|/s)*?(///s*)?>",
            "([\\r\\n])[\\s]+",
            "&(quot|#34);",
            "&(amp|#38);",
            "&(lt|#60);",
            "&(gt|#62);",
            "&(nbsp|#160);",
            "&(iexcl|#161);",
            "&(cent|#162);",
            "&(pound|#163);",
            "&(copy|#169);",
            "&#(\\d+);",
            "-->",
            "<!--.*\\n"
        };
        string[] array2 = new string[]
        {
            "",
            "",
            "",
            "\"",
            "&",
            "<",
            ">",
            " ",
            "¡",
            "¢",
            "£",
            "©",
            "",
            "\r\n",
            ""
        };
        string arg_135_0 = array[0];
        string text      = strHtml;

        for (int i = 0; i < array.Length; i++)
        {
            Regex regex = new Regex(array[i], RegexOptions.IgnoreCase);
            text = regex.Replace(text, array2[i]);
        }
        text.Replace("<", "");
        text.Replace(">", "");
        text.Replace("\r\n", "");
        return(CriterionList.DelHTML(text));
    }
Example #5
0
        private void loadCriteriaScales()
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(Path.Combine(XMCDADirectory, "criteria_scales.xml"));

            // this file contains only one main block - <criteriaScales>
            foreach (XmlNode xmlNode in xmlDocument.DocumentElement.ChildNodes[0])
            {
                string criterionID        = xmlNode.ChildNodes[0].InnerText;
                string criterionDirection = xmlNode.ChildNodes[1].FirstChild.FirstChild.FirstChild.InnerText;

                var index = CriterionList.FindIndex(criterion => criterion.ID == criterionID);
                CriterionList[index].CriterionDirection = criterionDirection == "max" ? "g" : "c";
            }
        }
Example #6
0
        private void loadCriteria()
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(Path.Combine(XMCDADirectory, "criteria.xml"));

            // this file contains only one main block - <criteria>
            foreach (XmlNode xmlNode in xmlDocument.DocumentElement.ChildNodes[0])
            {
                Criterion criterion = new Criterion()
                {
                    Name = xmlNode.Attributes["name"].Value,
                    ID   = xmlNode.Attributes["id"].Value
                };

                CriterionList.Add(criterion);
            }
        }
		public VirtualFirstLastQuery(byte[] indexId, int firstPageSize, int lastPageSize, string targetIndexName, CriterionList criterionList, bool excludeData, bool getMetadata, string cacheTypeName)
			: base(indexId, firstPageSize, lastPageSize, targetIndexName, criterionList, excludeData, getMetadata)
		{
			Init(cacheTypeName);
		}
		public VirtualFirstLastQuery(byte[] indexId, int firstPageSize, int lastPageSize, string targetIndexName, CriterionList criterionList, string cacheTypeName)
			: base(indexId, firstPageSize, lastPageSize, targetIndexName, criterionList)
		{
			Init(cacheTypeName);
		}
		public VirtualPagedIndexQuery(List<byte[]> indexIdList, int pageSize, int pageNum, string targetIndexName, List<string> tagsFromIndexes, TagSort tagSort, CriterionList criterionList, int maxItemsPerIndex, bool excludeData, bool getIndexHeader, string cacheTypeName)
			: base(indexIdList, pageSize, pageNum, targetIndexName, tagsFromIndexes, tagSort, criterionList, maxItemsPerIndex, excludeData, getIndexHeader)
		{
			Init(cacheTypeName);
		}
Example #10
0
 public void AddCriterion(Criterion criterion)
 {
     CriterionList.Add(criterion);
 }
		public VirtualGetRangeQuery(byte[] indexId, int offset, int itemNum, string targetIndexName, CriterionList criterionList, bool excludeData, bool getMetadata, string cacheTypeName)
			: base(indexId, offset, itemNum, targetIndexName, criterionList, excludeData, getMetadata)
		{
			Init(cacheTypeName);
		}
		public VirtualGetRangeQuery(byte[] indexId, int offset, int itemNum, string targetIndexName, CriterionList criterionList, string cacheTypeName)
			: base(indexId, offset, itemNum, targetIndexName, criterionList)
		{
			Init(cacheTypeName);
		}
 public FirstLastQuery(byte[] indexId, int firstPageSize, int lastPageSize, string targetIndexName, CriterionList criterionList, bool excludeData, bool getMetadata)
 {
     Init(indexId, firstPageSize, lastPageSize, targetIndexName, excludeData, getMetadata, null);
 }
 public FirstLastQuery(byte[] indexId, int firstPageSize, int lastPageSize, string targetIndexName, CriterionList criterionList)
 {
     Init(indexId, firstPageSize, lastPageSize, targetIndexName, false, false, null);
 }
 public GetRangeQuery(byte[] indexId, int offset, int itemNum, string targetIndexName, CriterionList criterionList, bool excludeData, bool getMetadata)
 {
     Init(indexId, offset, itemNum, targetIndexName, excludeData, getMetadata, null);
 }
 public GetRangeQuery(byte[] indexId, int offset, int itemNum, string targetIndexName, CriterionList criterionList)
 {
     Init(indexId, offset, itemNum, targetIndexName, false, false, null);
 }