public ActionResult FinancialLoanEdit(FormCollection form) { if (!string.IsNullOrEmpty(Session["username"] as string)) { try { List <FinancialLoan> lst = new List <FinancialLoan>(); for (int i = 1; i <= 10; i++) { FinancialLoan obj = new FinancialLoan(); obj.date = form["date"]; obj.Lender = form["Lender" + i]; obj.Loanbalance = form["Loanbalance" + i]; obj.Rate = form["Rate" + i]; obj.Term = form["Term" + i]; obj.Expiryterm = form["Expiryterm" + i]; obj.Phase = string.Empty; lst.Add(obj); } FinanacialLoanDataMonthly ld = new FinanacialLoanDataMonthly(); ld.UpdateFinancialLoan(lst); return(RedirectToAction("Index")); } catch (Exception ex) { return(View("Error", ex)); } } else { return(RedirectToAction("Index", "Login")); } }
public string Print() { FinanacialLoanDataMonthly fld = new FinanacialLoanDataMonthly(); List <FinancialLoan> lst = fld.GetFinancialLoanData(); return(new PageOrientations().RenderRazorViewToString(this, "Print", lst)); }
public ActionResult FinancialLoanEdit() { if (!string.IsNullOrEmpty(Session["username"] as string)) { if (Session["roleid"].ToString() == "1" || Session["roleid"].ToString() == "9") { try { FinanacialLoanDataMonthly fld = new FinanacialLoanDataMonthly(); List <FinancialLoan> lst = fld.GetFinancialLoanData(); return(View(lst)); } catch (Exception ex) { return(View("Error", ex)); } } else { return(View("Accessdenied")); } } else { return(RedirectToAction("Index", "Login")); } }