Beispiel #1
0
        public static List <TimedProductLot> FetchAllLots()
        {
            string                 fetchQuery      = "select * from [AuctionBidPlatform].[dbo].[View_timed_auction_lots]  where IsSold=0";
            DataTable              dt              = RunDatabaseScript(fetchQuery);
            TimedProductLot        TimedProductLot = new TimedProductLot();
            List <TimedProductLot> lots            = new List <TimedProductLot>();

            currentLotNo = Convert.ToString(dt.Rows[0]["LotId"]);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                var auctionDate = Convert.ToDateTime(dt.Rows[i]["AuctionDate"]).Date.ToString("dd/MM/yyyy");
                var auctionTime = Convert.ToDateTime(dt.Rows[i]["AuctionTime"]).TimeOfDay;
                lots.Add(new TimedProductLot
                {
                    LotId = Convert.ToInt32(dt.Rows[i]["LotId"]),
                    //LotImageUrl = "http://127.0.0.1:2520/fileupload/upload/" + dt.Rows[i]["ImageName"],
                    LotImageUrl         = "http://auctionbidplatform.com/fileupload/upload/" + dt.Rows[i]["ImageName"],
                    LotDesc             = Convert.ToString(dt.Rows[i]["LotDesc"]),
                    Title               = Convert.ToString(dt.Rows[i]["Title"]),
                    AuctionName         = Convert.ToString(dt.Rows[i]["AuctionName"]),
                    AuctionDate         = Convert.ToString(auctionDate),
                    AuctionTime         = Convert.ToString(auctionTime),
                    LowEstimatePrice    = Convert.ToString(dt.Rows[i]["LowEstimatePrice"]),
                    HighEstimatePrice   = Convert.ToString(dt.Rows[i]["HighEstimatePrice"]),
                    MaximumReserveValue = Convert.ToString(dt.Rows[i]["MaxReserveValue"]),
                    BuynowPrice         = Convert.ToString(dt.Rows[i]["BuynowPrice"]),
                });
            }
            return(lots);
        }
Beispiel #2
0
        public static List <TimedProductLot> SoldItem(string id)
        {
            userName = Convert.ToString(HttpContext.Current.Session["UserName"]).Trim();
            if (userName != null && userName != "")
            {
                //string query = "UPDATE dbo.TimedProductLot set IsSold = 1 WHERE LotId=" + id;
                //RunDatabaseScript(query);
                string                 fetchQuery      = "select * from [AuctionBidPlatform].[dbo].[View_list_item]  where IsSold=0";
                DataTable              dt              = RunDatabaseScript(fetchQuery);
                TimedProductLot        TimedProductLot = new TimedProductLot();
                List <TimedProductLot> lots            = new List <TimedProductLot>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    lots.Add(new TimedProductLot
                    {
                        LotId = Convert.ToInt32(dt.Rows[i]["LotId"]),
                        //LotImageUrl = "http://127.0.0.1:2520/fileupload/upload/" + dt.Rows[i]["LotImageName"],
                        LotImageUrl       = "http://auctionbidplatform.com/fileupload/upload/" + dt.Rows[i]["LotImageName"],
                        LotDesc           = Convert.ToString(dt.Rows[i]["LotDesc"]),
                        Title             = Convert.ToString(dt.Rows[i]["Title"]),
                        AuctionName       = Convert.ToString(dt.Rows[i]["AuctionName"]),
                        LowEstimatePrice  = Convert.ToString(dt.Rows[i]["LowEstimatePrice"]),
                        HighEstimatePrice = Convert.ToString(dt.Rows[i]["HighEstimatePrice"])
                    });
                }
                return(lots);
            }
            List <TimedProductLot> blanklot = new List <TimedProductLot>();

            blanklot.Add(new TimedProductLot
            {
                Title = "novalue",
            });
            return(blanklot);
        }