/// <summary> /// Creates the activities whats new data source. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.ObjectDataSourceEventArgs"/> instance containing the event data.</param> protected void CreateActivitiesWhatsNewDataSource(object sender, ObjectDataSourceEventArgs e) { ActivitiesWhatsNewDataSource dataSource = new ActivitiesWhatsNewDataSource(); dataSource.ActivitySearchOptions = SearchOptions; SearchOptions.ModifiedActivitiesOnly = false; if (_NewActivitiesLastPageIndex) { int recordCount = dataSource.GetRecordCount(); int pageSize = grdNewActivities.PageSize; decimal numberOfPages = recordCount / pageSize; grdNewActivities.PageIndex = (int)Math.Ceiling(numberOfPages); } e.ObjectInstance = dataSource; }
/// <summary> /// Creates the activities whats modified data source. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.ObjectDataSourceEventArgs"/> instance containing the event data.</param> protected void CreateActivitiesWhatsModifiedDataSource(object sender, ObjectDataSourceEventArgs e) { ActivitiesWhatsNewDataSource dataSource = new ActivitiesWhatsNewDataSource(); dataSource.ActivitySearchOptions = SearchOptions; SearchOptions.ModifiedActivitiesOnly = true; if (_ModifiedActivitiesLastPageIndex) { int pageIndex = 0; int recordCount = dataSource.GetRecordCount(); int pageSize = grdModifiedActivities.PageSize; decimal numberOfPages = recordCount / pageSize; pageIndex = Convert.ToInt32(Math.Ceiling(numberOfPages)); grdModifiedActivities.PageIndex = pageIndex; } e.ObjectInstance = dataSource; }
/// <summary> /// Creates the activities whats new data source. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.ObjectDataSourceEventArgs"/> instance containing the event data.</param> protected void CreateActivitiesWhatsNewDataSource(object sender, ObjectDataSourceEventArgs e) { ActivitiesWhatsNewDataSource dataSource = new ActivitiesWhatsNewDataSource(); dataSource.ActivitySearchOptions = SearchOptions; SearchOptions.ModifiedActivitiesOnly = false; if (_NewActivitiesLastPageIndex) { int pageIndex = 0; int recordCount = dataSource.GetRecordCount(); int pageSize = grdNewActivities.PageSize; decimal numberOfPages = recordCount / pageSize; pageIndex = Convert.ToInt32(Math.Ceiling(numberOfPages)); grdNewActivities.PageIndex = pageIndex; } e.ObjectInstance = dataSource; }