public String GetAccountName(int id) { AccountClient ac = new AccountClient(); Account account = ac.Find(id); return(account.Name); }
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()
public ActionResult Edit(int id) { AccountClient client = new AccountClient(); AccountViewModel CVM = new AccountViewModel(); CVM.Account = client.Find(id); return(View("Edit", CVM.Account)); }