/// ---------------------------------------------------------------------
 /// <summary>
 ///     Get Initial Amount View
 /// </summary>
 /// <param name="id">int?</param>
 /// <param name="userName">string</param>
 /// <returns>DetailItemView</returns>
 /// ---------------------------------------------------------------------
 public InitialAmountView GetInitialAmountView(int? id, string userName)
 {
     try
     {
         var initialAmount = GetInitialAmount(id, userName);
         if (initialAmount != null)
         {
             var initialAmountView = new InitialAmountView
             {
                 PkID = initialAmount.PkID,
                 UserName = initialAmount.UserName,
                 StrAmount = initialAmount.Amount.ToString(),
                 //BeginDate = initialAmount.BeginDate	// Archive
             };
             return initialAmountView;
         }
         throw new ArgumentNullException();
     }
     catch (Exception ex)
     {
         return null;
     }
 }
        /// ---------------------------------------------------------------------
        /// <summary>
        ///     Save Credit View
        /// </summary>
        /// <param name="initialAmountView">InitialAmountView</param>
        /// <returns>bool</returns>
        /// ---------------------------------------------------------------------
        public bool Save(InitialAmountView initialAmountView)
        {
            try
            {
                var initialAmount = GetInitialAmount(initialAmountView.PkID, initialAmountView.UserName);
                if (initialAmount != null)
                {
                    initialAmount.Amount = Convert.ToDecimal(initialAmountView.StrAmount.Replace("$", ""));
                    //initialAmount.BeginDate = initialAmountView.BeginDate;	// Archive

                    _db.Entry(initialAmount).State = EntityState.Modified;
                    _db.SaveChanges();
                }
                else
                {
                    throw new ArgumentNullException();
                }
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }
        /// ---------------------------------------------------------------------
        /// <summary>
        ///     Add New Credit
        /// </summary>
        /// <param name="initialAmountView">InitialAmountView</param>
        /// <returns>bool</returns>
        /// ---------------------------------------------------------------------
        public bool Add(InitialAmountView initialAmountView)
        {
            try
            {
                var initialAmount = new InitialAmount
                {
                    UserName = initialAmountView.UserName,
                    Amount = Convert.ToDecimal(initialAmountView.StrAmount.Replace("$", "")),
                    //BeginDate = initialAmountView.BeginDate	// Archive
                };

                _db.InitialAmounts.Add(initialAmount);
                _db.SaveChanges();
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }