private void GetRequestQuote() { RequestQuoteRepository rightSectionRepository = new RequestQuoteRepository(); requestQuote = rightSectionRepository.GetRequestQuote(GeneralExtensions.GetQueryStringId()); rptquoteRequest.DataSource = requestQuote.GetQuoteRequest; rptquoteRequest.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string requestQuoteKey = "requestQuote"; if (HttpContext.Current.Cache[requestQuoteKey] == null) { RequestQuoteRepository rightSectionRepository = new RequestQuoteRepository(); long requestQuoteId = GeneralExtensions.GetQueryStringId(); if (requestQuoteId == 0) requestQuoteId = 125; requestQuote = rightSectionRepository.GetRequestQuote(requestQuoteId); if (requestQuote != null) HttpContext.Current.Cache.Insert(requestQuoteKey, requestQuote, null, DateTime.Now.AddMinutes("CacheDuration".GetAppKeyDouble()), TimeSpan.Zero); } else { requestQuote = (RequestQuote)HttpContext.Current.Cache[requestQuoteKey]; } rptquoteRequest.DataSource = requestQuote.GetQuoteRequest; rptquoteRequest.DataBind(); }