Exemple #1
0
 public static void SetHtmlControlMoney(HtmlControl obj, object money, m_MoneyUnit unit, string MoneyType)
 {
     try
     {
         string text = GetMoneyShowString(money, unit, MoneyType);
         string wanDecimalShowHint = GetWanDecimalShowHint(money);
         if (obj is HtmlGenericControl)
         {
             ((HtmlGenericControl)obj).InnerHtml = text;
             if (m_IsRoundWanMoney)
             {
                 ((HtmlGenericControl)obj).Attributes["title"] = wanDecimalShowHint;
             }
         }
         else if (obj is HtmlTableCell)
         {
             ((HtmlTableCell)obj).InnerHtml = text;
             if (m_IsRoundWanMoney)
             {
                 ((HtmlTableCell)obj).Attributes["title"] = wanDecimalShowHint;
             }
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Exemple #2
0
        public static string GetMoneyShowString(object money, m_MoneyUnit unit)
        {
            string text;

            try
            {
                text = GetMoneyShowString(money, unit, "");
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text);
        }
Exemple #3
0
        public static string GetMoneyShowString(object money, m_MoneyUnit unit, string MoneyType)
        {
            string text2;

            try
            {
                string wanDecimalShowString = "";
                switch (unit)
                {
                case m_MoneyUnit.yuan:
                    wanDecimalShowString = StringRule.BuildShowNumberString(money, "#,##0");
                    break;

                case m_MoneyUnit.fen:
                    wanDecimalShowString = StringRule.BuildShowNumberString(money, "#,##0.00");
                    break;

                default:
                    if (MoneyType.ToLower() == "price")
                    {
                        wanDecimalShowString = MathRule.GetWanDecimalShowString(money);
                    }
                    else if (m_IsRoundWanMoney)
                    {
                        wanDecimalShowString = StringRule.BuildMoneyWanFormatString(ConvertRule.ToDecimal(money), -1, 0);
                    }
                    else
                    {
                        wanDecimalShowString = MathRule.GetWanDecimalShowString(money);
                    }
                    break;
                }
                text2 = wanDecimalShowString;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }