public ActionResult AddDeals(int id) { DealRepository repository = new DealRepository(); ModelState.Clear(); ViewBag.AuctionId = id; return(View(repository.GetForAuction(id))); }
// GET: AuctionManage/Edit/5 public ActionResult Start(int id) { DealRepository dealRepository = new DealRepository(); ParticipantRepository participantRepository = new ParticipantRepository(); ItemRepository itemRepository = new ItemRepository(); IEnumerable <DealModel> dealsForAuction = dealRepository.GetForAuction(id); StartViewModel startViewModel = new StartViewModel { deals = dealsForAuction, participants = participantRepository.GetAll() }; ModelState.Clear(); ViewBag.AuctionId = id; if (dealsForAuction.Count() > 0) { ItemModel firstDealItem = itemRepository.GetById(startViewModel.deals.ElementAt(0).Item_Id); ViewBag.startPrice = firstDealItem.StartedPrice; ViewBag.dealStep = firstDealItem.PriceGrowth; } return(View(startViewModel)); }