public DescriptionList GetOptionAvail() { OracleConnection con = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_GET_OPTIONAVAIL"; cmd = new OracleCommand(proc, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); DescriptionBO DescriptionBO = null; DescriptionList objDescriptionList = new DescriptionList(); while (dr.Read()) { DescriptionBO = new DescriptionBO(); DescriptionBO.OptionID = dr.GetInt32(dr.GetOrdinal("ID")); DescriptionBO.OptionAvailablename = dr.GetValue(dr.GetOrdinal("OPTIONAVAILABLE")).ToString(); objDescriptionList.Add(DescriptionBO); } dr.Close(); return(objDescriptionList); }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="mediaAccount">The media account.</param> private void ShowReadonlyDetails(MediaAccount mediaAccount) { SetEditMode(false); lActionTitle.Text = mediaAccount.Name.FormatAsHtmlTitle(); hlInactive.Visible = !mediaAccount.IsActive; hlLastRefresh.Visible = mediaAccount.LastRefreshDateTime.HasValue; if (mediaAccount.LastRefreshDateTime.HasValue) { var refreshTimeSpan = RockDateTime.Now - mediaAccount.LastRefreshDateTime.Value; hlLastRefresh.Text = "Last Refreshed: " + refreshTimeSpan.Humanize(); } var mediaAccountComponent = mediaAccount.GetMediaAccountComponent(); var descriptionList = new DescriptionList(); if (mediaAccountComponent != null) { descriptionList.Add("Type", mediaAccountComponent.EntityType.FriendlyName); } lDescription.Text = descriptionList.Html; lMetricData.Text = mediaAccountComponent?.GetAccountHtmlSummary(mediaAccount); }
/// <summary> /// Shows the mode where the user is only viewing an existing streak type /// </summary> private void ShowViewMode() { if (!IsViewMode()) { return; } var canEdit = CanEdit(); pnlEditDetails.Visible = false; pnlViewDetails.Visible = true; HideSecondaryBlocks(false); btnEdit.Visible = canEdit; btnDelete.Visible = canEdit; lPersonHtml.Text = GetPersonHtml(); lProgress.Text = GetProgressHtml(); var descriptionList = new DescriptionList(); descriptionList.Add("Date", GetAttemptDateRangeString()); lAttemptDescription.Text = descriptionList.Html; SetLinkVisibility(btnAchievement, AttributeKey.AchievementPage); SetLinkVisibility(btnStreak, AttributeKey.StreakPage); }
/// <summary> /// Handles the ProgressChanged event of the BackgroundWorker control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ProgressChangedEventArgs"/> instance containing the event data.</param> private void _importer_OnProgress(object sender, object e) { string progressMessage = string.Empty; DescriptionList progressResults = new DescriptionList(); if (e is string) { progressMessage = e.ToString(); } var exceptionsCopy = _importer.Exceptions.ToArray(); if (exceptionsCopy.Any()) { progressResults.Add("Exception", string.Join(Environment.NewLine, exceptionsCopy.Select(a => a.Message).ToArray())); } var resultsCopy = _importer.Results.ToArray(); foreach (var result in resultsCopy) { progressResults.Add(result.Key, result.Value); } WriteProgressMessage(progressMessage, progressResults.Html); }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="mediaAccount">The media folder.</param> private void ShowReadonlyDetails(MediaFolder mediaFolder) { SetEditMode(false); lActionTitle.Text = mediaFolder.Name.FormatAsHtmlTitle(); hlSyncStatus.Visible = mediaFolder.IsContentChannelSyncEnabled; var descriptionList = new DescriptionList(); descriptionList.Add("Account", mediaFolder.MediaAccount.Name); if (mediaFolder.IsContentChannelSyncEnabled) { descriptionList.Add("Content Channel", mediaFolder.ContentChannel?.Name); descriptionList.Add("Content Channel Attribute", mediaFolder.ContentChannelAttribute?.Name); descriptionList.Add("Content Channel Item Status", mediaFolder.ContentChannelItemStatus?.ConvertToString()); } if (mediaFolder.WorkflowTypeId.HasValue) { descriptionList.Add("Workflow Type", mediaFolder.WorkflowType?.Name); } if (mediaFolder.Description.IsNotNullOrWhiteSpace()) { descriptionList.Add("Description", mediaFolder.Description); } lDescription.Text = descriptionList.Html; lMetricData.Text = mediaFolder.MediaAccount.GetMediaAccountComponent()?.GetFolderHtmlSummary(mediaFolder); }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="prayerRequest">The prayer request.</param> private void ShowReadonlyDetails(PrayerRequest prayerRequest) { SetEditMode(false); lActionTitle.Text = string.Format("{0} Prayer Request", prayerRequest.FullName).FormatAsHtmlTitle(); DescriptionList descriptionList = new DescriptionList(); descriptionList.Add("Name", prayerRequest.FullName.SanitizeHtml()); descriptionList.Add("Category", prayerRequest.Category != null ? prayerRequest.Category.Name : string.Empty); descriptionList.Add("Request", prayerRequest.Text.ScrubHtmlAndConvertCrLfToBr()); descriptionList.Add("Answer", prayerRequest.Answer.ScrubHtmlAndConvertCrLfToBr()); lMainDetails.Text = descriptionList.Html; ShowStatus(prayerRequest, this.CurrentPerson, hlblFlaggedMessageRO); ShowPrayerCount(prayerRequest); if (!prayerRequest.IsApproved.HasValue) { hlblStatus.Visible = true; hlblStatus.Text = "Pending Approval"; } else if (prayerRequest.IsApproved.HasValue && (!prayerRequest.IsApproved ?? false)) { hlblStatus.Visible = true; hlblStatus.Text = "Unapproved"; } hlblUrgent.Visible = prayerRequest.IsUrgent ?? false; }
/// <summary> /// Shows the mode where the user is only viewing an existing exclusion /// </summary> private void ShowViewMode() { if (!IsViewMode()) { return; } var canEdit = CanEdit(); pnlEditDetails.Visible = false; pnlViewDetails.Visible = true; HideSecondaryBlocks(false); pdAuditDetails.Visible = canEdit; btnEdit.Visible = canEdit; btnDelete.Visible = canEdit; var exclusion = GetExclusion(); var streakType = GetStreakType(); lReadOnlyTitle.Text = ActionTitle.View(StreakTypeExclusion.FriendlyTypeName).FormatAsHtmlTitle(); var locationName = exclusion.Location != null ? exclusion.Location.Name : "Unspecified"; var descriptionList = new DescriptionList(); descriptionList.Add("Streak Type", streakType.Name); descriptionList.Add("Location", locationName); lExclusionDescription.Text = descriptionList.Html; }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="gateway">The gateway.</param> private void ShowReadonlyDetails(FinancialGateway gateway) { SetEditMode(false); lActionTitle.Text = gateway.Name.FormatAsHtmlTitle(); hlInactive.Visible = !gateway.IsActive; lGatewayDescription.Text = gateway.Description; DescriptionList descriptionList = new DescriptionList(); if (gateway.EntityType != null) { descriptionList.Add("Gateway Type", gateway.EntityType.Name); } var dayOfWeek = gateway.BatchDayOfWeek; var isWeekly = dayOfWeek.HasValue; if (isWeekly) { descriptionList.Add("Batched Weekly", dayOfWeek.Value.ToString()); } var timeSpan = gateway.GetBatchTimeOffset(); if (timeSpan.Ticks > 0) { descriptionList.Add("Batch Time Offset", timeSpan.ToString()); } lblMainDetails.Text = descriptionList.Html; }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="account">The account.</param> private void ShowReadonlyDetails(FinancialAccount account) { SetEditMode(false); hfAccountId.SetValue(account.Id); lActionTitle.Text = account.Name.FormatAsHtmlTitle(); hlInactive.Visible = !account.IsActive; lAccountDescription.Text = account.Description; DescriptionList leftDescription = new DescriptionList(); leftDescription.Add("Public Name", account.PublicName); leftDescription.Add("Campus", account.Campus != null ? account.Campus.Name : string.Empty); leftDescription.Add("GLCode", account.GlCode); leftDescription.Add("Is Tax Deductible", account.IsTaxDeductible); lLeftDetails.Text = leftDescription.Html; var followingsFromDatabase = GetAccountParticipantStateFromDatabase().OrderBy(a => a.PersonFullName).ToList(); var accountParticipantsHtml = followingsFromDatabase.Select(a => $"{a.PersonFullName} ({a.PurposeKeyDescription})").ToList().AsDelimited("<br>\n"); DescriptionList rightDescription = new DescriptionList(); rightDescription.Add("Account Participants", accountParticipantsHtml); lRightDetails.Text = rightDescription.Html; account.LoadAttributes(); Helper.AddDisplayControls(account, Helper.GetAttributeCategories(account, true, false), phAttributesView, null, false); }
/// <summary> /// Binds the details. /// </summary> private void BindDetails() { var descriptionList = new DescriptionList(); var transport = RockMessageBus.GetTransportName(); if (!transport.IsNullOrWhiteSpace()) { descriptionList.Add("Transport", transport); } descriptionList.Add("NodeName", RockMessageBus.NodeName); var statLog = RockMessageBus.StatLog; if (statLog != null) { if (statLog.MessagesConsumedLastMinute.HasValue) { descriptionList.Add("Messages Per Minute", statLog.MessagesConsumedLastMinute); } if (statLog.MessagesConsumedLastHour.HasValue) { descriptionList.Add("Messages Per Hour", statLog.MessagesConsumedLastHour); } if (statLog.MessagesConsumedLastDay.HasValue) { descriptionList.Add("Messages Per Day", statLog.MessagesConsumedLastDay); } } lDetails.Text = descriptionList.Html; }
/// <summary> /// Handles the ItemDataBound event of the rptNcoaResults control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RepeaterItemEventArgs"/> instance containing the event data.</param> protected void rptNcoaResults_ItemDataBound(object sender, RepeaterItemEventArgs e) { var ncoaRow = e.Item.DataItem as NcoaRow; var familyMembers = e.Item.FindControl("lMembers") as Literal; DescriptionList mmembers = new DescriptionList(); bool individual = false; if (ncoaRow.Individual != null) { individual = true; mmembers.Add("Individual", ncoaRow.Individual.FullName); } if (ncoaRow.FamilyMembers != null && ncoaRow.FamilyMembers.Count > 0) { if (!individual) { mmembers.Add("Family Members", ncoaRow.FamilyMembers.Select(a => a.FullName).ToList().AsDelimited("<Br/>")); } else { mmembers.Add("Other Family Members", ncoaRow.FamilyMembers.Select(a => a.FullName).ToList().AsDelimited("<Br/>")); var warninglabel = e.Item.FindControl("lWarning") as Literal; warninglabel.Text = "Auto processing this move would result in a split family."; } } familyMembers.Text = mmembers.Html; }
/// <summary> /// Shows the mode where the user is only viewing an existing streak type /// </summary> private void ShowViewMode() { if (!IsViewMode()) { return; } var canEdit = CanEdit(); btnEdit.Visible = canEdit; pnlEditDetails.Visible = false; pnlViewDetails.Visible = true; HideSecondaryBlocks(false); // Description var node = WebFarmNode; var descriptionList = new DescriptionList(); descriptionList.Add("Last Seen", node.LastSeen); descriptionList.Add("Is Leader", node.IsLeader.ToYesNo()); descriptionList.Add("Job Runner", node.IsJobRunner.ToYesNo()); descriptionList.Add("Polling Interval", string.Format("{0:N1}s", node.PollingIntervalSeconds)); lDescription.Text = descriptionList.Html; // Show chart for responsive nodes if (node.IsActive && !node.IsUnresponsive && node.Metrics.Count() > 1) { var samples = WebFarmNodeMetricService.CalculateMetricSamples(node.Metrics, _cpuMetricSampleCount, ChartMinDate, _chartMaxDate); var html = GetChartHtml(samples); lChart.Text = html; } }
protected void ClearBtn_Click(object sender, EventArgs e) { Built = false; using (VirusDescriptionActions curVirus = new VirusDescriptionActions()) { curVirus.EmptyVirus(); DescriptionList.DataSource = null; DescriptionList.DataBind(); VirusDescriptionTitle.Visible = false; NoSelected.Visible = true; LabelTotalText.Text = ""; lblTotal.Text = ""; LabelTotalF_in.Text = ""; lblTotalF_in.Text = ""; LabelTotalF_out.Text = ""; lblTotalF_out.Text = ""; UpdateBtn.Visible = false; BuildCombo.Visible = false; BuildRow.Visible = false; BuildCol.Visible = false; ClearBtn.Visible = false; abstractionNone.Visible = abstractionNone.Visible = abstractionResults.Visible = abstractionGrid.Visible = false; directNone.Visible = direct.Visible = directGrid.Visible = false; indirectNone.Visible = indirectGrid.Visible = indirect.Visible = false; RowResults.Visible = RowGrid.Visible = false; ColumnResults.Visible = ColumnGrid.Visible = false; } }
/// <summary> /// Shows the summary. /// </summary> /// <param name="business">The business.</param> private void ShowSummary(int businessId) { SetEditMode(false); hfBusinessId.SetValue(businessId); lTitle.Text = "View Business".FormatAsHtmlTitle(); var business = new PersonService(new RockContext()).Get(businessId); if (business != null) { SetHeadingStatusInfo(business); var detailsLeft = new DescriptionList(); detailsLeft.Add("Business Name", business.LastName); if (business.GivingGroup != null) { detailsLeft.Add("Campus", business.GivingGroup.Campus); } if (business.RecordStatusReasonValue != null) { detailsLeft.Add("Record Status Reason", business.RecordStatusReasonValue); } lDetailsLeft.Text = detailsLeft.Html; var detailsRight = new DescriptionList(); // Get address var workLocationType = DefinedValueCache.Read(Rock.SystemGuid.DefinedValue.GROUP_LOCATION_TYPE_WORK.AsGuid()); if (workLocationType != null) { if (business.GivingGroup != null) // Giving Group is a shortcut to Family Group for business { var location = business.GivingGroup.GroupLocations .Where(gl => gl.GroupLocationTypeValueId == workLocationType.Id) .Select(gl => gl.Location) .FirstOrDefault(); if (location != null) { detailsRight.Add("Address", location.GetFullStreetAddress().ConvertCrLfToHtmlBr()); } } } var workPhoneType = DefinedValueCache.Read(Rock.SystemGuid.DefinedValue.PERSON_PHONE_TYPE_WORK.AsGuid()); if (workPhoneType != null) { var phoneNumber = business.PhoneNumbers.FirstOrDefault(n => n.NumberTypeValueId == workPhoneType.Id); if (phoneNumber != null) { detailsRight.Add("Phone Number", phoneNumber.ToString()); } } lDetailsRight.Text = detailsRight .Add("Email Address", business.Email) .Html; } }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="dataView">The data view.</param> private void ShowReadonlyDetails(DataView dataView) { SetEditMode(false); hfDataViewId.SetValue(dataView.Id); lReadOnlyTitle.Text = dataView.Name; DescriptionList descriptionList = new DescriptionList(); if (dataView.EntityType != null) { descriptionList.Add("Applies To", dataView.EntityType.FriendlyName); } if (dataView.Category != null) { descriptionList.Add("Category", dataView.Category.Name); } descriptionList.Add("Description", dataView.Description); if (dataView.DataViewFilter != null && dataView.EntityTypeId.HasValue) { descriptionList.Add("Filter", dataView.DataViewFilter.ToString(EntityTypeCache.Read(dataView.EntityTypeId.Value).GetEntityType())); } if (dataView.TransformEntityType != null) { descriptionList.Add("Post-filter Transformation", dataView.TransformEntityType.FriendlyName); } lblMainDetails.Text = descriptionList.Html; ShowReport(dataView); }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="event">The event.</param> private void ShowReadonlyDetails(FollowingEventType followingEvent) { SetEditMode(false); lActionTitle.Text = followingEvent.Name.FormatAsHtmlTitle(); hlInactive.Visible = !followingEvent.IsActive; lEventDescription.Text = followingEvent.Description; DescriptionList descriptionList = new DescriptionList(); if (followingEvent.EntityType != null) { descriptionList.Add("Event Type", followingEvent.EntityType.Name); } descriptionList.Add("Require Notification", followingEvent.IsNoticeRequired ? "Yes" : "No"); descriptionList.Add("Send Weekend Notices on Friday", followingEvent.SendOnWeekends ? "No" : "Yes"); var eventEntityTypeGuid = EntityTypeCache.Get(followingEvent.EntityType.Id).Guid.ToString(); if (followingEvent.EntityType != null && string.Equals(eventEntityTypeGuid, Rock.SystemGuid.EntityType.PERSON_PRAYER_REQUEST, StringComparison.OrdinalIgnoreCase)) { descriptionList.Add("Include Non-Public Requests", followingEvent.IncludeNonPublicRequests ? "Yes" : "No"); } lblMainDetails.Text = descriptionList.Html; }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="prayerRequest">The prayer request.</param> private void ShowReadonlyDetails(PrayerRequest prayerRequest) { SetEditMode(false); lActionTitle.Text = string.Format("{0} Prayer Request", prayerRequest.FullName).FormatAsHtmlTitle(); DescriptionList descriptionList = new DescriptionList(); if (prayerRequest.RequestedByPersonAlias != null) { descriptionList.Add("Requested By", prayerRequest.RequestedByPersonAlias.Person.FullName); } descriptionList.Add("Name", prayerRequest.FullName); if (!string.IsNullOrWhiteSpace(prayerRequest.Email)) { descriptionList.Add("Email", String.Format("<a href='mailto:{0}'>{0}</a>", prayerRequest.Email)); } descriptionList.Add("Campus", prayerRequest.Campus); descriptionList.Add("Request", prayerRequest.Text.ScrubHtmlAndConvertCrLfToBr()); descriptionList.Add("Answer", prayerRequest.Answer.ScrubHtmlAndConvertCrLfToBr()); lMainDetails.Text = descriptionList.Html; prayerRequest.LoadAttributes(); var attributes = prayerRequest.Attributes.Select(a => a.Value).OrderBy(a => a.Order).ThenBy(a => a.Name).ToList(); var attributeCategories = Helper.GetAttributeCategories(attributes); Rock.Attribute.Helper.AddDisplayControls(prayerRequest, attributeCategories, phDisplayAttributes, null, false); ShowStatus(prayerRequest, this.CurrentPerson, hlblFlaggedMessageRO); ShowPrayerCount(prayerRequest); hlblUrgent.Visible = prayerRequest.IsUrgent ?? false; }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="group">The group.</param> private void ShowReadonlyDetails(Group group) { SetEditMode(false); string groupIconHtml = string.Empty; if (!string.IsNullOrWhiteSpace(group.GroupType.IconCssClass)) { groupIconHtml = string.Format("<i class='{0} icon-large' ></i>", group.GroupType.IconCssClass); } else { var appPath = System.Web.VirtualPathUtility.ToAbsolute("~"); string imageUrlFormat = "<img src='" + appPath + "GetImage.ashx?id={0}&width=50&height=50' />"; if (group.GroupType.IconLargeFileId != null) { groupIconHtml = string.Format(imageUrlFormat, group.GroupType.IconLargeFileId); } else if (group.GroupType.IconSmallFileId != null) { groupIconHtml = string.Format(imageUrlFormat, group.GroupType.IconSmallFileId); } } hfGroupId.SetValue(group.Id); lGroupIconHtml.Text = groupIconHtml; lReadOnlyTitle.Text = group.Name.FormatAsHtmlTitle(); hlInactive.Visible = !group.IsActive; hlType.Text = group.GroupType.Name; lGroupDescription.Text = group.Description; DescriptionList descriptionList = new DescriptionList(); if (group.ParentGroup != null) { descriptionList.Add("Parent Group", group.ParentGroup.Name); } if (group.Campus != null) { hlCampus.Visible = true; hlCampus.Text = group.Campus.Name; } else { hlCampus.Visible = false; } lblMainDetails.Text = descriptionList.Html; GroupType groupType = new GroupTypeService().Get(group.GroupTypeId); groupType.LoadAttributes(); Rock.Attribute.Helper.AddDisplayControls(groupType, phGroupTypeAttributesReadOnly); group.LoadAttributes(); Rock.Attribute.Helper.AddDisplayControls(group, phGroupAttributesReadOnly); }
/// <summary> /// Shows the mode where the user is only viewing an existing streak type /// </summary> private void ShowViewMode() { if (!IsViewMode()) { return; } var canEdit = CanEdit(); pnlEditDetails.Visible = false; pnlViewDetails.Visible = true; HideSecondaryBlocks(false); pdAuditDetails.Visible = canEdit; btnEdit.Visible = canEdit; btnDelete.Visible = canEdit; var enrollment = GetStreak(); var streakType = GetStreakType(); lReadOnlyTitle.Text = ActionTitle.View(Streak.FriendlyTypeName).FormatAsHtmlTitle(); btnRebuild.Enabled = streakType.IsActive; lPersonHtml.Text = GetPersonHtml(); var descriptionList = new DescriptionList(); descriptionList.Add("Streak Type", streakType.Name); descriptionList.Add("Enrollment Date", enrollment.EnrollmentDate.ToShortDateString()); if (enrollment.Location != null) { descriptionList.Add("Location", enrollment.Location.Name); } lEnrollmentDescription.Text = descriptionList.Html; var streakDetailsList = new DescriptionList(); streakDetailsList.Add("Current Streak", GetStreakStateString(enrollment.CurrentStreakCount, enrollment.CurrentStreakStartDate)); streakDetailsList.Add("Longest Streak", GetStreakStateString(enrollment.LongestStreakCount, enrollment.LongestStreakStartDate, enrollment.LongestStreakEndDate)); lStreakData.Text = streakDetailsList.Html; RenderStreakChart(); SetLinkVisibility(btnAttempts, AttributeKey.AttemptsPage); // Show the count of successful attempts on the button var successfulAttemptCount = GetSuccessfulAttemptCount(); if (successfulAttemptCount > 0) { btnAttempts.Text = string.Format(@"<i class=""fa fa-medal""></i> Achievements <span class=""badge"">{0}</span>", successfulAttemptCount); } else { btnAttempts.Text = @"<i class=""fa fa-medal""></i> Achievements"; } }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="marketingCampaign">The marketing campaign.</param> private void ShowReadonlyDetails(MarketingCampaign marketingCampaign) { SetEditMode(false); // set title.text value even though it is hidden so that Ad Edit can get the title of the campaign tbTitle.Text = marketingCampaign.Title; string contactInfo = string.Format("{0}<br>{1}<br>{2}", marketingCampaign.ContactFullName, marketingCampaign.ContactEmail, marketingCampaign.ContactPhoneNumber); contactInfo = string.IsNullOrWhiteSpace(contactInfo.Replace("<br>", string.Empty)) ? None.TextHtml : contactInfo; string eventGroupHtml = null; string eventPageGuid = this.GetAttributeValue("EventPage"); if (marketingCampaign.EventGroup != null) { eventGroupHtml = marketingCampaign.EventGroup.Name; if (!string.IsNullOrWhiteSpace(eventPageGuid)) { var page = new PageService().Get(new Guid(eventPageGuid)); Dictionary <string, string> queryString = new Dictionary <string, string>(); queryString.Add("groupId", marketingCampaign.EventGroupId.ToString()); string eventGroupUrl = new PageReference(page.Id, 0, queryString).BuildUrl(); eventGroupHtml = string.Format("<a href='{0}'>{1}</a>", eventGroupUrl, marketingCampaign.EventGroup.Name); } } string campusList = marketingCampaign.MarketingCampaignCampuses.Select(a => a.Campus.Name).OrderBy(a => a).ToList().AsDelimited("<br>"); string primaryAudiences = marketingCampaign.MarketingCampaignAudiences.Where(a => a.IsPrimary).Select(a => a.Name).OrderBy(a => a).ToList().AsDelimited("<br>"); primaryAudiences = marketingCampaign.MarketingCampaignAudiences.Where(a => a.IsPrimary).Count() == 0 ? None.TextHtml : primaryAudiences; string secondaryAudiences = marketingCampaign.MarketingCampaignAudiences.Where(a => !a.IsPrimary).Select(a => a.Name).OrderBy(a => a).ToList().AsDelimited("<br>"); secondaryAudiences = marketingCampaign.MarketingCampaignAudiences.Where(a => !a.IsPrimary).Count() == 0 ? None.TextHtml : secondaryAudiences; DescriptionList descriptionList = new DescriptionList() .Add("Title", marketingCampaign.Title) .Add("Contact", contactInfo); if (eventGroupHtml != null) { descriptionList.Add("Linked Event", eventGroupHtml); } if (marketingCampaign.MarketingCampaignCampuses.Count > 0) { descriptionList.Add("Campuses", campusList); } descriptionList .Add("Primary Audience", primaryAudiences) .Add("Secondary Audience", secondaryAudiences); lblMainDetails.Text = descriptionList.Html; }
/// <summary> /// Shows the detail of the exception /// </summary> /// <param name="exceptionId">The exception identifier.</param> public void ShowReadonlyDetail(int exceptionId) { // Get the base-level exception. var baseException = GetOutermostException(exceptionId); if (baseException == null) { pnlSummary.Visible = false; return; } var description = baseException.Description.Truncate(100); lPageTitle.Text = string.Format("({0:g}) {1}", baseException.CreatedDateTime, description).FormatAsHtmlTitle(); var dl = new DescriptionList(); dl.Add("Exception Date", baseException.CreatedDateTime.HasValue ? string.Format("{0:g}", baseException.CreatedDateTime.Value) : string.Empty); dl.Add("Description", baseException.Description); dl.Add("Site", baseException.Site != null ? baseException.Site.Name : string.Empty); if (baseException.Page != null || !string.IsNullOrWhiteSpace(baseException.PageUrl)) { dl.Add("Page", string.Format("<a href=\"{1}\" target=\"_blank\">{0}</a>", baseException.Page != null ? baseException.Page.InternalName : baseException.PageUrl.EncodeHtml(), baseException.PageUrl.EncodeHtml())); } // If query string is not empty build query string list if (!string.IsNullOrWhiteSpace(baseException.QueryString)) { dl.Add("Query String", BuildQueryStringList(baseException.QueryString)); } if (baseException.CreatedByPersonAlias != null && baseException.CreatedByPersonAlias.Person != null) { dl.Add("User", baseException.CreatedByPersonAlias.Person.FullName); } lExceptionSummary.Text = dl.Html; lCookies.Text = baseException.Cookies; lServerVariables.Text = baseException.ServerVariables; lFormData.Text = baseException.Form; btnShowCookies.Visible = !string.IsNullOrWhiteSpace(baseException.Cookies); btnShowVariables.Visible = !string.IsNullOrWhiteSpace(baseException.ServerVariables); btnShowFormData.Visible = !string.IsNullOrWhiteSpace(baseException.Form); // Make sure we have a root-level exception so we can show the entire hierarchy. var rootException = GetOutermostException(baseException); var logs = GetExceptionLogs(rootException); rptExceptionDetails.DataSource = logs.OrderBy(e => e.Id); rptExceptionDetails.DataBind(); pnlSummary.Visible = true; }
private void bindGrid() { DescriptionList objDescriptionList = new DescriptionList(); DescriptionBLL objdescriptionBLL = new DescriptionBLL(); objDescriptionList = objdescriptionBLL.GetAllDescriptionDetails(); grdDescription.DataSource = objDescriptionList; grdDescription.DataBind(); }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="metric">The metric.</param> private void ShowReadonlyDetails(Metric metric) { SetEditMode(false); hfMetricId.SetValue(metric.Id); lcMetricsChart.Visible = GetAttributeValue("ShowChart").AsBooleanOrNull() ?? true; var chartDateRange = SlidingDateRangePicker.CalculateDateRangeFromDelimitedValues(GetAttributeValue("SlidingDateRange") ?? "-1||"); lcMetricsChart.StartDate = chartDateRange.Start; lcMetricsChart.EndDate = chartDateRange.End; lcMetricsChart.MetricId = metric.Id; lcMetricsChart.CombineValues = GetAttributeValue("CombineChartSeries").AsBooleanOrNull() ?? false; lReadOnlyTitle.Text = metric.Title.FormatAsHtmlTitle(); DescriptionList descriptionListMain = new DescriptionList(); descriptionListMain.Add("Subtitle", metric.Subtitle); descriptionListMain.Add("Description", metric.Description); if (metric.MetricCategories != null && metric.MetricCategories.Any()) { descriptionListMain.Add("Categories", metric.MetricCategories.Select(s => s.Category.ToString()).OrderBy(o => o).ToList().AsDelimited(",")); } // only show LastRun and Schedule label if SourceValueType is not Manual int manualSourceType = DefinedValueCache.Read(Rock.SystemGuid.DefinedValue.METRIC_SOURCE_VALUE_TYPE_MANUAL.AsGuid()).Id; ltLastRunDateTime.Visible = metric.SourceValueTypeId != manualSourceType; hlScheduleFriendlyText.Visible = metric.SourceValueTypeId != manualSourceType; if (metric.LastRunDateTime != null) { ltLastRunDateTime.LabelType = LabelType.Success; ltLastRunDateTime.Text = "Last Run: " + metric.LastRunDateTime.ToString(); } else { ltLastRunDateTime.LabelType = LabelType.Warning; ltLastRunDateTime.Text = "Never Run"; } if (metric.Schedule != null) { hlScheduleFriendlyText.LabelType = metric.Schedule.HasSchedule() ? LabelType.Info : LabelType.Danger; hlScheduleFriendlyText.Text = "<i class='fa fa-clock-o'></i> " + metric.Schedule.FriendlyScheduleText; } else { hlScheduleFriendlyText.LabelType = LabelType.Danger; hlScheduleFriendlyText.Text = "<i class='fa fa-clock-o'></i> " + "Not Scheduled"; } lblMainDetails.Text = descriptionListMain.Html; }
/// <summary> /// Shows the detail of the exception /// </summary> /// <param name="exceptionId">The exception identifier.</param> public void ShowDetail(int exceptionId) { ExceptionLog baseException = null; if (exceptionId != 0) { baseException = new ExceptionLogService(new RockContext()).Get(exceptionId); } //set fields if (baseException == null) { pnlSummary.Visible = false; return; } // set page title lPageTitle.Text = String.Format("Exception Overview").FormatAsHtmlTitle(); DescriptionList dl = new DescriptionList(); dl.Add("Site", baseException.Site != null ? baseException.Site.Name : String.Empty, true); if (baseException.Page != null || !string.IsNullOrWhiteSpace(baseException.PageUrl)) { dl.Add("Page", string.Format("{0} <a href=\"{1}\" class=\"btn btn-link btn-xs\" target=\"_blank\">Visit Page</a>", baseException.Page != null ? baseException.Page.InternalName : baseException.PageUrl.EncodeHtml(), baseException.PageUrl.EncodeHtml())); } //If query string is not empty build query string list if (!String.IsNullOrWhiteSpace(baseException.QueryString)) { dl.Add("Query String", BuildQueryStringList(baseException.QueryString.EncodeHtml())); } if (baseException.CreatedByPersonAlias != null && baseException.CreatedByPersonAlias.Person != null) { dl.Add("User", baseException.CreatedByPersonAlias.Person.FullName); } if (baseException.CreatedDateTime.HasValue) { dl.Add("Exception Date", string.Format("{0:g}", baseException.CreatedDateTime.Value)); } lExceptionSummary.Text = dl.Html; lCookies.Text = baseException.Cookies; lServerVariables.Text = baseException.ServerVariables; lFormData.Text = baseException.Form; btnShowCookies.Visible = !string.IsNullOrWhiteSpace(baseException.Cookies); btnShowVariables.Visible = !string.IsNullOrWhiteSpace(baseException.ServerVariables); btnShowFormData.Visible = !string.IsNullOrWhiteSpace(baseException.Form); rptExcpetionDetails.DataSource = GetExceptionLogs(baseException).OrderBy(e => e.Id); rptExcpetionDetails.DataBind(); pnlSummary.Visible = true; }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="contentChannel">Type of the content.</param> private void ShowReadonlyDetails(ContentChannel contentChannel) { SetEditMode(false); if (contentChannel != null) { hfId.SetValue(contentChannel.Id); SetHeadingInfo(contentChannel, contentChannel.Name); SetEditMode(false); nbRoleMessage.Visible = false; if (contentChannel.RequiresApproval && !IsApproverConfigured(contentChannel)) { nbRoleMessage.Text = "<p>No role or person is configured to approve the items for this channel. Please configure one or more roles or people in the security settings under the "Approve" tab.</p>"; nbRoleMessage.Visible = true; } lGroupDescription.Text = contentChannel.Description; var descriptionListLeft = new DescriptionList(); var descriptionListRight = new DescriptionList(); descriptionListLeft.Add("Items Require Approval", contentChannel.RequiresApproval.ToYesNo()); // Only show index state if indexing is enabled on the server if (IndexContainer.IndexingEnabled) { descriptionListRight.Add("Is Indexed", contentChannel.IsIndexEnabled.ToYesNo()); } if (contentChannel.EnableRss) { descriptionListLeft.Add("Channel URL", contentChannel.ChannelUrl); descriptionListRight.Add("Item URL", contentChannel.ItemUrl); } contentChannel.LoadAttributes(); foreach (var attribute in contentChannel.Attributes .Where(a => a.Value.IsGridColumn) .OrderBy(a => a.Value.Order) .Select(a => a.Value)) { if (contentChannel.AttributeValues.ContainsKey(attribute.Key)) { string value = attribute.FieldType.Field.FormatValueAsHtml(null, attribute.EntityTypeId, contentChannel.Id, contentChannel.AttributeValues[attribute.Key].Value, attribute.QualifierValues, false); descriptionListLeft.Add(attribute.Name, value); } } lDetailsLeft.Text = descriptionListLeft.Html; lDetailsRight.Text = descriptionListRight.Html; } }
internal void SslBlackList(FileInfo mfile) { string path = Common.GetPath(); //FileUrl = Common.GetURL();// Creates a dictionary of Filename and URL from which it got downloaded using (var rd = new StreamReader(path + mfile.ToString())) { List <KeyValuePair <string, List <string> > > InfoList = new List <KeyValuePair <string, List <string> > >(); string fieldC = "category"; string fieldD = "description"; string fieldU = "url"; string fieldT = "date"; string IP = ""; string IpDescription = ""; string category = ""; string IpDate = ""; string URL = ""; string line1 = rd.ReadLine(); string line2 = rd.ReadLine(); string line3 = rd.ReadLine(); while (!rd.EndOfStream) { string line = rd.ReadLine(); string[] info = line.Split(','); IpDate = line3.Split(':')[1]; if (info.Count() == 3) { IP = info[0]; IpDescription = info[2]; category = "C & C"; URL = "https://sslbl.abuse.ch"; DescriptionList.Add(IpDescription); CategoryList.Add(category); UrlList.Add(URL); IpDateList.Add(IpDate); InfoList.Add(new KeyValuePair <string, List <string> >(fieldC, CategoryList)); InfoList.Add(new KeyValuePair <string, List <string> >(fieldD, DescriptionList)); InfoList.Add(new KeyValuePair <string, List <string> >(fieldU, UrlList)); InfoList.Add(new KeyValuePair <string, List <string> >(fieldT, IpDateList)); if (!BlackListDB.ContainsKey(IP)) { BlackListDB.Add(IP, InfoList); totalip.Add(IP); } CategoryList = new List <string>(); DescriptionList = new List <string>(); UrlList = new List <string>(); InfoList = new List <KeyValuePair <string, List <string> > >(); IpDateList = new List <string>(); } } } }
/// <summary> /// Shows the readonly details. /// </summary> /// <param name="prayerRequest">The prayer request.</param> private void ShowReadonlyDetails(PrayerRequest prayerRequest) { SetEditMode(false); lActionTitle.Text = string.Format("{0} Prayer Request", prayerRequest.FullName).FormatAsHtmlTitle(); DescriptionList descriptionList = new DescriptionList(); if (prayerRequest.RequestedByPersonAlias != null) { descriptionList.Add("Requested By", prayerRequest.RequestedByPersonAlias.Person.FullName); } descriptionList.Add("Name", prayerRequest.FullName); string email = null; if (!string.IsNullOrWhiteSpace(prayerRequest.Email)) { email = prayerRequest.Email; } else if (prayerRequest.RequestedByPersonAlias != null) { email = prayerRequest.RequestedByPersonAlias.Person.Email; } if (!string.IsNullOrEmpty(email)) { descriptionList.Add("Email", String.Format("<a href='mailto:{0}'>{0}</a>", email)); } if (CampusCache.All(false).Count > 1) { descriptionList.Add("Campus", prayerRequest.Campus); } descriptionList.Add("Request", prayerRequest.Text.ScrubHtmlAndConvertCrLfToBr()); descriptionList.Add("Answer", prayerRequest.Answer.ScrubHtmlAndConvertCrLfToBr()); lMainDetails.Text = descriptionList.Html; prayerRequest.LoadAttributes(); var attributes = prayerRequest.Attributes.Select(a => a.Value).OrderBy(a => a.Order).ThenBy(a => a.Name).ToList(); var attributeCategories = Helper.GetAttributeCategories(attributes); // Filter to only show attribute / attribute values that the person is authorized to view. var excludeForView = prayerRequest.Attributes.Where(a => !a.Value.IsAuthorized(Authorization.VIEW, this.CurrentPerson)).Select(a => a.Key).ToList(); Rock.Attribute.Helper.AddDisplayControls(prayerRequest, attributeCategories, phDisplayAttributes, excludeForView, false); ShowStatus(prayerRequest, this.CurrentPerson, hlblFlaggedMessageRO); ShowPrayerCount(prayerRequest); hlblUrgent.Visible = prayerRequest.IsUrgent ?? false; }
/// <summary> /// Handles the RowDataBound event of the gFamilyMembers control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewRowEventArgs"/> instance containing the event data.</param> protected void gFamilyMembers_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { var familyPersonState = e.Row.DataItem as FamilyRegistrationState.FamilyPersonState; if (familyPersonState != null) { Literal lGroupRoleAndRelationship = e.Row.FindControl("lGroupRoleAndRelationship") as Literal; if (lGroupRoleAndRelationship != null) { lGroupRoleAndRelationship.Text = familyPersonState.GroupRole; if (familyPersonState.ChildRelationshipToAdult > 0 && _knownRelationshipLookup != null) { var relationshipText = _knownRelationshipLookup.GetValueOrNull(familyPersonState.ChildRelationshipToAdult); lGroupRoleAndRelationship.Text = string.Format("{0}<br/>{1}", familyPersonState.GroupRole, relationshipText); } } Literal lRequiredAttributes = e.Row.FindControl("lRequiredAttributes") as Literal; if (lRequiredAttributes != null) { List <AttributeCache> requiredAttributes; if (familyPersonState.IsAdult) { requiredAttributes = RequiredAttributesForAdults; } else { requiredAttributes = RequiredAttributesForChildren; } if (requiredAttributes.Any()) { DescriptionList descriptionList = new DescriptionList(); foreach (var requiredAttribute in requiredAttributes) { var attributeValue = familyPersonState.PersonAttributeValuesState.GetValueOrNull(requiredAttribute.Key); var requiredAttributeDisplayValue = requiredAttribute.FieldType.Field.FormatValue(lRequiredAttributes, attributeValue != null ? attributeValue.Value : null, requiredAttribute.QualifierValues, true); descriptionList.Add(requiredAttribute.Name, requiredAttributeDisplayValue); } lRequiredAttributes.Text = descriptionList.Html; } } var deleteCell = (e.Row.Cells[_deleteFieldIndex] as DataControlFieldCell).Controls[0]; if (deleteCell != null) { // only support deleting people that haven't been saved to the database yet deleteCell.Visible = !familyPersonState.PersonId.HasValue; } } }
public Dictionary <string, List <KeyValuePair <string, List <string> > > > BadIpMain() { List <string> AllIP = new List <string>(); List <KeyValuePair <string, List <string> > > InfoList = new List <KeyValuePair <string, List <string> > >(); string fieldC = "category"; string fieldD = "description"; string fieldU = "url"; string fieldT = "date"; string IP = ""; string IpDescription = ""; string category = ""; string IpDate = ""; string URL = ""; Dictionary <string, string> CatDesc = new Dictionary <string, string>(); CatDesc = GetCatDesc(); foreach (string cat in CatDesc.Keys) { AllIP = Get("https://www.badips.com/get/list/" + cat + "/0"); foreach (string ip in AllIP) { IP = ip; category = cat; IpDescription = CatDesc[cat]; URL = "https://www.badips.com/get/list/" + cat + "/0"; IpDate = "No Date Provided"; DescriptionList.Add(IpDescription); CategoryList.Add(category); UrlList.Add(URL); IpDateList.Add(IpDate); InfoList.Add(new KeyValuePair <string, List <string> >(fieldC, CategoryList)); InfoList.Add(new KeyValuePair <string, List <string> >(fieldD, DescriptionList)); InfoList.Add(new KeyValuePair <string, List <string> >(fieldU, UrlList)); InfoList.Add(new KeyValuePair <string, List <string> >(fieldT, IpDateList)); if (IP != "") { if (!BlackListDB.ContainsKey(IP)) { totalip.Add(IP); BlackListDB.Add(IP, InfoList); } } CategoryList = new List <string>(); DescriptionList = new List <string>(); UrlList = new List <string>(); InfoList = new List <KeyValuePair <string, List <string> > >(); IpDateList = new List <string>(); } } return(BlackListDB); }
/// <summary> /// Shows the mode where the user is only viewing an existing document type /// </summary> private void ShowViewMode() { if (!IsViewMode()) { return; } var canEdit = CanEdit(); pnlEditDetails.Visible = false; pnlViewDetails.Visible = true; HideSecondaryBlocks(false); btnEdit.Visible = canEdit; btnDelete.Visible = canEdit; btnSecurity.Visible = canEdit; var documentType = GetDocumentType(); if (documentType != null) { pdAuditDetails.SetEntity(documentType, ResolveRockUrl("~")); } lReadOnlyTitle.Text = documentType.Name.FormatAsHtmlTitle(); lIcon.Text = string.Format("<i class='{0}'></i>", documentType.IconCssClass); var descriptionList = new DescriptionList(); if (documentType.BinaryFileType != null) { descriptionList.Add("File Type", documentType.BinaryFileType.Name); } if (documentType.EntityType != null) { descriptionList.Add("Entity Type", documentType.EntityType.FriendlyName); descriptionList.Add("Qualifier Column", documentType.EntityTypeQualifierColumn); descriptionList.Add("Qualifier Value", documentType.EntityTypeQualifierValue); } descriptionList.Add("Manually Selectable", documentType.UserSelectable ? "Yes" : "No"); lDocumentTypeDescription.Text = descriptionList.Html; if (canEdit) { btnSecurity.Title = "Secure " + documentType.Name; btnSecurity.EntityId = documentType.Id; } }
public SpellbookUserControl(TableLayoutPanel gamePanel) { InitializeComponent(); this.gamePanel = gamePanel; this.BackColor = Color.Black; descriptionList = new DescriptionList<SpellBuilder>(); descriptionList.KeyUp += OnKeyUp; descriptionList.Dock = DockStyle.Fill; descriptionList.Stringify = (item) => String.Format("[{0}] {1}", descriptionList.Items.IndexOf(item), item.Name); this.Controls.Add(descriptionList); descriptionList.Title = "__--== SPELL BOOK ==--__"; descriptionList.HelpString = "W: Previous - S: Next - A: Previous Page - D: Next Page - Enter: Select Spell"; }
public BackpackUserControl(TableLayoutPanel gamePanel) { InitializeComponent(); this.gamePanel = gamePanel; this.BackColor = Color.Black; descriptionList = new DescriptionList<Item>(); descriptionList.KeyUp += OnKeyUp; descriptionList.Dock = DockStyle.Fill; descriptionList.Stringify = (item) => String.Format("[{0}] {1}", descriptionList.Items.IndexOf(item), item.Name); this.Controls.Add(descriptionList); descriptionList.Title = "__--== INVENTORY ==--__"; descriptionList.HelpString = "W: Previous - S: Next - A: Previous Page - D: Next Page - U: Use - H: Handle Weapon - P: Put on Armor - B: Embrace Shield"; }
public MerchantUserControl(TableLayoutPanel gamePanel) { InitializeComponent(); this.gamePanel = gamePanel; this.BackColor = Color.Black; structure = new TableLayoutPanel(); structure.RowStyles.Clear(); structure.RowStyles.Add(new RowStyle(SizeType.Percent, 10.0f)); // Title structure.RowStyles.Add(new RowStyle(SizeType.Percent, 80.0f)); structure.RowStyles.Add(new RowStyle(SizeType.Percent, 5.0f)); // Help structure.RowStyles.Add(new RowStyle(SizeType.Percent, 5.0f)); // Merchant notifier lblTitle = this.DockFillLabel("lblTitle", Color.Red); lblTitle.Margin = new Padding(PaddingValue); lblTitle.TextAlign = ContentAlignment.MiddleCenter; descriptionList = new DescriptionList<Item>[2]; for (int i = 0; i < descriptionList.Length; i++) { descriptionList[i] = new DescriptionList<Item>(); descriptionList[i].KeyUp += OnKeyUp; descriptionList[i].Dock = DockStyle.Fill; var locI = i; descriptionList[i].Stringify = (item) => String.Format("[{0}] {1}", descriptionList[locI].Items.IndexOf(item), item.Name); descriptionList[i].Title = i == 0 ? "Your backpack" : "Merchant's warehouse"; descriptionList[i].HelpString = "W: Previous - S: Next - A: Previous Page - D: Next Page"; } var descriptionListPanel = new TableLayoutPanel(); descriptionListPanel.ColumnStyles.Clear(); descriptionListPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0f)); descriptionListPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0f)); descriptionListPanel.Margin = new Padding(PaddingValue); descriptionListPanel.Dock = DockStyle.Fill; lblHelp = this.DockFillLabel("lblHelp", Color.Yellow, new Font(FontFamily.GenericMonospace, charHelpSize)); lblHelp.Margin = new Padding(PaddingValue); lblHelp.TextAlign = ContentAlignment.MiddleCenter; singleLogMerchant = new SingleMessageLogUserControl(); singleLogMerchant.Dock = DockStyle.Fill; descriptionListPanel.Controls.Add(descriptionList[0], 0, 0); descriptionListPanel.Controls.Add(descriptionList[1], 1, 0); transparentPanel = new TransparentPanel(); transparentPanel.BackColor = Color.Transparent; //transparentPanel.Transparency = 128; transparentPanel.Paint += TransparentPanel_Paint; ; singleLogMerchant.KeyUp += OnKeyUp; structure.Controls.Add(lblTitle, 0, 0); structure.Controls.Add(descriptionListPanel, 0, 1); structure.Controls.Add(lblHelp, 0, 2); structure.Controls.Add(singleLogMerchant, 0, 3); this.Controls.Add(structure); this.Controls.Add(transparentPanel); HelpString = helpStrings[SelectedListIndex]; this.SelectedIndexChanged += (sender, e) => { HelpString = helpStrings[((IndexChangedEventArgs)e).Index]; }; initialWidth = Width; initialHeight = Height; initialTitleFontSize = lblTitle.Font.Size; initialHelpFontSize = lblHelp.Font.Size; structure.Parent.Resize += (sender, e) => Controll_FillParent(sender, e, structure); transparentPanel.Parent.Resize += (sender, e) => Controll_FillParent(sender, e, transparentPanel); transparentPanel.BringToFront(); }