Exemplo n.º 1
0
 /// <summary>
 /// Takes validated NumberWord object and appends it to the database
 /// </summary>
 /// <param name="nm"></param>
 public void AddNumberModel(NumberToWord nm)
 {
     using (var ent = SimplifyDBHelper.DBEntities)
     {
         ent.NumberToWords.Add(nm);
         ent.SaveChanges();
     }
 }
Exemplo n.º 2
0
        public NumberToWord GenerateWord(decimal totalNumber)
        {
            try
            {
                var result = WordFunction.NumberToWords(totalNumber);
                var nm     = new NumberToWord()
                {
                    InputNumber = totalNumber,
                    OutputText  = result
                };

                DBOperations.Instance.AddNumberModel(nm);

                return(nm);
            }
            catch (Exception ex)
            {
                //logging
                return(new NumberToWord());
            }
        }