public ActionResult MemberPayment(Payment payment) { if (!ModelState.IsValid) { return(View("Error")); } PaymentDao paymentDao = new PaymentDao(); try { paymentDao.InsertMemberPayments(payment); ViewBag.Message = "Thank you for payment " + payment.MemberName; } catch (Exception e) { ViewBag.Message = e.Message; return(View("Error")); } return(View("PaymentHistory")); }