private void LoadInventoryActivity(DateTime selectedDate) { DateTime startDate = new DateTime(selectedDate.Year, selectedDate.Month, 1); DateTime endDate = new DateTime(selectedDate.Year, selectedDate.Month, DateTime.DaysInMonth(selectedDate.Year, selectedDate.Month)); try { AnalyticsManager analyticsManager = new AnalyticsManager(); InventoryPageViews pageViews = analyticsManager.GetInventoryPageViews(CompanyId, startDate, endDate); lblInventoryPageViews.Text = pageViews.PageViews.ToString(CultureInfo.InvariantCulture); lblInventoryUserViews.Text = pageViews.UserViews.ToString(CultureInfo.InvariantCulture); lblInventoryUserViews.ForeColor = lblInventoryPageViews.ForeColor = Color.Empty; } catch (StageBitzException ex) { lblInventoryPageViews.Text = "Error!"; lblInventoryUserViews.Text = "Error!"; lblInventoryPageViews.ToolTip = lblInventoryUserViews.ToolTip = ex.InnerException.ToString(); lblInventoryUserViews.ForeColor = lblInventoryPageViews.ForeColor = Color.Red; } gvInventoryActivity.DataSource = this.GetBL <CompanyBL>().GetInventoryActivityData(CompanyId, startDate, endDate); gvInventoryActivity.DataBind(); }
/// <summary> /// Gets the inventory page views. /// </summary> /// <param name="companyId">The company identifier.</param> /// <param name="startDate">The start date.</param> /// <param name="endDate">The end date.</param> /// <returns></returns> public InventoryPageViews GetInventoryPageViews(int companyId, DateTime startDate, DateTime endDate) { InventoryPageViews inventoryPageViews = new InventoryPageViews(); inventoryPageViews.PageViews = GetInventoryPageViewCount(companyId, startDate, endDate); inventoryPageViews.UserViews = GetInventoryUserViewCount(companyId, startDate, endDate); return(inventoryPageViews); }