public ActionResult GetClientProperties([DataSourceRequest] DataSourceRequest request, int?clientId) { Contract.Requires <ArgumentNullException>(request.IsNotNull()); int resolvedClientId = this.ResolveClientId(clientId); PropertiesViewModel model = this.clientProfileManager.GetPropertiesViewModel(resolvedClientId); PropertyViewModel[] properies = model.Properties.ToArray(); return(Json(properies.ToDataSourceResult(request), JsonRequestBehavior.AllowGet)); }
public ActionResult GetApprovalRequests([DataSourceRequest] DataSourceRequest request) { Contract.Requires <ArgumentNullException>(request.IsNotNull()); var requests = this.loanRequestsService.GetRequestsForApproval(this._userContext); var items = requests.Select(x => new ApprovalRequestViewModel { Amount = x.Amount, FirstName = x.Client.FirstName, LastName = x.Client.LastName, Id = x.Id, LoanProductName = x.LoanProduct.Name, ClientId = x.Client.Id }); return(this.Json(items.ToDataSourceResult(request), JsonRequestBehavior.AllowGet)); }
private ActionResult GetCredits(DataSourceRequest request, LoanProductStatus?filterStatus = null) { Contract.Requires <ArgumentNullException>(request.IsNotNull()); var loanProducts = this._creditService.GetAvailableLoanProductsForShow(); if (filterStatus != null) { loanProducts = loanProducts.Where(x => x.Status == filterStatus); } var result = loanProducts.Select(x => new AvailableCreditViewModel { MinAmount = x.MinAmount, MaxAmount = x.MaxAmount, MaxPeriodInMonth = x.MaxPeriodInMonth, MinPeriodInMonth = x.MinPeriodInMonth, Name = x.Name, Percentage = x.Percentage, Id = x.Id, Description = x.Description }); return(this.Json(result.ToDataSourceResult(request), JsonRequestBehavior.AllowGet)); }