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

📄 listinfo.cs

📁 企业管理信息化之财务管理系统
💻 CS
📖 第 1 页 / 共 5 页
字号:
using System;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using com.unicafe.common;




namespace com.ascs.plp.publics
{
	/// <summary>
	/// ListInfo 的摘要说明。
	/// </summary>
	public class ListInfo
	{
		public ListInfo()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}




		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 绑定质量状况
		/// </summary>
		/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
		/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
		/// **************************************************************************
		public static bool ListZlzk(System.Web.UI.WebControls.DropDownList theDDL)
		{
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select CSDM,CSMC From XTCS Where CSDM Like '06%'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
				System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();

				//将查询结果集与下拉列表框控件进行绑定
				theDDL.DataSource = SqlDR;
				theDDL.DataValueField = "CSDM";
				theDDL.DataTextField = "CSMC";
				theDDL.DataBind();

				//关闭数据库连接对象
				Connection.Close();
				return true;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("ListZlzk(System.Web.UI.WebControls.DropDownList theDDL)");
				LogService.Write ("在绑定质量状况时发生错误。");
				LogService.Write (e.Message);
				return false;
			}
		}
		/// **************************************************************************
		/// END
		/// **************************************************************************





		
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 绑定学历
		/// </summary>
		/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
		/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
		/// **************************************************************************
		public static bool ListXl(System.Web.UI.WebControls.DropDownList theDDL)
		{
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select CSDM,CSMC From XTCS Where CSDM Like '01%'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
				System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();

				//将查询结果集与下拉列表框控件进行绑定
				theDDL.DataSource = SqlDR;
				theDDL.DataValueField = "CSDM";
				theDDL.DataTextField = "CSMC";
				theDDL.DataBind();

				//关闭数据库连接对象
				Connection.Close();
				return true;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("ListXl(System.Web.UI.WebControls.DropDownList theDDL)");
				LogService.Write ("在绑定学历时发生错误。");
				LogService.Write (e.Message);
				return false;
			}
		}
		/// **************************************************************************
		/// END
		/// **************************************************************************





		
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 绑定职务
		/// </summary>
		/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
		/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
		/// **************************************************************************
		public static bool ListZw(System.Web.UI.WebControls.DropDownList theDDL)
		{
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select CSDM,CSMC From XTCS Where CSDM Like '03%'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
				System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();

				//将查询结果集与下拉列表框控件进行绑定
				theDDL.DataSource = SqlDR;
				theDDL.DataValueField = "CSDM";
				theDDL.DataTextField = "CSMC";
				theDDL.DataBind();

				//关闭数据库连接对象
				Connection.Close();
				return true;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("ListZw(System.Web.UI.WebControls.DropDownList theDDL)");
				LogService.Write ("在绑定职务时发生错误。");
				LogService.Write (e.Message);
				return false;
			}
		}
		/// **************************************************************************
		/// END
		/// **************************************************************************



		
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 绑定客户类型
		/// </summary>
		/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
		/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
		/// **************************************************************************
		public static bool ListKhlx(System.Web.UI.WebControls.DropDownList theDDL)
		{
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select CSDM,CSMC From XTCS Where CSDM Like '04%'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
				System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();

				//将查询结果集与下拉列表框控件进行绑定
				theDDL.DataSource = SqlDR;
				theDDL.DataValueField = "CSDM";
				theDDL.DataTextField = "CSMC";
				theDDL.DataBind();

				//关闭数据库连接对象
				Connection.Close();
				return true;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("ListKhlx(System.Web.UI.WebControls.DropDownList theDDL)");
				LogService.Write ("在绑定客户类型时发生错误。");
				LogService.Write (e.Message);
				return false;
			}
		}
		/// **************************************************************************
		/// END
		/// **************************************************************************




		
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 绑定单据类型
		/// </summary>
		/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
		/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
		/// **************************************************************************
		public static bool ListDjlx(System.Web.UI.WebControls.DropDownList theDDL)
		{
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select CSDM,CSMC From XTCS Where CSDM Like '07%'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
				System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();

				//将查询结果集与下拉列表框控件进行绑定
				theDDL.DataSource = SqlDR;
				theDDL.DataValueField = "CSDM";
				theDDL.DataTextField = "CSMC";
				theDDL.DataBind();

				//关闭数据库连接对象
				Connection.Close();
				return true;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("ListDjlx(System.Web.UI.WebControls.DropDownList theDDL)");
				LogService.Write ("在绑定单据类型时发生错误。");
				LogService.Write (e.Message);
				return false;
			}
		}
		/// **************************************************************************
		/// END
		/// **************************************************************************





		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 绑定物品管理方式
		/// </summary>
		/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
		/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
		/// **************************************************************************
		public static bool ListWpglfs(System.Web.UI.WebControls.DropDownList theDDL)
		{
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select CSDM,CSMC From XTCS Where CSDM Like '08%'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
				System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();

				//将查询结果集与下拉列表框控件进行绑定
				theDDL.DataSource = SqlDR;
				theDDL.DataValueField = "CSDM";
				theDDL.DataTextField = "CSMC";
				theDDL.DataBind();

				//关闭数据库连接对象
				Connection.Close();
				return true;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("ListWpglfs(System.Web.UI.WebControls.DropDownList theDDL)");
				LogService.Write ("在绑定物品管理方式时发生错误。");
				LogService.Write (e.Message);
				return false;
			}
		}
		/// **************************************************************************
		/// END
		/// **************************************************************************





		
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 绑定货币类型
		/// </summary>
		/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
		/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
		/// **************************************************************************
		public static bool ListHblx(System.Web.UI.WebControls.DropDownList theDDL)
		{
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select CSDM,CSMC From XTCS Where CSDM Like '09%'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
				System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();

				//将查询结果集与下拉列表框控件进行绑定
				theDDL.DataSource = SqlDR;
				theDDL.DataValueField = "CSDM";
				theDDL.DataTextField = "CSMC";
				theDDL.DataBind();

				//关闭数据库连接对象
				Connection.Close();

⌨️ 快捷键说明

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