Beispiel #1
0
        public ActionResult Create(Auction auction)
        {
            AuctionService service = new AuctionService();

            service.AddAuction(auction);
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Save(AuctionCreateViewModel vm)
        {
            ServiceResult result = _auctionService.AddAuction(vm);

            if (result.Success)
            {
                return(RedirectToAction("SendRegistrationEmail", result));
            }
            return(RedirectToAction("Create"));
        }
        //"as" kan ikke bruges istedet for auctionService

        public bool AddAuction(DateTime timeLeft, bool payment, string result, DateTime paymentDate,
                               string productName, string productDescription)
        {
            Auction auction = new Auction {
                TimeLeft           = timeLeft,
                Payment            = payment,
                Result             = result,
                PaymentDate        = paymentDate,
                ProductName        = productName,
                ProductDescription = productDescription
            };

            AuctionService auctionService = new AuctionService();

            return(auctionService.AddAuction(auction));
        }