private void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { // // Setup the data grid. // dgAttendance.ItemType = "Attendance Record"; dgAttendance.ItemBgColor = CurrentPortalPage.Setting("ItemBgColor", string.Empty, false); dgAttendance.ItemAltBgColor = CurrentPortalPage.Setting("ItemAltBgColor", string.Empty, false); dgAttendance.ItemMouseOverColor = CurrentPortalPage.Setting("ItemMouseOverColor", string.Empty, false); dgAttendance.AddEnabled = false; dgAttendance.MoveEnabled = false; dgAttendance.DeleteEnabled = false; dgAttendance.EditEnabled = false; dgAttendance.MergeEnabled = false; dgAttendance.MailEnabled = false; dgAttendance.ExportEnabled = true; dgAttendance.AllowSorting = true; dgAttendance.Columns[5].Visible = (AbilityLevelAttributeIDSetting != ""); // // Turn off either the regular name, or the hyperlink name. // if (PersonDetailPageID == -1) { dgAttendance.Columns[0].Visible = false; } else { dgAttendance.Columns[1].Visible = false; } // // Fill in the filter options. // OccurrenceTypeGroupCollection otgc = new OccurrenceTypeGroupCollection(CurrentOrganization.OrganizationID); foreach (OccurrenceTypeGroup otg in otgc) { ddlFilterTypeGroup.Items.Add(new ListItem(otg.GroupName, otg.GroupId.ToString())); } OccurrenceCollection oc = new OccurrenceCollection(DateTime.Now, DateTime.Now); if (this.Request.Params["groupID"] != null) { ddlFilterTypeGroup.SelectedValue = this.Request.Params["groupID"]; } else if (DefaultAttendanceGroupIDSetting != "") { ddlFilterTypeGroup.SelectedValue = DefaultAttendanceGroupIDSetting.ToString(); } else if (oc.Count > 0) { // // Find the first occurrence with an actual location. // foreach (Occurrence o in oc) { if (o.LocationID != -1) { ddlFilterTypeGroup.SelectedValue = new OccurrenceType(o.OccurrenceTypeID).GroupId.ToString(); break; } } } if (ddlFilterTypeGroup.SelectedValue == null || ddlFilterTypeGroup.SelectedValue == "") { ddlFilterTypeGroup.SelectedIndex = 0; } ddlFilterTypeGroup_Changed(null, null); btnFilterApply_Click(null, null); } }
private void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { // // Setup the data grid. // dgOccurrence.ItemType = "Occurrence"; dgOccurrence.ItemBgColor = CurrentPortalPage.Setting("ItemBgColor", string.Empty, false); dgOccurrence.ItemAltBgColor = CurrentPortalPage.Setting("ItemAltBgColor", string.Empty, false); dgOccurrence.ItemMouseOverColor = CurrentPortalPage.Setting("ItemMouseOverColor", string.Empty, false); dgOccurrence.AddEnabled = false; dgOccurrence.MoveEnabled = false; dgOccurrence.DeleteEnabled = false; dgOccurrence.EditEnabled = false; dgOccurrence.MergeEnabled = false; dgOccurrence.MailEnabled = false; dgOccurrence.ExportEnabled = true; dgOccurrence.AllowSorting = true; dgOccurrence.Columns[kOccurrenceNameColumn].Visible = (AttendanceDetailPageID == -1); dgOccurrence.Columns[kOccurrenceNameLinkColumn].Visible = (AttendanceDetailPageID != -1); dgOccurrence.Columns[kOccurrenceTypeColumn].Visible = (AttendanceDetailPageID == -1); dgOccurrence.Columns[kOccurrenceTypeLinkColumn].Visible = (AttendanceDetailPageID != -1); // // Setup the data grid. // dgLocation.ItemType = "Location"; dgLocation.ItemBgColor = CurrentPortalPage.Setting("ItemBgColor", string.Empty, false); dgLocation.ItemAltBgColor = CurrentPortalPage.Setting("ItemAltBgColor", string.Empty, false); dgLocation.ItemMouseOverColor = CurrentPortalPage.Setting("ItemMouseOverColor", string.Empty, false); dgLocation.AddEnabled = false; dgLocation.MoveEnabled = false; dgLocation.DeleteEnabled = false; dgLocation.EditEnabled = false; dgLocation.MergeEnabled = false; dgLocation.MailEnabled = false; dgLocation.ExportEnabled = true; dgLocation.AllowSorting = true; dgLocation.Columns[kLocationLocationColumn].Visible = (AttendanceDetailPageID == -1); dgLocation.Columns[kLocationLocationLinkColumn].Visible = (AttendanceDetailPageID != -1); // // Fill in the filter options. // OccurrenceTypeGroupCollection otgc = new OccurrenceTypeGroupCollection(CurrentOrganization.OrganizationID); foreach (OccurrenceTypeGroup otg in otgc) { ddlFilterTypeGroup.Items.Add(new ListItem(otg.GroupName, otg.GroupId.ToString())); } OccurrenceCollection oc = new OccurrenceCollection(DateTime.Now, DateTime.Now); if (DefaultAttendanceGroupIDSetting != "") { ddlFilterTypeGroup.SelectedValue = DefaultAttendanceGroupIDSetting.ToString(); } else if (oc.Count > 0) { // // Find the first occurrence with an actual location. // foreach (Occurrence o in oc) { if (o.LocationID != -1) { ddlFilterTypeGroup.SelectedValue = new OccurrenceType(o.OccurrenceTypeID).GroupId.ToString(); break; } } } if (ddlFilterTypeGroup.SelectedValue == null || ddlFilterTypeGroup.SelectedValue == "") { ddlFilterTypeGroup.SelectedIndex = 0; } ddlFilterTypeGroup_Changed(null, null); btnFilterApply_Click(null, null); // // Setup options on the finalize close button. // lbCloseFinish.Style.Add("text-decoration", "none"); lbCloseFinish.Attributes.Add("onmouseover", "this.style.textDecoration='underline';"); lbCloseFinish.Attributes.Add("onmouseout", "this.style.textDecoration='none';"); } dgClose_Bind(); }