protected virtual void AddDashBoardDetails(string key, DashBoardWidgetCacheModel value) { lock (padlock) { DashBoardDetails.Add(key, value, DateTimeOffset.MaxValue); } }
protected virtual DashBoardWidgetCacheModel GetDashBoardWidgetDetails() { lock (padlock) { DashBoardWidgetCacheModel dashBoardWidgetCacheModel = new DashBoardWidgetCacheModel(); var v = DashBoardDetails; foreach (var item in v) { dashBoardWidgetCacheModel = (DashBoardWidgetCacheModel)item.Value; } return(dashBoardWidgetCacheModel); } }
public virtual void RefreshDashBoardWidgetDetails() { string sqlConnection = ConfigurationManager.ConnectionStrings["SQLConnection"].ConnectionString; DbConnection c = new SqlConnection(sqlConnection); IBeerRepository i = c.As <IBeerRepository>(); DashBoardWidgetCacheModel dashBoardWidgetCacheModel = new DashBoardWidgetCacheModel(); dashBoardWidgetCacheModel = i.RefreshDashBoardWidgetDetails(); List <DashBoardWidgetCacheModel> fileEncryptionDetailsChart = new List <DashBoardWidgetCacheModel>(); fileEncryptionDetailsChart = i.GetFileEncryptionDetailsForDashBoard(); dashBoardWidgetCacheModel.FileUploadChartLables = "'" + string.Join("','", fileEncryptionDetailsChart.Select(x => x.FileUploadChartLables)) + "'"; dashBoardWidgetCacheModel.FileUploadChartData = string.Join(",", fileEncryptionDetailsChart.Select(x => x.FileUploadChartData)); base.AddDashBoardDetails("Widgets", dashBoardWidgetCacheModel); }