public ActionResult Save(Deposit deposit)
        {
            if (!accountManager.AcExist(deposit.AccountId))
            {
                ViewBag.Message = "Wrong! Account No!!";
            }
            else
            {
                if (ModelState.IsValid)
                {
                    string message = depositManager.Save(deposit);


                    if (message == "Successful")
                    {
                        int bal = accountManager.SearchBalanceByAcNo(deposit.AccountId);
                        ViewBag.Message = "Successful!!!  New Balance Is : " + bal;
                        ModelState.Clear();
                    }
                }

                else
                {
                    ViewBag.Message = "ModelState Is not valid";
                }
            }

            return(View());
        }
 public ActionResult Info(string acNo)
 {
     if (!accountManager.AcExist(acNo))
     {
         ViewBag.Message = "This AcNo is Not Exist!";
     }
     else
     {
         int bal = accountManager.SearchBalanceByAcNo(acNo);
         ViewBag.Message = "Balance = " + bal;
     }
     return(View());
 }
Beispiel #3
0
        public ActionResult Save(Withdraw withdraw)
        {
            int baln = accountManager.SearchBalanceByAcNo(withdraw.AccountId);

            if (baln < withdraw.Ammount)
            {
                ViewBag.Message = "Ops!! Insufficient Balance";
            }
            else
            {
                if (!accountManager.AcExist(withdraw.AccountId))
                {
                    ViewBag.Message = "Wrong! Account No!!";
                }
                else
                {
                    if (ModelState.IsValid)
                    {
                        string message = withdrawManager.Save(withdraw);


                        if (message == "Successful")
                        {
                            int bal = accountManager.SearchBalanceByAcNo(withdraw.AccountId);
                            ViewBag.Message = "Successful!!!  New Balance Is : " + bal;
                            ModelState.Clear();
                        }
                        else
                        {
                            ViewBag.Message = "ModelState Is not valid";
                        }
                    }
                }
            }

            return(View());
        }