//GetAuctionDetail public AuctionDetail GetAuctionDetail(long auction_id, long currentevent_id, bool iscaching) { var dco = new DataCacheObject(DataCacheType.RESOURCE, DataCacheRegions.AUCTIONS, "GETAUCTIONDETAIL", new object[] { auction_id, currentevent_id }, CachingExpirationTime.Minutes_30); var ad = CacheRepository.Get(dco) as AuctionDetail; if (ad != null && iscaching) { return(ad); } dataContext.CommandTimeout = 600000; ad = (from p in dataContext.spAuction_View_Detail(auction_id) select new AuctionDetail { Lot = p.Lot, Title = p.Title, IsPulledOut = p.IsPulledOut, Description = p.Description, Addendum = p.Addendum, Status = (Consts.AuctionStatus)p.Status.GetValueOrDefault(0), DefaultImage = p.PicturePath, IsCurrentEvent = p.IsCurrent || currentevent_id == p.Event_ID, DateStart = p.StartDate, DateEnd = p.EndDate, EventDateStart = p.EventStartDate, EventDateEnd = p.EventEndDate, CloseStep = p.CloseStep, Owner_ID = p.Owner_ID, Price = p.Price, Estimate = p.Estimate, LinkParams = new LinkParams { ID = p.Auction_ID, Lot = p.Lot, Title = p.Title, EventTitle = p.EventTitle, MainCategoryTitle = p.MainCategoryTitle, CategoryTitle = p.CategoryTitle, Event_ID = p.Event_ID, EventCategory_ID = p.EventCategory_ID, MainCategory_ID = p.MainCategory_ID, Category_ID = p.Category_ID }, PrevAuction = (p.PrevAuction_ID.HasValue) ? new LinkParams { ID = p.PrevAuction_ID.Value, EventTitle = p.EventTitle, MainCategoryTitle = p.PrevMainCategoryTitle, CategoryTitle = p.PrevCategoryTitle, Lot = p.PrevLot.GetValueOrDefault(0), Title = p.PrevTitle } : null, NextAuction = (p.NextAuction_ID.HasValue) ? new LinkParams { ID = p.NextAuction_ID.Value, EventTitle = p.EventTitle, MainCategoryTitle = p.NextMainCategoryTitle, CategoryTitle = p.NextCategoryTitle, Lot = p.NextLot.GetValueOrDefault(0), Title = p.NextTitle } : null }).FirstOrDefault(); if (ad != null) { ad.Collections = (from ac in dataContext.AuctionCollections join c in dataContext.Collections on ac.CollectionID equals c.ID where ac.AuctionID == auction_id select new IdTitleDesc { ID = c.ID, Title = c.WebTitle, Description = c.Description }).ToList(); dco.Data = ad; CacheRepository.Add(dco); } return(ad); }