public ActionResult UpdateAmountCheck(AmountCheck amountforchecking) { var CheckFromAccount = db.AccountList.Where(s => s.AccountListID == amountforchecking.ToAccountID).FirstOrDefault(); var CheckToAccount = db.AccountList.Where(s => s.AccountListID == amountforchecking.ToAccountID).FirstOrDefault(); var TransferDetails = db.AccountListVsAmountTransfer.Where(s => s.AccountListVsAmountTransferID == amountforchecking.TransferID).FirstOrDefault(); if (TransferDetails.Amount >= amountforchecking.TransferAmount) { if (CheckToAccount.InitialBalance >= amountforchecking.TransferAmount) { return(Json(new { InsufficientBalance = false }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { InsufficientBalance = true }, JsonRequestBehavior.AllowGet)); } } else if (TransferDetails.Amount <= amountforchecking.TransferAmount) { if (CheckFromAccount.InitialBalance >= amountforchecking.TransferAmount) { return(Json(new { InsufficientBalance = false }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { InsufficientBalance = true }, JsonRequestBehavior.AllowGet)); } } else { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } }
public ActionResult InsertAmountCheck(AmountCheck amountforchecking) { var CheckAccount = db.AccountList.Where(s => s.AccountListID == amountforchecking.FromAccountID).FirstOrDefault(); if (CheckAccount.InitialBalance >= amountforchecking.TransferAmount) { return(Json(new { InsufficientBalance = false }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { InsufficientBalance = true }, JsonRequestBehavior.AllowGet)); } }