Beispiel #1
0
        // GET: Holding/Create
        public async Task <ActionResult> Create()
        {
            var employeesList = await EmployeerLib.GetAllEmployees();

            var fundsList = await FundLib.GetAllFunds();

            ViewBag.EmployeeId = new SelectList(employeesList, "Id", "FullName");
            ViewBag.FundId     = new SelectList(fundsList, "Id", "Name");
            return(View());
        }
Beispiel #2
0
        // GET: Holding/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            var employeesList = await EmployeerLib.GetAllEmployees();

            var fundsList = await FundLib.GetAllFunds();

            var holding = await HoldingLib.GetHolding(id.ToString());

            if (holding == null)
            {
                var errorMsg = string.Format("Holding {0} not found.", id);
                throw new HttpException(404, errorMsg);
            }
            ViewBag.EmployeeId = new SelectList(employeesList, "Id", "FullName", holding.EmployeeId);
            ViewBag.FundId     = new SelectList(fundsList, "Id", "Name", holding.FundId);

            return(View(holding));
        }
Beispiel #3
0
        // GET: Funds
        public async Task <ActionResult> Index()
        {
            var funds = await FundLib.GetAllFunds();

            return(View(funds));
        }