Example #1
0
        /// <summary>
        /// Remove money from account
        /// </summary>
        /// <param name="RemoveAmount"></param>
        /// <param name="ActivityName"></param>
        /// <param name="UserName"></param>
        public void Remove(double RemoveAmount, string ActivityName, string UserName)
        {
            if (RemoveAmount > 0)
            {
                RemoveAmount = Math.Round(RemoveAmount, 2, MidpointRounding.ToEven);
                amount -= RemoveAmount;

                Transaction details = new Transaction();
                details.Credit = RemoveAmount;
                details.Sender = ActivityName;
                details.Reason = UserName;
                LastTransaction = details;

                TransactionOcurredEventArgs eargs = new TransactionOcurredEventArgs();
                eargs.Details = details;
                TransactionOccurred(eargs);
            }
        }
Example #2
0
 /// <summary>
 /// Transcation occurred 
 /// </summary>
 /// <param name="e"></param>
 protected virtual void TransactionOccurred(TransactionOcurredEventArgs e)
 {
     if (OnTransactionOccurred != null)
         OnTransactionOccurred(this, e);
 }
Example #3
0
        /// <summary>
        /// Add money to account
        /// </summary>
        /// <param name="AddAmount"></param>
        /// <param name="ActivityName"></param>
        /// <param name="UserName"></param>
        public void Add(double AddAmount, string ActivityName, string UserName)
        {
            if(AddAmount>0)
            {
                AddAmount = Math.Round(AddAmount, 2, MidpointRounding.ToEven);
                amount += AddAmount;

                Transaction details = new Transaction();
                details.Debit = AddAmount;
                details.Sender = ActivityName;
                details.Reason = UserName;
                LastTransaction = details;

                TransactionOcurredEventArgs eargs = new TransactionOcurredEventArgs();
                eargs.Details = details;
                TransactionOccurred(eargs);
            }
        }