Ejemplo n.º 1
0
        public void checkedAuctions(AuctionViewModel AVM)
        {
            foreach (AuctionEventModel AEM in AVM.runningAuctions)
            {
                // AuctionProccessor.ChangeStatus();
                long aucTime = AuctionProccessor.ConvertToMiliSeconds(AEM.EndTime); //AEM.EndTime;
                long nowTIme = DateTime.Now.Ticks;

                Debug.WriteLine("aucTime = " + aucTime + " && nowTime = " + nowTIme);
                Console.WriteLine("aucTime = " + aucTime + " && nowTime = " + nowTIme);
                System.Diagnostics.Debug.WriteLine("aucTime = " + aucTime + " && nowTime = " + nowTIme);

                if (aucTime > nowTIme)
                {
                    AuctionProccessor.ChangeStatus(AEM.AuctionID, "FINISHED");
                }
            }

            foreach (AuctionEventModel AEM in AVM.upcommingAuctions)
            {
                // AuctionProccessor.ChangeStatus();
                long aucTime = AuctionProccessor.ConvertToMiliSeconds(AEM.StartTime);
                long nowTIme = DateTime.Now.Ticks;
                if (aucTime >= nowTIme)
                {
                    AuctionProccessor.ChangeStatus(AEM.AuctionID, "RUNNING");
                }
            }
        }
Ejemplo n.º 2
0
        public ActionResult Bid(int PID, int BID)
        {
            List <ProductModel> PM = AuctionProccessor.GetProductsByPID(PID);

            if (PM[0].CurrentBid <= BID && DateTime.Now.Ticks < AuctionProccessor.ConvertToMiliSeconds(PM[0].EndTime))
            {
                MakeBid(PID, BID);
            }

            return(Redirect("/Auction/SingleAuction?AID=" + Session["AUCTION_ID"]));
        }