public ActionResult History(string searchContext = "") { //Testing Hardcode //int idEmployee = 4; int idEmployee = (int)Session["IdEmployee"]; Employee employee = _employeeDAO.FindEmployeeById(idEmployee); //List<Disbursement> disbursements = _disbursementDAO.GetReceivedDisbursements(employee.CodeDepartment, searchContext); List <Disbursement> disbursements = _disbursementDAO.GetReceivedAndDisbursedDisbursements(employee.CodeDepartment, searchContext); ViewBag.disbursements = disbursements; List <Disbursement> disbursementsReceived = _disbursementDAO.GetReceivedDisbursements(employee.CodeDepartment, searchContext); Disbursement disbursement; if (disbursementsReceived.Count != 0) { disbursement = disbursementsReceived[0]; ViewBag.disbursedBy = _collectionPointDAO.FindClerkByCollectionPointId(disbursement.CollectionPoint.IdCollectionPt); } else { ViewBag.disbursedBy = null; } ViewBag.searchContext = searchContext; return(View()); }