Пример #1
0
 /// <summary>
 /// Setup initializer the Fdd Kernel and must be run instead of the Bdd Setup when
 /// working with FDD's
 /// </summary>
 public static void Setup()
 {
     Kernel.Setup();
     FddDictionary.Clear();
     RestrictDictionary.Clear();
     MaxVar = 1;
 }
Пример #2
0
        public string GetRestrictGenesList()
        {
            if (detailModel.restrictGenes != null)
            {
                StringBuilder bulider = new StringBuilder();
                for (int i = 0; i < detailModel.restrictGenes.Count; i++)
                {
                    RestrictGene       oRestrictGene       = detailModel.restrictGenes[i];
                    RestrictDictionary oRestrictDictionary = oRestrictGene.values[0];

                    bulider.Append("<div> 名称:" + oRestrictGene.name + "</div><div>");
                    if (oRestrictGene.name == "基本保额")
                    {
                        bulider.AppendLine(" <select id='jibenbaoe' name='jibenbaoe'  key='" + oRestrictGene.key + "' sort='" + oRestrictGene.sort + "' protectItemId='" + oRestrictGene.protectItemId + "'>");
                    }
                    else
                    {
                        bulider.Append(" <select id = \"" + oRestrictGene.key + "\" name = \"" + oRestrictGene.key + "\" key='" + oRestrictGene.key + "' sort='" + oRestrictGene.sort + "' >");
                    }
                    for (int c = 0; c < oRestrictGene.values.Count; c++)
                    {
                        if (oRestrictGene.values[c].type == "1")
                        {
                            string unit = oRestrictGene.values[c].unit;
                            bulider.Append(" <option value ='" + oRestrictGene.values[c].value + "' unit='" + unit + "' " + GetDefalutSelected(oRestrictGene.defaultValue, oRestrictGene.values[c].value + unit) + ">" + oRestrictGene.values[c].value + unit + "</option>");
                        }
                        else if (oRestrictGene.values[c].type == "2")
                        {
                            oRestrictDictionary = oRestrictGene.values[c];
                            bulider.Append(restrictGenes(oRestrictDictionary, oRestrictGene));
                        }
                    }
                    bulider.Append(" </select></div> ");
                }
                return(bulider.ToString());
            }
            return(string.Empty);
        }
Пример #3
0
        public string restrictGenes(RestrictDictionary oRestrictDictionary, RestrictGene oRestrictGene)
        {
            int    minValue = 0, MaxValue = 0, step = 0;
            string strValue = oRestrictDictionary.value;

            string[] array = strValue.Split('-');
            minValue = UtilityHelper.BWJSCommonHelper.SafeInt(array[0], 0);
            MaxValue = UtilityHelper.BWJSCommonHelper.SafeInt(array[1], 0);
            step     = oRestrictDictionary.step;

            StringBuilder bulider = new StringBuilder();

            for (int j = minValue; j <= MaxValue; j = j + step)
            {
                if (!string.IsNullOrWhiteSpace(oRestrictGene.defaultValue))
                {
                    bulider.AppendLine("<option  " + GetDefalutSelected(oRestrictGene.defaultValue, j + oRestrictDictionary.unit) + " value = '" + j + "'   unit='" + oRestrictDictionary.unit + "' >");
                    bulider.Append(j + oRestrictDictionary.unit);
                    bulider.Append("</option >");
                }
            }
            return(bulider.ToString());
        }