public ActionResult Details(int?id) { @ViewBag.ServiceEndGrantRequestVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "ServiceEndGrantRequest", "ModuleName"); // Details Of Products if (id == null) { return(RedirectToAction("Index")); } Db db = new Db(DbServices.ConnectionString); // Product ProductVwViewModel productVwViewModel = new ProductVwViewModel(); productVwViewModel.Instance = ProductVwServices.GetChildren(id.Value, db); if (productVwViewModel.Instance == null) { return(HttpNotFound()); } productVwViewModel.RequestVwViewModel.Instance = RequestVwServices.Get(id.Value); productVwViewModel.RequestVwViewModel.GrantRequestVwViewModel.Instance = GrantRequestVwServices.Get(id.Value); productVwViewModel.RequestVwViewModel.GrantRequestVwViewModel.ServiceEndGrantRequestVwViewModel.Instance = ServiceEndGrantRequestVwServices.Get(id.Value); return(View(productVwViewModel)); }
/// <summary> /// Returns a list of RequestVw objects /// </summary> /// <returns></returns> public ActionResult Index(RequestVwViewModel Model) { Db db = new Db(DbServices.ConnectionString); ViewBag.ProductTypeList = new SelectList(LoanTypeVwServices.List(db), "ProductTypeId", "ProductTypeName"); ViewBag.RequestStatusList = new SelectList(RequestStatusServices.List(db), "Id", "Name"); if (Model.Filter.HasCriteria) { Model.List = RequestVwServices.Get(Model.Filter, db); } else { Model.List = new List <RequestVw>(); } return(View(Model)); }
public ActionResult Details(int?id) { ViewBag.TitleGuarantor = TitleGuarantor; ViewBag.TitleExceptionalAount = TitleExceptionalAount; // Details Of Products if (id == null) { //return new HttpStatusCodeResult(HttpStatusCode.BadRequest); return(RedirectToAction("Index")); } Db db = new Db(DbServices.ConnectionString); ProductVwViewModel productVwViewModel = new ProductVwViewModel(); productVwViewModel.Instance = ProductVwServices.GetChildren(id.Value, db); if (productVwViewModel.Instance == null) { return(HttpNotFound()); } productVwViewModel.RequestVwViewModel.Instance = RequestVwServices.Get(id.Value); productVwViewModel.RequestVwViewModel.LoanRequestVwViewModel.Instance = LoanRequestVwServices.Get(id.Value); productVwViewModel.RefundableProductVwViewModel.Instance = RefundableProductVwServices.Get(id.Value); List <GuarantorVw> Guarantors = GuarantorVwServices.GetByRefundableProductProductId(id.Value); productVwViewModel.RefundableProductVwViewModel.GuarantorVwViewModel.List = Guarantors; //productVwViewModel.RefundableProductVwViewModel.GuarantorVwViewModel.Instance.GuarantorStatementVw=GuarantorStatementVwServices. productVwViewModel.RequestVwViewModel.LoanRequestVwViewModel.ExceptionalAmountVwViewModel.List = ExceptionalAmountVwServices.GetByLoanRequestRequestProductId(id.Value); List <ExceptionalAmountVw> NetDeduction = ExceptionalAmountVwServices.GetByLoanRequestRequestProductId(id.Value).Where(c => c.ExceptionalAmountTypeId == (int)ExceptionalAmountTypeEnum.NetDeduction).ToList(); List <ExceptionalAmountVw> ExceptionalIncome = ExceptionalAmountVwServices.GetByLoanRequestRequestProductId(id.Value).Where(c => c.ExceptionalAmountTypeId == (int)ExceptionalAmountTypeEnum.ExceptionalIncome).ToList(); List <ExceptionalAmountVw> ExceptionalDeduction = ExceptionalAmountVwServices.GetByLoanRequestRequestProductId(id.Value).Where(c => c.ExceptionalAmountTypeId == (int)ExceptionalAmountTypeEnum.ExceptionalDeduction).ToList(); ViewBag.NetDeduction = NetDeduction; ViewBag.ExceptionalIncome = ExceptionalIncome; ViewBag.ExceptionalDeduction = ExceptionalDeduction; return(PartialView(productVwViewModel)); }
public ActionResult Details(int?id) { ViewBag.TitleGuarantor = TitleGuarantor; ViewBag.TitleExceptionalAount = TitleExceptionalAount; ViewBag.ExceptionalIncome = exceptionalIncome; ViewBag.ExceptionalDeduction = exceptionalDeduction; ViewBag.NetDeduction = netDeduction; // Details Of Products if (id == null) { return(RedirectToAction("Index")); } Db db = new Db(DbServices.ConnectionString); // Product ProductVwViewModel productVwViewModel = new ProductVwViewModel(); productVwViewModel.Instance = ProductVwServices.GetChildren(id.Value, db); if (productVwViewModel.Instance == null) { return(HttpNotFound()); } productVwViewModel.RequestVwViewModel.Instance = RequestVwServices.Get(id.Value); productVwViewModel.RequestVwViewModel.LoanRequestVwViewModel.Instance = LoanRequestVwServices.Get(id.Value); productVwViewModel.RefundableProductVwViewModel.Instance = RefundableProductVwServices.Get(id.Value); List <GuarantorVw> Guarantors = GuarantorVwServices.GetByRefundableProductProductId(id.Value); productVwViewModel.RefundableProductVwViewModel.GuarantorVwViewModel.List = Guarantors; productVwViewModel.RequestVwViewModel.LoanRequestVwViewModel.ExceptionalAmountVwViewModel.List = ExceptionalAmountVwServices.GetByLoanRequestRequestProductId(id.Value); List <ExceptionalAmountVw> NetDeduction = ExceptionalAmountVwServices.GetByLoanRequestRequestProductId(id.Value).Where(c => c.ExceptionalAmountTypeId == (int)ExceptionalAmountTypeEnum.NetDeduction).ToList(); List <ExceptionalAmountVw> ExceptionalIncome = ExceptionalAmountVwServices.GetByLoanRequestRequestProductId(id.Value).Where(c => c.ExceptionalAmountTypeId == (int)ExceptionalAmountTypeEnum.ExceptionalIncome).ToList(); List <ExceptionalAmountVw> ExceptionalDeduction = ExceptionalAmountVwServices.GetByLoanRequestRequestProductId(id.Value).Where(c => c.ExceptionalAmountTypeId == (int)ExceptionalAmountTypeEnum.ExceptionalDeduction).ToList(); ViewBag.NetDeductionList = NetDeduction; ViewBag.ExceptionalIncomeList = ExceptionalIncome; ViewBag.ExceptionalDeductionList = ExceptionalDeduction; // Calculate Solvency and Boundries EmployeeProductCalculatorFilter f = new EmployeeProductCalculatorFilter() { EmployeeId = productVwViewModel.Instance.EmployeeId, ProductTypeId = productVwViewModel.Instance.ProductTypeId, Amount = productVwViewModel.RequestVwViewModel.Instance.Amount, Period = productVwViewModel.RefundableProductVwViewModel.Instance.PaymentPeriod }; EmployeeProductCalculatorResult result = db.EmployeeProductCalculatorFirstOrDefault(f); if (result != null) { GetEmployeeSolvencyFilter filter = new GetEmployeeSolvencyFilter() { EmployeeId = productVwViewModel.Instance.EmployeeId, Amount = productVwViewModel.RequestVwViewModel.Instance.Amount, Date = System.DateTime.Now, Installment = result.Installment, GrossSalary = productVwViewModel.RequestVwViewModel.LoanRequestVwViewModel.Instance.NetIncome, NetSalary = productVwViewModel.RequestVwViewModel.LoanRequestVwViewModel.Instance.NetIncome }; GetEmployeeSolvencyResult solvencyResult = db.GetEmployeeSolvencyFirstOrDefault(filter); ViewBag.Calculator = result; ViewBag.Solvency = solvencyResult; } return(View(productVwViewModel)); }