Esempio n. 1
0
 /// <summary>
 ///
 /// </summary>
 public void Dispose()
 {
     if (_investmentRepository != null)
     {
         _investmentRepository = null;
     }
 }
Esempio n. 2
0
        //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));
        }
Esempio n. 3
0
        // 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));
        }
Esempio n. 4
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context    = context;
     Investment  = new InvestmentRepository(context);
     BankAccount = new BankAccountRepository(context);
     Company     = new CompanyRepository(context);
     Transaction = new TransactionRepository(context);
 }
Esempio n. 5
0
        public async Task QuandoRealizoUmaOeracaoFinanceiraDeReais(string value)
        {
            Investment investment = new Investment()
            {
                User             = "******",
                InvestimentValue = value
            };

            this.investmentModel = await InvestmentRepository.MakeInvestment(investment);
        }
Esempio n. 6
0
 public InvestmentController(InvestmentRepository investmentRepository,
                             CashOrderRepository orderRepository,
                             CashOrderNumberCounterRepository counterRepository,
                             BranchContext branchContext,
                             ISessionContext sessionContext)
 {
     _investementRepository = investmentRepository;
     _orderRepository       = orderRepository;
     _counterRepository     = counterRepository;
     _branchContext         = branchContext;
     _sessionContext        = sessionContext;
 }
Esempio n. 7
0
 public ActionResult Create(InvestmentViewModel investment)
 {
     try
     {
         InvestmentRepository.InsertInvestment(investment, User.Identity.Name);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         //throw ex;
         return(View(investment));
     }
 }
Esempio n. 8
0
 public ActionResult Delete(Guid id, Investment investment)
 {
     try
     {
         // TODO: Add delete logic here
         InvestmentRepository.DeleteInvestment(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 9
0
 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));
     }
 }
Esempio n. 10
0
 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();
 }
Esempio n. 11
0
 /// <summary>
 ///
 /// </summary>
 public InvestmentService()
 {
     _investmentRepository = new InvestmentRepository();
 }
Esempio n. 12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="investmentRepository"></param>
 public InvestmentService(InvestmentRepository investmentRepository)
 {
     _investmentRepository = investmentRepository;
 }
Esempio n. 13
0
        // GET: Investment/Details/5
        public ActionResult Details(Guid id)
        {
            InvestmentViewModel investment = InvestmentRepository.GetInvestment(id);

            return(View(investment));
        }
Esempio n. 14
0
        // GET: Investment/Delete/5
        public ActionResult Delete(Guid id)
        {
            var investment = InvestmentRepository.GetInvestment(id);

            return(View(investment));
        }