}
public ModelAndView updatePartialPay(HttpServletRequest request, HttpServletResponse response)throws Exception
{
float newAmount = Float.parseFloat(request.getParameter("newAmount"));
long id=Long.parseLong(request.getParameter("partialPayId"));
PartialPayment partialPay = new PartialPayment();
partialPay= partialPaymentDAO.selectById(id);
if(partialPay.getAmount()> newAmount)
partialPay.setAmount(partialPay.getAmount()-newAmount);
partialPaymentDAO.addDetails(partialPay);
if(partialPay.getAmount()== newAmount)
partialPaymentDAO.deletePartialPay(id);
if(request.getSession().getAttribute("from").equals("main"))
return new ModelAndView("redirect:listPartialPay.htm");
return new ModelAndView("redirect:searchPartialPay.htm?studentId="+request.getSession().getAttribute("from"));
}