public void DeleteTransacation() { try { //intiate objects managefeesBalance myB = new managefeesBalance(); manageTransaction myT = new manageTransaction(); //get transaction myT.getTransacation(this.tranId); //update balance myB.getBalance(myT.transAccount, myT.transTerm); curBalance = myB.CurrentBal + myT.transAmount; accumatedPayement = myB.PaymentIn - myT.transAmount; myB.CurrentBal = this.curBalance; myB.ClosingBal = this.curBalance; myB.PaymentIn = accumatedPayement; if (myB.updateBalances(myT.transAccount, myT.transTerm) == true) { //finally delete transaction if (myT.DeleteTrans(this.tranId) == true) { this.dacCrud = true; } } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("system error " + ex); } }