/// <summary> /// /// </summary> public void Dispose() { if (_investmentRepository != null) { _investmentRepository = null; } }
//const int RecordsPerPage = 10; // GET: Investment //public ActionResult Index() //{ // InvestmentSearchViewModel model = new InvestmentSearchViewModel(); // List<InvestmentViewModel> investments = InvestmentRepository.GetInvestments(); // var pageIndex = model.Page ?? 1; // model.SearchResults = investments.ToPagedList(pageIndex, RecordsPerPage); // return View(model); //} public ActionResult Index(InvestmentSearchViewModel model) { //List<InvestmentViewModel> investments = InvestmentRepository.GetInvestments(model); //var pageIndex = model.Page ?? 1; model.SearchResults = InvestmentRepository.GetInvestments(model); return(View(model)); }
// GET: Investment/Edit/5 public ActionResult Edit(Guid id) { var investment = InvestmentRepository.GetInvestment(id); if (investment.CapitalDetails == null || investment.CapitalDetails.Count == 0) { investment.CapitalDetails = new List <CapitalDetail>(); investment.CapitalDetails.Add(new CapitalDetail { Description = "Cash" }); investment.CapitalDetails.Add(new CapitalDetail { Description = "Machinery" }); investment.CapitalDetails.Add(new CapitalDetail { Description = "Land Rental" }); investment.CapitalDetails.Add(new CapitalDetail { Description = "Utilities & Infrastructure" }); investment.CapitalDetails.Add(new CapitalDetail { Description = "Building" }); investment.CapitalDetails.Add(new CapitalDetail { Description = "Raw Material" }); } investment.CapitalDetails = investment.CapitalDetails.OrderBy(cd => cd.Description).ToList(); return(View(investment)); }
public UnitOfWork(ApplicationDbContext context) { _context = context; Investment = new InvestmentRepository(context); BankAccount = new BankAccountRepository(context); Company = new CompanyRepository(context); Transaction = new TransactionRepository(context); }
public async Task QuandoRealizoUmaOeracaoFinanceiraDeReais(string value) { Investment investment = new Investment() { User = "******", InvestimentValue = value }; this.investmentModel = await InvestmentRepository.MakeInvestment(investment); }
public InvestmentController(InvestmentRepository investmentRepository, CashOrderRepository orderRepository, CashOrderNumberCounterRepository counterRepository, BranchContext branchContext, ISessionContext sessionContext) { _investementRepository = investmentRepository; _orderRepository = orderRepository; _counterRepository = counterRepository; _branchContext = branchContext; _sessionContext = sessionContext; }
public ActionResult Create(InvestmentViewModel investment) { try { InvestmentRepository.InsertInvestment(investment, User.Identity.Name); return(RedirectToAction("Index")); } catch (Exception ex) { //throw ex; return(View(investment)); } }
public ActionResult Delete(Guid id, Investment investment) { try { // TODO: Add delete logic here InvestmentRepository.DeleteInvestment(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(InvestmentViewModel investment) { try { // TODO: Add update logic here InvestmentRepository.UpdateInvestment(investment, User.Identity.Name); return(RedirectToAction("Index")); } catch (Exception ex) { throw ex; return(View(investment)); } }
public AccountWindowViewModel(IServiceProvider serviceProvider, TransferBroker broker, BankAccountRepository bankRepo, UserRepository userRepo, InvestmentRepository investRepo, LoanRepository loanRepo) { this.broker = broker; this.serviceProvider = serviceProvider; this.bankRepo = bankRepo; this.userRepo = userRepo; this.investRepo = investRepo; this.loanRepo = loanRepo; broker.TransferStarted += Broker_TransferStarted; broker.TimePassed += Broker_TimePassed; broker.Update += Broker_Update; Loans = new ObservableCollection <LoanViewModel>(); Investments = new ObservableCollection <InvestmentViewModel>(); LoggedUsers = new ObservableCollection <User>(); InitializeCommands(); }
/// <summary> /// /// </summary> public InvestmentService() { _investmentRepository = new InvestmentRepository(); }
/// <summary> /// /// </summary> /// <param name="investmentRepository"></param> public InvestmentService(InvestmentRepository investmentRepository) { _investmentRepository = investmentRepository; }
// GET: Investment/Details/5 public ActionResult Details(Guid id) { InvestmentViewModel investment = InvestmentRepository.GetInvestment(id); return(View(investment)); }
// GET: Investment/Delete/5 public ActionResult Delete(Guid id) { var investment = InvestmentRepository.GetInvestment(id); return(View(investment)); }