public async Task <IActionResult> Index(SettingCMSModel settingCMSModel) { if (!settingCMSModel.HasError) { SettingCMSModel model = new SettingCMSModel(); //Anh DMDT model.HomepageCMSModel = _homepageCMSService.GetAll().FirstOrDefault(x => x.Category == "2"); if (model.HomepageCMSModel == null) { model.HomepageCMSModel = new HomepageCMSModel(); } //Trang chu model.HomepageCMSModel.HomepageModels = _homepageCMSService.GetAll(); model.GenericIntroducingSettingModel = _introducingSettingService.GetSetting(); model.ListMaintainingFee = GetMainTainingFees(model); model.ListWithdrawFee = await GetWithdrawFees(model); model.InvestmentTargetSettingModel.ListModels = await _investmentTargetCMSService.GetListInvestmentTargetSetting(); ViewBag.ListPortfolio = _portfolioService.GetAllPortfolio().ToList(); ViewBag.Data = _investmentTargetCMSService.GetAll().ToList(); if (model.GenericIntroducingSettingModel == null) { model.GenericIntroducingSettingModel = new GenericIntroducingSettingModel(); } model.ContactCMSModel = _contactConfigurationService.GetContactConfiguration(); ViewBag.ListFund = _fundService.GetAllFund().OrderBy(i => i.Code).ToList(); return(View(model)); } return(View(settingCMSModel)); }
public async Task <IActionResult> CompletedList(int pageSize = 0, int pageIndex = 0) { var size = pageSize > 0 ? pageSize : _configuration.GetValue <int>("PagingConfig:PageSize"); var page = pageIndex > 0 ? pageIndex : 1; var searchModel = new SearchTask() { Status = TransactionStatus.Success, Funds = _fundService.GetAllFund() }; ViewBag.SearchTaskModel = searchModel; var model = await _taskCompletedService.GetTasksCompleted(size, page, searchModel); model.PageIndex = page; model.PageSize = size; return(PartialView("Views/Task/CompletedList.cshtml", model)); }
public IActionResult Detail(int id) { try { var portfolio = _portfolioService.GetPortfolioById(id); if (portfolio == null) { throw new NotFoundException(); } var funds = _fundService.GetAllFund(); if (funds != null && funds.Any()) { foreach (var fund in funds) { var portfolioFundIndex = portfolio.PortfolioFunds.FindIndex(x => x.FundId == fund.Id); if (portfolioFundIndex < 0) { portfolio.PortfolioFunds.Add(new PortfolioFundModel { PortfolioId = portfolio.Id, FundId = fund.Id, Fund = fund }); } } } portfolio.PortfolioFunds.OrderBy(x => x.FundId).ToList(); return(View(portfolio)); } catch (System.Exception ex) { throw ex; } }