示例#1
0
        public ActionResult Details(int?id)
        {
            db_lendingEntities db = new db_lendingEntities();

            if (Session["UserId"] != null)
            {
                if (id == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }
                tbl_loan_processing tbl_loan_processing = db.tbl_loan_processing.Find(id);
                if (tbl_loan_processing == null)
                {
                    return(HttpNotFound());
                }

                ViewBag.Form       = "Loan Processing";
                ViewBag.Controller = "Loan Processing";
                ViewBag.Action     = "Details";

                LoadCustomer();
                LoadLoanType();
                return(View(tbl_loan_processing));
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
            }
        }
示例#2
0
        public JsonResult Create(tbl_loan_processing model)
        {
            try
            {
                db_lendingEntities db = new db_lendingEntities();

                tbl_loan_processing tbl = new tbl_loan_processing();

                tbl.customer_id        = model.customer_id;
                tbl.customer_name      = model.customer_name;
                tbl.loan_no            = model.loan_no;
                tbl.loantype_id        = model.loantype_id;
                tbl.loan_name          = model.loan_name;
                tbl.loan_granted       = model.loan_granted;
                tbl.loan_interest_rate = model.loan_interest_rate;
                tbl.payment_scheme     = model.payment_scheme;
                tbl.due_date           = model.due_date;
                tbl.loan_date          = model.loan_date;
                tbl.installment_no     = model.installment_no;
                tbl.total_receivable   = model.total_receivable;
                tbl.net_proceeds       = model.net_proceeds;
                tbl.amortization_id    = model.amortization_id;
                tbl.finance_charge_id  = model.finance_charge_id;
                tbl.status             = model.status;
                tbl.prepared_by_id     = model.prepared_by_id;
                tbl.prepared_by_name   = model.prepared_by_name;
                tbl.reviewed_by_id     = model.reviewed_by_id;
                tbl.reviewed_by_name   = model.reviewed_by_name;
                tbl.approved_by_id     = model.approved_by_id;
                tbl.approved_by_name   = model.approved_by_name;
                tbl.date_created       = DateTime.Now;
                tbl.created_by         = Session["UserName"].ToString();

                db.tbl_loan_processing.Add(tbl);

                db.SaveChanges();

                return(Json("Success", JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json("Failed", JsonRequestBehavior.DenyGet));

                throw ex;
            }
        }