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")); } }
public IActionResult Edit(Offender offender) { if (ModelState.IsValid) { var result = offenderOps.GetById(offender.OffenderID); result.HomeAddress = offender.HomeAddress; result.Name = offender.Name; result.Surname = offender.Surname; result.StatusID = offender.StatusID; offenderOps.Update(result); } return(RedirectToAction("Index")); }