⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 columnlist.ascx.cs

📁 勇敢者论坛全部源代码。 支持SQL2000/Access数据库
💻 CS
字号:
namespace doughty_cn
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;

	/// <summary>
	///		columnlist 的摘要说明。
	/// </summary>
	public partial class columnlist : System.Web.UI.UserControl
	{

		protected void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			if (!this.IsPostBack)
			{
				dlfclist.DataSource=DBOperate.SelectFormForum("SELECT BigClass_ID, BigClass_Name, Enable FROM Big_Class WHERE (Enable = 1)");
				this.Page.DataBind();
			}		
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		设计器支持所需的方法 - 不要使用代码编辑器
		///		修改此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.dlfclist.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler(this.dlfclist_ItemDataBound);

		}
		#endregion

		private void dlfclist_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
		{
			//if (==) 
			try	
			{
				if ((e.Item.ItemType==ListItemType.Item)||(e.Item.ItemType==ListItemType.AlternatingItem))
				{
					DataGrid childGrid =(DataGrid)e.Item.FindControl("DataGrid1");
					string intCustomerID= this.dlfclist.DataKeys[e.Item.ItemIndex].ToString();
                    //string strQ = "SELECT SmallClass_ID, BigClass_ID, SmallClass_Name, Enable, CASE WHEN len(Memo)< 46 THEN Memo ELSE substring(Memo, 0, 46) + '...' END AS Memo,(SELECT COUNT(*) FROM Questions WHERE SmallClass_ID = Small_Class.SmallClass_ID AND kind > 0 AND solved = 0) AS nosolved, (SELECT COUNT(*) FROM Questions WHERE SmallClass_ID = Small_Class.SmallClass_ID AND kind > 0) AS SUM FROM Small_Class WHERE BigClass_ID=" + intCustomerID + "and (Enable = 1)";
                    string strQ = "SELECT SmallClass_ID, BigClass_ID, SmallClass_Name, [Enable], [Memo],(SELECT COUNT(*) FROM Questions WHERE SmallClass_ID = Small_Class.SmallClass_ID AND kind > 0 AND solved = 0) AS nosolved, (SELECT COUNT(*) FROM Questions WHERE SmallClass_ID = Small_Class.SmallClass_ID AND kind > 0) AS Qcnt FROM Small_Class WHERE BigClass_ID=" + intCustomerID + "and (Enable = 1)";
                    childGrid.DataSource = DBOperate.SelectFormForum(strQ);
					childGrid.DataBind();
				}
			}
			catch
			{}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -