public ActionResult Details(int idDisbursement) { Disbursement disbursement = _disbursementDAO.GetDisbursement(idDisbursement); ViewBag.disbursement = disbursement; if (disbursement != null) { ViewBag.status = disbursement.Status; ViewBag.department = disbursement.Department; ViewBag.collectionPt = disbursement.CollectionPoint; ViewBag.collectedBy = disbursement.CollectedBy; if (disbursement.DisbursedBy == null) { ViewBag.disbursedBy = _collectionPointDAO.FindClerkByCollectionPointId(disbursement.CollectionPoint.IdCollectionPt); } else { ViewBag.disbursedBy = disbursement.DisbursedBy; } ViewBag.storeClerk = _collectionPointDAO.FindClerkByCollectionPointId(disbursement.CollectionPoint.IdCollectionPt); ViewBag.disbursementItems = disbursement.DisbursementItems; } else { ViewBag.disbursement = new Disbursement(); } return(View()); }
// GET: Disbursement public ActionResult Index(string depId) { List <Department> deps = DepartmentDAO.GetDepartmentsToDisburse(); ViewBag.depIdList = new SelectList(deps, nameof(Department.departmentId), nameof(Department.departmentName), depId); List <DisbursementViewModel> model = new List <DisbursementViewModel>(); if (depId != null) { model = DisbursementDAO.GetDisbursement(depId); ViewBag.depInfo = DepartmentDAO.GetDepartmentInfo(depId); } return(View(model)); }
public List <DisbursementViewModel> GetDisbursement(string departmentId) { List <DisbursementViewModel> myModels = DisbursementDAO.GetDisbursement(departmentId); return(myModels); }