示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SubMathset"/> class.
        /// </summary>
        /// <param name="evalRubric">The evalRubric<see cref="MathRubric"/>.</param>
        /// <param name="formuler">The formuler<see cref="Mathset"/>.</param>
        public SubMathset(MathRubric evalRubric, Mathset formuler)
        {
            if (evalRubric != null)
            {
                Rubric = evalRubric;
            }

            SetDimensions(formuler);
        }
        public void Mathset_Computation_Formula_Test()
        {
            rck = new Computation(spcMtic);

            Mathset ml = rck.GetMathset("SellNetPrice");

            ml.Formula = (ml["NetPrice"] * (ml["SellFeeRate"] / 100)) + ml["NetPrice"];

            Mathset ml2 = rck.GetMathset("SellGrossPrice");

            ml2.Formula = ml * ml2["TaxRate"];

            rck.Compute(); // first with formula compilation

            rck.Compute(); // second when formula compiled
        }
        public void Mathset_Computation_LogicOnStack_Formula_Test()
        {
            rck = new Computation(spcMtic);

            Mathset ml = rck.GetMathset("SellNetPrice");

            ml.Formula = (((ml["NetCost"] < 10) | (ml["NetCost"] > 50)) * (ml["NetPrice"] * (ml["SellFeeRate"] / 100)) + ml["NetPrice"]) +
                         ((ml["NetCost"] > 10) & (ml["NetCost"] < 50)) * ml["NetPrice"];

            Mathset ml2 = rck.GetMathset("SellGrossPrice");

            ml2.Formula = ml * ml2["TaxRate"];

            rck.Compute(); // first with formula compilation

            rck.Compute(); // second when formula compiled
        }