public ActionResult Home() { //Testing Hardcode //int idEmployee = 4; int idEmployee = (int)Session["IdEmployee"]; Employee employee = _employeeDAO.FindEmployeeById(idEmployee); Disbursement disbursement = _disbursementDAO.GetScheduledDisbursement(employee.CodeDepartment); List <CollectionPoint> collectionPoints = _collectionPointDAO.FindAll(); ViewBag.disbursement = disbursement; if (disbursement != null) { ViewBag.status = disbursement.Status; ViewBag.department = disbursement.Department; ViewBag.collectionPt = disbursement.CollectionPoint; //get the storeclerk from cpclerk ViewBag.storeClerk = _collectionPointDAO.FindClerkByCollectionPointId(disbursement.CollectionPoint.IdCollectionPt); ViewBag.disbursementItems = disbursement.DisbursementItems; } else { ViewBag.disbursement = new Disbursement(); ViewBag.status = new Status(); ViewBag.department = new Department(); ViewBag.collectionPt = new CollectionPoint(); ViewBag.storeClerk = new Employee(); ViewBag.disbursementItems = new DisbursementItem(); } ViewBag.allCollectionPoints = collectionPoints; ViewData["Rep"] = employee; return(View()); }