Esempio n. 1
0
        public int LoanTrans(Loan_Transcation_Entites lt)
        {
            db = new MphasisBankEntities();
            var r = db.LoanAccounts.Where(t => t.LnAccountid == lt.LnAccountid);

            if (r.Count() > 0)
            {
                foreach (var item in r)
                {
                    lt.Outstanding = item.lnAmount - lt.Amount;
                }
                LoanTranscation l = new LoanTranscation()
                {
                    LnAccountid = lt.LnAccountid,
                    Emidate     = DateTime.Today,
                    Amount      = lt.Amount,
                    Outstanding = lt.Outstanding
                };
                db.LoanTranscations.Add(l);
                db.SaveChanges();
                return(1);
            }
            else
            {
                return(0);
            }
        }
 public ActionResult LoanTrans(Loan_Transcation_Entites le)
 {
     if (Session["user"] != null)
     {
         LoanBL lb  = new LoanBL();
         int    res = lb.LoanTrans(le);
         if (res > 0)
         {
             ViewData["a"] = "Paid Emi Sucessfull";
         }
         else
         {
             ViewData["a"] = "INValid CustomerDetails";
         }
         return(View());
     }
     else
     {
         return(RedirectToAction("Login"));
     }
 }
Esempio n. 3
0
 public int LoanTrans(Loan_Transcation_Entites lt)
 {
     return(ld.LoanTrans(lt));
 }