Exemplo n.º 1
0
        // GET: Options/Create/1

        public async Task <IActionResult> Create(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var trade = await _repo.GetTrade(id.Value);

            if (trade == null)
            {
                return(NotFound());
            }

            var optiontypes = await getOptionTypes();

            CreateTradeVM vm = new CreateTradeVM
            {
                Trade       = trade,
                OptionTypes = optiontypes,
                Option      = new Option()
            };

            vm.Option.Tradeid = trade.Tradeid;
            return(View(vm));
        }
Exemplo n.º 2
0
        // GET: Trades/Create
        public async Task <IActionResult> Create()
        {
            var ttypeList = await getTradeTypes();

            CreateTradeVM vm = new CreateTradeVM
            {
                Trade      = new Trade(),
                TradeTypes = ttypeList
            };

            return(View(vm));
        }
Exemplo n.º 3
0
        // GET: Options/Edit/1

        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var option = await _repo.GetOption(id.Value);

            if (option == null)
            {
                return(NotFound());
            }


            CreateTradeVM vm = new CreateTradeVM
            {
                OptionTypes = await getOptionTypes(),
                Option      = option
            };

            return(View(vm));
        }
Exemplo n.º 4
0
        // GET: Trades/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var trade = await _repo.GetTrade(id.Value);

            if (trade == null)
            {
                return(NotFound());
            }

            var options = await _repo.GetOptionDetail(id.Value);

            CreateTradeVM vm = new CreateTradeVM
            {
                Trade   = trade,
                Options = options
            };

            return(View(vm));
        }
Exemplo n.º 5
0
        // GET: Trades/Edit/5
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var trade = await _repo.GetTrade(id.Value);

            if (trade == null)
            {
                return(NotFound());
            }

            var ttypeList = await getTradeTypes();

            CreateTradeVM vm = new CreateTradeVM
            {
                Trade      = trade,
                TradeTypes = ttypeList
            };

            return(View(vm));
        }