public ActionResult CreateAuction() { AuctionSetUpModel aSU = new AuctionSetUpModel(); //Get categories from database. List <SelectListItem> selectList = GetCategoriesAndConvertToSelectListItem(); aSU.Categories = new SelectList(selectList, "Value", "Text"); return(View(aSU)); }
public CreateAuction ConvertFromAuctionSetUpToCreateAuction(AuctionSetUpModel aSU, string userName) { CreateAuction cA = new CreateAuction { UserName = userName, StartPrice = aSU.StartPrice, BuyOutPrice = aSU.BuyOutPrice, BidInterval = aSU.BidInterval, Description = aSU.Description, EndDate = aSU.EndDate, Category = aSU.SelectedCategory }; return(cA); }