public ActionResult Index(List <DisbursementViewModel> model) { List <Department> deps = DepartmentDAO.GetDepartmentsToDisburse(); ViewBag.depIdList = new SelectList(deps, nameof(Department.departmentId), nameof(Department.departmentName)); if (model != null && model.Count > 0) { if (model[0].departmentId != null) { ViewBag.depInfo = DepartmentDAO.GetDepartmentInfo(model[0].departmentId); } } if (!ModelState.IsValid) { return(View(model)); } bool bRes = DisbursementDAO.ConfirmDisbursement(model); //ModelState.Clear(); if (bRes) { return(RedirectToAction("Index")); } else { return(View("~/Views/Shared/Error.cshtml")); } }
public bool ConfirmDisbursement([FromBody] List <DisbursementViewModel> myModels) { bool bRes = DisbursementDAO.ConfirmDisbursement(myModels); return(bRes); }