Ejemplo n.º 1
0
        public static void RoundByCurrency(BusinessObject obj, int currencyID)
        {
            VinaDbUtil dbUtil = new VinaDbUtil();

            GECurrenciesController currencyController = new GECurrenciesController();
            GECurrenciesInfo       currency           = currencyController.GetObjectByID(currencyID) as GECurrenciesInfo;
        }
Ejemplo n.º 2
0
        public static void RoundByCurrency(BusinessObject obj, string columnName, int currencyID)
        {
            VinaDbUtil dbUtil = new VinaDbUtil();

            GECurrenciesController currencyController = new GECurrenciesController();
            GECurrenciesInfo       currency           = currencyController.GetObjectByID(currencyID) as GECurrenciesInfo;

            if (currency != null && obj != null)
            {
                object  value  = dbUtil.GetPropertyValue(obj, columnName);
                decimal amount = 0;
                if (value != null)
                {
                    amount = Convert.ToDecimal(value);
                    amount = Math.Round(amount, currency.GECurrencyDecimalNumber);
                    dbUtil.SetPropertyValue(obj, columnName, amount);
                }
            }
        }