public JsonResult TransferToChinese(long number)
 {
     MoneyContext context = new MoneyContext(number);
     MoneyController uco = new MoneyController();
     uco.TransferToChinese(ref context);
     return Json(context.ToChinese(), JsonRequestBehavior.AllowGet);
 }
        public override void Interpret(MoneyContext context)
        {
            int value = context.GetNumIntList().First();

            Cn = (ChineseNumber)value;
            if ((prior != null) && (prior.IsZero()) && (prior.Cn == Cn))
            {
                return;
            }
            context.GetChineseCharList().AddFirst(EnumUtils.stringValueOf(Cn));
            return;
        }
 public void TransferToChinese(ref MoneyContext context, MoneyExpression prior = null)
 {
     if (context.GetNumIntList().Count == 0)
         return;
     MoneyExpression expression = new NumericExpression((NumericExpression)prior);
     expression.Interpret(context);
     context.GetNumIntList().RemoveFirst();
     if (context.GetNumIntList().Count > 0)
     {
         this.TransferToChinese(ref context, expression);
     }
 }
        public void TransferToChinese(ref MoneyContext context, MoneyExpression prior = null)
        {
            if (context.GetNumIntList().Count == 0)
            {
                return;
            }
            MoneyExpression expression = new NumericExpression((NumericExpression)prior);

            expression.Interpret(context);
            context.GetNumIntList().RemoveFirst();
            if (context.GetNumIntList().Count > 0)
            {
                this.TransferToChinese(ref context, expression);
            }
        }
        public override void Interpret(MoneyContext context)
        {
            int unit = context.GetNumIntList().Count - 1;

            if (unit == 0)
            {
                return;
            }
            else if (unit % 4 > 0)
            {
                unit = unit % 4;
            }
            Cu = (ChineseUnit)unit;
            if ((currentNumber != null) && (currentNumber.IsZero()))
            {
                if (this.LessThan4())
                {
                    return;
                }
                else if (this.GreatThan3())
                {
                    try
                    {
                        ChineseUnit preCu = (ChineseUnit)EnumUtils.enumValueOf(context.GetChineseCharList().First(), typeof(ChineseUnit));
                        if ((((int)preCu) > 3) && (this.GreatThan3()))
                        {
                            return;
                        }
                    }
                    catch { }
                    context.GetChineseCharList().RemoveFirst();
                }
            }
            try
            {
                ChineseUnit preCu = (ChineseUnit)EnumUtils.enumValueOf(context.GetChineseCharList().First(), typeof(ChineseUnit));
                if ((((int)preCu) > 3) && (this.GreatThan3()))
                {
                    return;
                }
            }
            catch { }
            context.GetChineseCharList().AddFirst(EnumUtils.stringValueOf(Cu));
        }
 public override void Interpret(MoneyContext context)
 {
     number.Interpret(context);
     unit.Interpret(context);
 }
 public abstract void Interpret(MoneyContext context);
 public override void Interpret(MoneyContext context)
 {
     number.Interpret(context);
     unit.Interpret(context);
 }
 public abstract void Interpret(MoneyContext context);
 public override void Interpret(MoneyContext context)
 {
     int unit = context.GetNumIntList().Count - 1;
     if (unit == 0)
         return;
     else if (unit % 4 > 0)
         unit = unit % 4;
     Cu = (ChineseUnit)unit;
     if ((currentNumber != null) && (currentNumber.IsZero()))
     {
         if (this.LessThan4())
             return;
         else if (this.GreatThan3())
         {
             try
             {
                 ChineseUnit preCu = (ChineseUnit)EnumUtils.enumValueOf(context.GetChineseCharList().First(), typeof(ChineseUnit));
                 if ((((int)preCu) > 3) && (this.GreatThan3()))
                     return;
             }
             catch { }
             context.GetChineseCharList().RemoveFirst();
         }
     }
     try
     {
         ChineseUnit preCu = (ChineseUnit)EnumUtils.enumValueOf(context.GetChineseCharList().First(), typeof(ChineseUnit));
         if ((((int)preCu) > 3) && (this.GreatThan3()))
             return;
     }
     catch { }
     context.GetChineseCharList().AddFirst(EnumUtils.stringValueOf(Cu));
 }
 public override void Interpret(MoneyContext context)
 {
     int value = context.GetNumIntList().First();
     Cn = (ChineseNumber)value;
     if ((prior != null) && (prior.IsZero()) && (prior.Cn == Cn))
         return;
     context.GetChineseCharList().AddFirst(EnumUtils.stringValueOf(Cn));
     return;
 }