コード例 #1
0
ファイル: LoanController.cs プロジェクト: sandieng/LRDII
        public IActionResult EditR(LoanRepaymentTransactionModel loanRepaymentTransaction)
        {
            if (!ModelState.IsValid)
            {
                return(View(loanRepaymentTransaction));
            }

            if (_memberService.GetById(loanRepaymentTransaction.NomorAnggota) == null)
            {
                ModelState.AddModelError("NomorAnggota", "Nomor anggota tidak ada");
            }

            if (_loanService.GetById(loanRepaymentTransaction.NomorPinjaman) == null)
            {
                ModelState.AddModelError("NomorPinjaman", "Nomor pinjaman tidak ada");
            }

            if (ModelState.ErrorCount > 0)
            {
                return(View(loanRepaymentTransaction));
            }

            _loanRepaymentService.Update(loanRepaymentTransaction);

            return(RedirectToAction("EditRepayment"));
        }
コード例 #2
0
ファイル: LoanController.cs プロジェクト: sandieng/LRDII
        public IActionResult EditRepayment(LoanRepaymentTransactionModel loanRepaymentTransaction)
        {
            //return RedirectToAction("EditR", new { id = loanRepaymentTransaction.NomorPembayaranPinjaman });
            var loanRepayment = _loanRepaymentService.GetById(loanRepaymentTransaction.NomorPembayaranPinjaman);

            if (loanRepayment == null)
            {
                ModelState.AddModelError("NomorPembayaranPinjaman", "Nomor pembayaran pinjaman tidak ada");
                return(View("EditRepayment"));
            }

            return(RedirectToAction("EditR", new { id = loanRepaymentTransaction.NomorPembayaranPinjaman }));
        }
コード例 #3
0
 public void Update(LoanRepaymentTransactionModel loanRepaymentTransaction)
 {
     _repository.Update(loanRepaymentTransaction);
 }
コード例 #4
0
 public void Save(LoanRepaymentTransactionModel loanRepaymentTransaction)
 {
     _repository.Save(loanRepaymentTransaction);
 }
コード例 #5
0
 public void Delete(LoanRepaymentTransactionModel loanRepaymentTransaction)
 {
     _repository.Delete(loanRepaymentTransaction);
 }