public static void GetRulersDic(string fileName = "BaseRule.xml") { if (!File.Exists(fileName)) { return; } PointConfigInfo.Rulers.Clear(); var xmlDoc = new XmlDocument(); xmlDoc.Load(fileName); XmlNode root = xmlDoc.SelectSingleNode("ROOT"); XmlNodeList xnl = root.ChildNodes; foreach (XmlNode xnINOROUT in xnl) { var PointRulerDic = new Dictionary <string, PointRuler>(); foreach (var xnRULES in xnINOROUT.ChildNodes) { var element = xnRULES as XmlElement; var ruler = new PointRuler(); if (element.GetElementsByTagName("ISONLY").Count != 0) { ruler.IsOnly = Convert.ToBoolean(element.GetElementsByTagName("ISONLY")[0].InnerText.Trim()); } if (element.GetElementsByTagName("WEIGHT").Count != 0) { ruler.Weight = Math.Abs(Convert.ToInt32(element.GetElementsByTagName("WEIGHT")[0].InnerText.Trim())); } if (element.GetElementsByTagName("AMOUNT").Count != 0) { ruler.Amount = Math.Abs(Convert.ToInt32(element.GetElementsByTagName("AMOUNT")[0].InnerText.Trim())); } if (element.GetElementsByTagName("POINT").Count != 0) { ruler.Point = Math.Abs(Convert.ToInt32(element.GetElementsByTagName("POINT")[0].InnerText.Trim())); } if (element.GetElementsByTagName("MULTIPLE").Count != 0) { ruler.Multiple = Math.Abs(Convert.ToInt32(element.GetElementsByTagName("MULTIPLE")[0].InnerText.Trim())); } if (element.GetElementsByTagName("PLUSORMINUS").Count != 0) { ruler.PlusOrMinus = Convert.ToBoolean(element.GetElementsByTagName("PLUSORMINUS")[0].InnerText.Trim()); } if (element.GetElementsByTagName("DESCRIPTION").Count != 0) { ruler.Description = element.GetElementsByTagName("DESCRIPTION")[0].InnerText.Trim(); } if (element.GetElementsByTagName("DEDUCTION").Count != 0) { ruler.Deduction = Convert.ToBoolean(element.GetElementsByTagName("DEDUCTION")[0].InnerText.Trim()); } PointRulerDic.Add(element.Name, ruler); } PointConfigInfo.Rulers.Add(xnINOROUT.Name, PointRulerDic); } }
public static CalculatePointModel INEqMD(PointRuler ruler, CalculatePointModel calData) { if (ruler.Point == 0) { INPoint0(ruler.Amount, ruler.Multiple, calData); } else { INPointNo0(ruler.PlusOrMinus, ruler.Point, ruler.Amount, ruler.Multiple, calData); } return(calData); }
public static CalculatePointModel OUTEqYear(PointRuler ruler, CalculatePointModel calData) { if (ruler.Point == 0) { OUTAmount0(ruler.PlusOrMinus, ruler.Amount, ruler.Multiple, calData); } else { OUTAmountNo0(ruler.Deduction, ruler.PlusOrMinus, ruler.Point, ruler.Amount, ruler.Multiple, calData); } return(calData); }