public IActionResult Index(int id) { // if the id has been provided then it should get the offender by the ID List <Offender> result = new List <Offender>(); result.Add(offenderOps.GetById(id)); return(View(result)); }
public IActionResult ApprovePayment(FinePayment _fine) { var _fineP = finepay.GetById(_fine.FinePaymentID); if (_fineP.FinePaymentStatusID != 2) { var _fi = fineOps.GetById(_fineP.FineID); var _case = caseOps.GetById(_fi.CaseID); var _offender = offenderOps.GetById(_fi.OffenderID); _fineP.FinePaymentStatusID = 2; _fi.FineStatusID = 2; _case.CaseStatusID = 2; _offender.StatusID = 2; finepay.Update(_fineP); fineOps.Update(_fi); caseOps.Update(_case); offenderOps.Update(_offender); ViewBag.Message = "Fine Payment Approved successfuly"; ViewBag.MessageType = "Warining"; return(RedirectToAction("ViewFinePayment")); } else { ViewBag.Message = "Fine Payment Already Approved"; ViewBag.MessageType = "Warining"; return(RedirectToAction("ViewFinePayment")); } }