<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Carrotware.CMS.Interface;


namespace Carrotware.CMS.UI.Plugins.FAQModule {
	public partial class FAQDisplay : BaseShellUserControl, IWidget {

		#region IWidget Members

		public Guid PageWidgetID { get; set; }

		public Guid RootContentID { get; set; }

		public Guid SiteID { get; set; }

		public string JSEditFunction {
			get { return ""; }
		}
		public bool EnableEdit {
			get { return false; }
		}
		#endregion

		protected int iFaq = 0;

		protected string FaqCounter() {
			iFaq++;
			return iFaq.ToString();
		}

		protected void Page_Load(object sender, EventArgs e) {
			//if (SiteID == Guid.Empty) {
			//    SiteID = SiteData.CurrentSiteID;
			//}

			dbFAQDataContext db = new dbFAQDataContext();

			var dtFAQ = (from f in db.tblFAQs
						 where f.SiteID == SiteID
						 orderby f.SortOrder
						 select f).ToList();

			if (dtFAQ == null) {
				dgFAQ.Visible = false;
			} else {
				dgFAQ.DataSource = dtFAQ;
				dgFAQ.DataBind();
				dgFAQ.Visible = true;
			}

		}
	}
}<commit_msg>fixed inactive faq entries from showing on public view<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Carrotware.CMS.Interface;


namespace Carrotware.CMS.UI.Plugins.FAQModule {
	public partial class FAQDisplay : BaseShellUserControl, IWidget {

		#region IWidget Members

		public Guid PageWidgetID { get; set; }

		public Guid RootContentID { get; set; }

		public Guid SiteID { get; set; }

		public string JSEditFunction {
			get { return ""; }
		}
		public bool EnableEdit {
			get { return false; }
		}
		#endregion

		protected int iFaq = 0;

		protected string FaqCounter() {
			iFaq++;
			return iFaq.ToString();
		}

		protected void Page_Load(object sender, EventArgs e) {
			//if (SiteID == Guid.Empty) {
			//    SiteID = SiteData.CurrentSiteID;
			//}

			dbFAQDataContext db = new dbFAQDataContext();

			var lstFAQ = (from f in db.tblFAQs
						 where f.SiteID == SiteID
						 && f.IsActive == true
						 orderby f.SortOrder
						 select f).ToList();

			if (lstFAQ == null) {
				dgFAQ.Visible = false;
			} else {
				dgFAQ.DataSource = lstFAQ;
				dgFAQ.DataBind();
				dgFAQ.Visible = true;
			}

		}
	}
}
{'fraction_non_alphanumeric': 0.10926464478604071, 'fraction_numerical': 0.0008309098462816784, 'mean_word_length': 2.967051070840198, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7296239', 'n_tokens_mistral': 997, 'n_tokens_neox': 800, 'n_words': 212}