📄 cw_zlsz.cs
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using com.unicafe.common;
namespace Com.Ascs.Plp.CW
{
/// <summary>
/// 对象CW_ZLSZ的定义
/// 根据表 CW_ZLSZ
/// </summary>
public class CW_ZLSZ
{
/// <summary>
/// 对象CW_ZLSZ的构造函数
/// </summary>
public CW_ZLSZ()
{
m_ZL = 0;
m_LXBH = 0;
m_BJJB = "";
}
private int m_ZL;
private int m_LXBH;
private string m_BJJB;
/// <summary>
/// 属性 ZL
/// </summary>
public int ZL
{
get
{
return m_ZL;
}
set
{
m_ZL = value;
}
}
/// <summary>
/// 属性 LXBH
/// </summary>
public int LXBH
{
get
{
return m_LXBH;
}
set
{
m_LXBH = value;
}
}
/// <summary>
/// 属性 BJJB
/// </summary>
public string BJJB
{
get
{
return m_BJJB;
}
set
{
m_BJJB = value;
}
}
}
}
namespace Com.Ascs.Plp.CW
{
/// <summary>
/// 实现对 CW_ZLSZ对象的管理
/// </summary>
public class CW_ZLSZMgr
{
/// <summary>
/// 添加新的CW_ZLSZ对象
/// </summary>
/// <param name="theCW_ZLSZ">要添加的CW_ZLSZ对象</param>
public bool AddCW_ZLSZ(System.Data.SqlClient.SqlConnection cn ,CW_ZLSZ theCW_ZLSZ)
{
try
{
// SqlConnection cn = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
// cn.Open();
string sql;
sql = "insert into CW_ZLSZ (ZL, LXBH, BJJB) values (@ZL, @LXBH, @BJJB)";
SqlCommand cmd = new SqlCommand(sql, cn);
cmd.Parameters.Add ("@ZL", theCW_ZLSZ.ZL);
cmd.Parameters.Add ("@LXBH", theCW_ZLSZ.LXBH);
cmd.Parameters.Add ("@BJJB", theCW_ZLSZ.BJJB);
cmd.ExecuteNonQuery();
// cn.Close();
return true;
}
catch(Exception e)
{
LogService.Write ("AddCW_ZLSZ(CW_ZLSZ theCW_ZLSZ)");
LogService.Write (e.Message);
return false;
}
}
/// <summary>
/// 更新CW_ZLSZ对象
/// </summary>
/// <param name="theCW_ZLSZ">要更新的CW_ZLSZ对象</param>
public bool UpdateCW_ZLSZ(System.Data.SqlClient.SqlConnection cn ,CW_ZLSZ theCW_ZLSZ)
{
try
{
// SqlConnection cn = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
// cn.Open();
string sql;
sql = "update CW_ZLSZ set BJJB=@BJJB where ZL=@ZL and LXBH=@LXBH";
SqlCommand cmd = new SqlCommand(sql, cn);
cmd.Parameters.Add ("@ZL", theCW_ZLSZ.ZL);
cmd.Parameters.Add ("@LXBH", theCW_ZLSZ.LXBH);
cmd.Parameters.Add ("@BJJB", theCW_ZLSZ.BJJB);
cmd.ExecuteNonQuery();
// cn.Close();
return true;
}
catch(Exception e)
{
LogService.Write ("UpdateCW_ZLSZ(CW_ZLSZ theCW_ZLSZ)");
LogService.Write (e.Message);
return false;
}
}
/// <summary>
/// 删除CW_ZLSZ对象
/// </summary>
/// <param name="ZL">主键</param>
/// <param name="LXBH">主键</param>
public bool DelCW_ZLSZ(System.Data.SqlClient.SqlConnection cn ,int ZL, int LXBH)
{
try
{
// SqlConnection cn = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
// cn.Open();
//
string sql;
sql = "delete from CW_ZLSZ where ZL=@ZL and LXBH=@LXBH";
SqlCommand cmd = new SqlCommand(sql, cn);
cmd.Parameters.Add ("@ZL", ZL);
cmd.Parameters.Add ("@LXBH", LXBH);
cmd.ExecuteNonQuery();
// cn.Close();
return true;
}
catch(Exception e)
{
LogService.Write ("DelCW_ZLSZ(int ZL, int LXBH)");
LogService.Write (e.Message);
return false;
}
}
/// <summary>
/// 根据主键标识获得CW_ZLSZ对象
/// </summary>
/// <param name="ZL">主键</param>
/// <param name="LXBH">主键</param>
public CW_ZLSZ GetCW_ZLSZ(int ZL, int LXBH)
{
try
{
CW_ZLSZ result = null;
SqlConnection cn = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
cn.Open();
string sql;
sql = "select * from CW_ZLSZ where ZL=@ZL and LXBH=@LXBH";
SqlCommand cmd = new SqlCommand(sql,cn);
cmd.Parameters.Add ("@ZL", ZL);
cmd.Parameters.Add ("@LXBH", LXBH);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
result = new CW_ZLSZ();
if (dr["ZL"] != null)
if (!System.DBNull.Equals(dr["ZL"], System.DBNull.Value))
result.ZL = (int)dr["ZL"];
if (dr["LXBH"] != null)
if (!System.DBNull.Equals(dr["LXBH"], System.DBNull.Value))
result.LXBH = (int)dr["LXBH"];
if (dr["BJJB"] != null)
if (!System.DBNull.Equals(dr["BJJB"], System.DBNull.Value))
result.BJJB = (string)dr["BJJB"];
}
dr.Close();
cn.Close();
return result;
}
catch(Exception e)
{
LogService.Write ("GetCW_ZLSZ(int ZL, int LXBH)");
LogService.Write (e.Message);
return null;
}
}
/// <summary>
/// 查找CW_ZLSZ对象
/// </summary>
public ArrayList FindCW_ZLSZ()
{
try
{
ArrayList result = new ArrayList();
SqlConnection cn = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
cn.Open();
string sql;
sql = "select * from CW_ZLSZ";
SqlCommand cmd = new SqlCommand(sql, cn);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
CW_ZLSZ obj = new CW_ZLSZ();
if (dr["ZL"] != null)
if (!System.DBNull.Equals(dr["ZL"], System.DBNull.Value))
obj.ZL = (int)dr["ZL"];
if (dr["LXBH"] != null)
if (!System.DBNull.Equals(dr["LXBH"], System.DBNull.Value))
obj.LXBH = (int)dr["LXBH"];
if (dr["BJJB"] != null)
if (!System.DBNull.Equals(dr["BJJB"], System.DBNull.Value))
obj.BJJB = (string)dr["BJJB"];
result.Add(obj);
}
dr.Close();
cn.Close();
return result;
}
catch(Exception e)
{
LogService.Write ("FindCW_ZLSZ()");
LogService.Write (e.Message);
return null;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -