private void InitComponent() { List <string> columns = new List <string>(); columns.Add("FileName"); columns.Add("FilePath"); var table = CommonUtility.CreateMemoryTable(columns); Session["tempTable"] = table; DateTime startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0, 0); DateTime endDate = startDate.AddDays(1); using (var context = new ReportContext()) { var newsCount = context.Articles.Count(a => a.AddDate >= startDate && a.AddDate <= endDate); this.ltlNewsCount.Text = newsCount.ToString(); var reportsCount = context.Reports.Count(); this.ltlReportsCount.Text = reportsCount.ToString(); var referencesCount = context.ReferenceReports.Count(); this.ltlReferencesCount.Text = referencesCount.ToString(); } using (var context = new PaperContext()) { var articlesCount = context.Papers.Count(p => p.AddDate >= startDate && p.AddDate <= endDate); this.ltlArticlesCount.Text = articlesCount.ToString(); } this.ltlBarChart.Text = BasicColumnBarChart(); string userId = User.Identity.GetUserId(); if (userId != null) { var manager = Context.GetOwinContext().GetUserManager <ApplicationUserManager>(); var user = manager.FindById(userId); if (user.CanWriteEmail == true) { this.send_email_div.Visible = true; } else { this.send_email_div.Visible = false; } } InitRepeater1(); InitRepeater2(); cblReceiveUser_GetData(); InitRepeater4(); ddlParentGroupID_GetData(); InitRepeater5(); }