📄 listinfo.cs
字号:
Connection.Open();
try
{
//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//将查询结果集与下拉列表框控件进行绑定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "JGDM";
theDDL.DataTextField = "JGMC";
theDDL.DataBind();
//关闭数据库连接对象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListJgmc(System.Web.UI.WebControls.DropDownList theDDL, bool LimitFlag)");
LogService.Write ("在绑定机构全称时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定计量单位
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListJldw(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 JLDWDM,JLDWMC From JLDW";
cmd.CommandText = sql;
Connection.Open();
try
{
//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//将查询结果集与下拉列表框控件进行绑定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "JLDWDM";
theDDL.DataTextField = "JLDWMC";
theDDL.DataBind();
//关闭数据库连接对象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListJldw(System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在绑定计量单位时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定已审核通过且未完成的采购计划
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <param name="JgId"> 操作者所属的机构代码</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListCgjh(string JgId, 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 JHDID,JHMC From CGJHDB Where JGDM = '" + JgId + "' And SHBJ = '2' And WCQK = '0'";
cmd.CommandText = sql;
Connection.Open();
try
{
//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//将查询结果集与下拉列表框控件进行绑定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "JHDID";
theDDL.DataTextField = "JHMC";
theDDL.DataBind();
//关闭数据库连接对象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListCgjh(string JgId, System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在绑定采购计划时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定信用级别
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <param name="Jgdm">信用级别所属的机构代码</param>
/// <param name="Xylx">信用类型代码</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListXyjb(System.Web.UI.WebControls.DropDownList theDDL, string Jgdm, string Xylx)
{
System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
string sql = "Select XYJBDM,XYJBMC From XYJB Where JGDM = '" + Jgdm + "' And XYLXDM = '" + Xylx + "'";
cmd.CommandText = sql;
Connection.Open();
try
{
//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//将查询结果集与下拉列表框控件进行绑定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "XYJBDM";
theDDL.DataTextField = "XYJBMC";
theDDL.DataBind();
//关闭数据库连接对象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("System.Web.UI.WebControls.DropDownList theDDL, string Jgdm, string Xylx");
LogService.Write ("在绑定信用级别时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定承运商类型
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListCyslx(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 '17%'";
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 ("ListCyslx(System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在绑定承运商类型时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定承运商
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <param name="JGDM">承运商所属机构的机构代码</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListCys(System.Web.UI.WebControls.DropDownList theDDL, string JGDM)
{
System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
string sql = "Select CYSDM, CYSJC From CYSXX Where SFSY = '0' And JGDM = '" + JGDM + "'";
cmd.CommandText = sql;
Connection.Open();
try
{
//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//将查询结果集与下拉列表框控件进行绑定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "CYSDM";
theDDL.DataTextField = "CYSJC";
theDDL.DataBind();
//关闭数据库连接对象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListCys(System.Web.UI.WebControls.DropDownList theDDL, string JGDM)");
LogService.Write ("在绑定承运商时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定包装方式
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListBzfs(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 '20%'";
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 ("ListBzfs(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 ListDeptEmpls(System.Web.UI.WebControls.DropDownList theDDL, string DeptId)
{
System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
string sql = "Select E.EMPLID, (E.EMPLNAMEL + E.EMPLNAMEF) EMPLNAME From EMPLOYEES E, EMPLDEPT ED " +
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -