public static void ViewHandler(TaxCalcForm tf) { TaxableEntity te = GetEntityFromUI(tf); if (te == null) { ShowError(); return; } string archetype = ComputeArchetype(te); COMPUTATION_CONTEXT ctx = new COMPUTATION_CONTEXT(); TaxDTO td = new TaxDTO { id = te.id, taxparams = te.taxparams }; ctx.Put("tax_cargo", td); bool rs = CommandDispatcher.Dispatch(archetype, ctx); if (rs) { TaxDTO temp = (TaxDTO)ctx.Get("tax_cargo"); tf.Liabilitytxt.Text = Convert.ToString(temp.taxparams.TaxLiability); tf.Refresh(); } }
public static void ViewHandler(TaxCalcForm tf) { TaxableEntity te = GetEntityFromUI(tf); if (te == null) { ShowError(); return; } bool rs = TaxComputationFacade.Compute(te); if (rs) { tf.Liabilitytxt.Text = Convert.ToString(te.taxparams.TaxLiability); tf.Refresh(); } }