Esempio n. 1
0
        public ActionResult Edit(Account CVM)
        {
            AccountClient client = new AccountClient();

            client.Edit(CVM);
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public void refreshBalance(int id, decimal amount, decimal oldamount, char action) //action c=create e=edit d=delete
        {
            AccountClient ac      = new AccountClient();
            Account       account = ac.Find(id);

            if (action == 'c')
            {
                account.Expenses += amount;
                account.Balance  -= amount;
            }
            else
            {
                if (action == 'e')
                {
                    account.Expenses -= oldamount;
                    account.Balance  += oldamount;
                    account.Expenses += amount;
                    account.Balance  -= amount;
                }
                else
                {
                    if (action == 'd')
                    {
                        account.Expenses -= amount;
                        account.Balance  += amount;
                    }
                }
            }
            ac.Edit(account);
        }//refreshBalance()