?? listinfo.cs
字號(hào):
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: 在此處添加構(gòu)造函數(shù)邏輯
//
}
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 綁定質(zhì)量狀況
/// </summary>
/// <param name="theDDL">被綁定的下拉列表框控件對(duì)象</param>
/// <returns>布爾型返回值,成功執(zhí)行時(shí)返回true,產(chǎn)生錯(cuò)誤時(shí)返回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方法創(chuàng)建一個(gè)SqlDataReader對(duì)象的實(shí)例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//將查詢結(jié)果集與下拉列表框控件進(jìn)行綁定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "CSDM";
theDDL.DataTextField = "CSMC";
theDDL.DataBind();
//關(guān)閉數(shù)據(jù)庫(kù)連接對(duì)象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListZlzk(System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在綁定質(zhì)量狀況時(shí)發(fā)生錯(cuò)誤。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 綁定學(xué)歷
/// </summary>
/// <param name="theDDL">被綁定的下拉列表框控件對(duì)象</param>
/// <returns>布爾型返回值,成功執(zhí)行時(shí)返回true,產(chǎn)生錯(cuò)誤時(shí)返回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方法創(chuàng)建一個(gè)SqlDataReader對(duì)象的實(shí)例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//將查詢結(jié)果集與下拉列表框控件進(jìn)行綁定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "CSDM";
theDDL.DataTextField = "CSMC";
theDDL.DataBind();
//關(guān)閉數(shù)據(jù)庫(kù)連接對(duì)象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListXl(System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在綁定學(xué)歷時(shí)發(fā)生錯(cuò)誤。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 綁定職務(wù)
/// </summary>
/// <param name="theDDL">被綁定的下拉列表框控件對(duì)象</param>
/// <returns>布爾型返回值,成功執(zhí)行時(shí)返回true,產(chǎn)生錯(cuò)誤時(shí)返回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方法創(chuàng)建一個(gè)SqlDataReader對(duì)象的實(shí)例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//將查詢結(jié)果集與下拉列表框控件進(jìn)行綁定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "CSDM";
theDDL.DataTextField = "CSMC";
theDDL.DataBind();
//關(guān)閉數(shù)據(jù)庫(kù)連接對(duì)象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListZw(System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在綁定職務(wù)時(shí)發(fā)生錯(cuò)誤。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 綁定客戶類型
/// </summary>
/// <param name="theDDL">被綁定的下拉列表框控件對(duì)象</param>
/// <returns>布爾型返回值,成功執(zhí)行時(shí)返回true,產(chǎn)生錯(cuò)誤時(shí)返回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方法創(chuàng)建一個(gè)SqlDataReader對(duì)象的實(shí)例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//將查詢結(jié)果集與下拉列表框控件進(jìn)行綁定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "CSDM";
theDDL.DataTextField = "CSMC";
theDDL.DataBind();
//關(guān)閉數(shù)據(jù)庫(kù)連接對(duì)象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListKhlx(System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在綁定客戶類型時(shí)發(fā)生錯(cuò)誤。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 綁定單據(jù)類型
/// </summary>
/// <param name="theDDL">被綁定的下拉列表框控件對(duì)象</param>
/// <returns>布爾型返回值,成功執(zhí)行時(shí)返回true,產(chǎn)生錯(cuò)誤時(shí)返回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方法創(chuàng)建一個(gè)SqlDataReader對(duì)象的實(shí)例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//將查詢結(jié)果集與下拉列表框控件進(jìn)行綁定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "CSDM";
theDDL.DataTextField = "CSMC";
theDDL.DataBind();
//關(guān)閉數(shù)據(jù)庫(kù)連接對(duì)象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListDjlx(System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在綁定單據(jù)類型時(shí)發(fā)生錯(cuò)誤。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 綁定物品管理方式
/// </summary>
/// <param name="theDDL">被綁定的下拉列表框控件對(duì)象</param>
/// <returns>布爾型返回值,成功執(zhí)行時(shí)返回true,產(chǎn)生錯(cuò)誤時(shí)返回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方法創(chuàng)建一個(gè)SqlDataReader對(duì)象的實(shí)例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//將查詢結(jié)果集與下拉列表框控件進(jìn)行綁定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "CSDM";
theDDL.DataTextField = "CSMC";
theDDL.DataBind();
//關(guān)閉數(shù)據(jù)庫(kù)連接對(duì)象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListWpglfs(System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在綁定物品管理方式時(shí)發(fā)生錯(cuò)誤。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 綁定貨幣類型
/// </summary>
/// <param name="theDDL">被綁定的下拉列表框控件對(duì)象</param>
/// <returns>布爾型返回值,成功執(zhí)行時(shí)返回true,產(chǎn)生錯(cuò)誤時(shí)返回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方法創(chuàng)建一個(gè)SqlDataReader對(duì)象的實(shí)例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//將查詢結(jié)果集與下拉列表框控件進(jìn)行綁定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "CSDM";
theDDL.DataTextField = "CSMC";
theDDL.DataBind();
//關(guān)閉數(shù)據(jù)庫(kù)連接對(duì)象
Connection.Close();
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -