📄 listinfo.cs
字号:
"Where ED.EMPLID = E.EMPLID And E.EmplEnabled = 1 And ED.DEPTID = '" + DeptId + "'";
cmd.CommandText = sql;
Connection.Open();
try
{
//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//将查询结果集与下拉列表框控件进行绑定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "EMPLID";
theDDL.DataTextField = "EMPLNAME";
theDDL.DataBind();
//关闭数据库连接对象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListDeptEmpls(System.Web.UI.WebControls.DropDownList theDDL, string DeptId)");
LogService.Write ("在绑定本部门所有人员时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定本机构所有人员
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListJgEmpls(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 E.EMPLID, (E.EMPLNAMEL + E.EMPLNAMEF) EMPLNAME From EMPLOYEES E, EMPLDEPT ED,departments D " +
"Where ED.EMPLID = E.EMPLID And E.EmplEnabled = 1 AND ED.deptid=D.deptid And D.JGDM = '" + Jgdm + "'";
cmd.CommandText = sql;
Connection.Open();
try
{
//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//将查询结果集与下拉列表框控件进行绑定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "EMPLID";
theDDL.DataTextField = "EMPLNAME";
theDDL.DataBind();
//关闭数据库连接对象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListJgEmpls(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 ListThyy(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 '14%'";
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 ListWxdlx(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 '15%'";
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 ("ListWxdlx(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 ListWxzlx(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 '21%'";
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 ("ListWxzlx(System.Web.UI.WebControls.DropDownList theDDL)");
LogService.Write ("在绑定维修站类型时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定预警级别,在新增库龄预警设定时使用
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <param name="Yjdm">预警代码</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListYjjb(System.Web.UI.WebControls.DropDownList theDDL, string Yjdm)
{
System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
string sql = "Select Y.YJJB From YJJBYS Y Where Y.YJJB Not In (Select K.YJJB From KLYJSZ K Where K.YJDM = " + Yjdm + ")";
cmd.CommandText = sql;
Connection.Open();
try
{
//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//将查询结果集与下拉列表框控件进行绑定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "YJJB";
theDDL.DataTextField = "YJJB";
theDDL.DataBind();
//关闭数据库连接对象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListYjjb(System.Web.UI.WebControls.DropDownList theDDL, string Yjdm)");
LogService.Write ("在预警级别时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定预警级别,在修改库龄预警设定时使用
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <param name="Yjdm">预警代码</param>
/// <param name="Yjjb">准备修改的库龄预警设置所使用的预警级别</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListYjjb(System.Web.UI.WebControls.DropDownList theDDL, string Yjdm, string Yjjb)
{
System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
string sql = "Select Y.YJJB From YJJBYS Y Where Y.YJJB Not In (Select K.YJJB From KLYJSZ K Where K.YJDM = " + Yjdm + " And Not K.YJJB = '" + Yjjb + "')";
cmd.CommandText = sql;
Connection.Open();
try
{
//声明并使用SqlCommand的ExecuteReader方法创建一个SqlDataReader对象的实例
System.Data.SqlClient.SqlDataReader SqlDR = cmd.ExecuteReader();
//将查询结果集与下拉列表框控件进行绑定
theDDL.DataSource = SqlDR;
theDDL.DataValueField = "YJJB";
theDDL.DataTextField = "YJJB";
theDDL.DataBind();
//关闭数据库连接对象
Connection.Close();
return true;
}
catch(Exception e)
{
Connection.Close();
LogService.Write ("ListYjjb(System.Web.UI.WebControls.DropDownList theDDL, string Yjdm, string Yjjb)");
LogService.Write ("在绑定预警级别时发生错误。");
LogService.Write (e.Message);
return false;
}
}
/// **************************************************************************
/// END
/// **************************************************************************
/// **************************************************************************
/// BEIGIN
/// <summary>
/// 绑定维修细目类型
/// </summary>
/// <param name="theDDL">被绑定的下拉列表框控件对象</param>
/// <returns>布尔型返回值,成功执行时返回true,产生错误时返回false</returns>
/// **************************************************************************
public static bool ListWxxmLx(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();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -