void TLogTranslateItem_OnBeforeRuleProcess(object sender, EventArgs e) { XmlDocument doc = (XmlDocument)sender; System.Xml.XPath.XPathNavigator nav = doc.CreateNavigator(); Shipping = doc.SelectSingleNode("CustomerOrder/Customer/@Shipping_Price") == null ? 0 : Convert.ToDouble(doc.SelectSingleNode("CustomerOrder/Customer/@Shipping_Price").Value); TaxableShipping = doc.SelectSingleNode("CustomerOrder/Customer/@Taxable_Shipping_Amount") == null ? 0 : Convert.ToDouble(doc.SelectSingleNode("CustomerOrder/Customer/@Taxable_Shipping_Amount").Value); Handling = Convert.ToDouble(nav.Evaluate("sum(//*/@Handling_Charge)")); }
public double eval_double(string expr) { try { return((double)_eval.Evaluate(string.Format("number({0})", expr))); } catch (Exception ex) { log.log_err(expr); throw ex; } }