388 lines
11 KiB
C#
388 lines
11 KiB
C#
|
|
using System;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Data.SqlClient;
|
|||
|
|
using ZWL.DBUtility;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
namespace ZWL.BLL
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ERPCustomFuWu<57><75>
|
|||
|
|
/// </summary>
|
|||
|
|
public class ERPCustomFuWu
|
|||
|
|
{
|
|||
|
|
public ERPCustomFuWu()
|
|||
|
|
{}
|
|||
|
|
#region Model
|
|||
|
|
private int _id;
|
|||
|
|
private string _customname;
|
|||
|
|
private string _fuwutitle;
|
|||
|
|
private string _fuwutype;
|
|||
|
|
private string _fuwuresult;
|
|||
|
|
private string _fuwutime;
|
|||
|
|
private string _username;
|
|||
|
|
private DateTime? _timestr;
|
|||
|
|
private string _ifshare;
|
|||
|
|
private string _cusbaka;
|
|||
|
|
private string _cusbakb;
|
|||
|
|
private string _cusbakc;
|
|||
|
|
private string _cusbakd;
|
|||
|
|
private string _cusbake;
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public int ID
|
|||
|
|
{
|
|||
|
|
set{ _id=value;}
|
|||
|
|
get{return _id;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string CustomName
|
|||
|
|
{
|
|||
|
|
set{ _customname=value;}
|
|||
|
|
get{return _customname;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string FuWuTitle
|
|||
|
|
{
|
|||
|
|
set{ _fuwutitle=value;}
|
|||
|
|
get{return _fuwutitle;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string FuWuType
|
|||
|
|
{
|
|||
|
|
set{ _fuwutype=value;}
|
|||
|
|
get{return _fuwutype;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string FuWuResult
|
|||
|
|
{
|
|||
|
|
set{ _fuwuresult=value;}
|
|||
|
|
get{return _fuwuresult;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string FuWuTime
|
|||
|
|
{
|
|||
|
|
set{ _fuwutime=value;}
|
|||
|
|
get{return _fuwutime;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string UserName
|
|||
|
|
{
|
|||
|
|
set{ _username=value;}
|
|||
|
|
get{return _username;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public DateTime? TimeStr
|
|||
|
|
{
|
|||
|
|
set{ _timestr=value;}
|
|||
|
|
get{return _timestr;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string IFShare
|
|||
|
|
{
|
|||
|
|
set{ _ifshare=value;}
|
|||
|
|
get{return _ifshare;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string CusBakA
|
|||
|
|
{
|
|||
|
|
set{ _cusbaka=value;}
|
|||
|
|
get{return _cusbaka;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string CusBakB
|
|||
|
|
{
|
|||
|
|
set{ _cusbakb=value;}
|
|||
|
|
get{return _cusbakb;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string CusBakC
|
|||
|
|
{
|
|||
|
|
set{ _cusbakc=value;}
|
|||
|
|
get{return _cusbakc;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string CusBakD
|
|||
|
|
{
|
|||
|
|
set{ _cusbakd=value;}
|
|||
|
|
get{return _cusbakd;}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
///
|
|||
|
|
/// </summary>
|
|||
|
|
public string CusBakE
|
|||
|
|
{
|
|||
|
|
set{ _cusbake=value;}
|
|||
|
|
get{return _cusbake;}
|
|||
|
|
}
|
|||
|
|
#endregion Model
|
|||
|
|
|
|||
|
|
|
|||
|
|
#region <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>õ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
|||
|
|
/// </summary>
|
|||
|
|
public ERPCustomFuWu(int ID)
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql=new StringBuilder();
|
|||
|
|
strSql.Append("select ID,CustomName,FuWuTitle,FuWuType,FuWuResult,FuWuTime,UserName,TimeStr,IFShare,CusBakA,CusBakB,CusBakC,CusBakD,CusBakE ");
|
|||
|
|
strSql.Append(" FROM ERPCustomFuWu ");
|
|||
|
|
strSql.Append(" where ID=@ID ");
|
|||
|
|
SqlParameter[] parameters = {
|
|||
|
|
new SqlParameter("@ID", SqlDbType.Int,4)};
|
|||
|
|
parameters[0].Value = ID;
|
|||
|
|
|
|||
|
|
DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
|
|||
|
|
if(ds.Tables[0].Rows.Count>0)
|
|||
|
|
{
|
|||
|
|
if(ds.Tables[0].Rows[0]["ID"].ToString()!="")
|
|||
|
|
{
|
|||
|
|
ID=int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
|
|||
|
|
}
|
|||
|
|
CustomName=ds.Tables[0].Rows[0]["CustomName"].ToString();
|
|||
|
|
FuWuTitle=ds.Tables[0].Rows[0]["FuWuTitle"].ToString();
|
|||
|
|
FuWuType=ds.Tables[0].Rows[0]["FuWuType"].ToString();
|
|||
|
|
FuWuResult=ds.Tables[0].Rows[0]["FuWuResult"].ToString();
|
|||
|
|
FuWuTime=ds.Tables[0].Rows[0]["FuWuTime"].ToString();
|
|||
|
|
UserName=ds.Tables[0].Rows[0]["UserName"].ToString();
|
|||
|
|
if(ds.Tables[0].Rows[0]["TimeStr"].ToString()!="")
|
|||
|
|
{
|
|||
|
|
TimeStr=DateTime.Parse(ds.Tables[0].Rows[0]["TimeStr"].ToString());
|
|||
|
|
}
|
|||
|
|
IFShare=ds.Tables[0].Rows[0]["IFShare"].ToString();
|
|||
|
|
CusBakA=ds.Tables[0].Rows[0]["CusBakA"].ToString();
|
|||
|
|
CusBakB=ds.Tables[0].Rows[0]["CusBakB"].ToString();
|
|||
|
|
CusBakC=ds.Tables[0].Rows[0]["CusBakC"].ToString();
|
|||
|
|
CusBakD=ds.Tables[0].Rows[0]["CusBakD"].ToString();
|
|||
|
|
CusBakE=ds.Tables[0].Rows[0]["CusBakE"].ToString();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>ID
|
|||
|
|
/// </summary>
|
|||
|
|
public int GetMaxId()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
return DbHelperSQL.GetMaxID("ID", "ERPCustomFuWu");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ڸü<DAB8>¼
|
|||
|
|
/// </summary>
|
|||
|
|
public bool Exists(int ID)
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql=new StringBuilder();
|
|||
|
|
strSql.Append("select count(1) from ERPCustomFuWu");
|
|||
|
|
strSql.Append(" where ID=@ID ");
|
|||
|
|
|
|||
|
|
SqlParameter[] parameters = {
|
|||
|
|
new SqlParameter("@ID", SqlDbType.Int,4)};
|
|||
|
|
parameters[0].Value = ID;
|
|||
|
|
|
|||
|
|
return DbHelperSQL.Exists(strSql.ToString(),parameters);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public int Add()
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql=new StringBuilder();
|
|||
|
|
strSql.Append("insert into ERPCustomFuWu(");
|
|||
|
|
strSql.Append("CustomName,FuWuTitle,FuWuType,FuWuResult,FuWuTime,UserName,TimeStr,IFShare,CusBakA,CusBakB,CusBakC,CusBakD,CusBakE)");
|
|||
|
|
strSql.Append(" values (");
|
|||
|
|
strSql.Append("@CustomName,@FuWuTitle,@FuWuType,@FuWuResult,@FuWuTime,@UserName,@TimeStr,@IFShare,@CusBakA,@CusBakB,@CusBakC,@CusBakD,@CusBakE)");
|
|||
|
|
strSql.Append(";select @@IDENTITY");
|
|||
|
|
SqlParameter[] parameters = {
|
|||
|
|
new SqlParameter("@CustomName", SqlDbType.VarChar,100),
|
|||
|
|
new SqlParameter("@FuWuTitle", SqlDbType.VarChar,500),
|
|||
|
|
new SqlParameter("@FuWuType", SqlDbType.VarChar,500),
|
|||
|
|
new SqlParameter("@FuWuResult", SqlDbType.VarChar,5000),
|
|||
|
|
new SqlParameter("@FuWuTime", SqlDbType.VarChar,500),
|
|||
|
|
new SqlParameter("@UserName", SqlDbType.VarChar,50),
|
|||
|
|
new SqlParameter("@TimeStr", SqlDbType.DateTime),
|
|||
|
|
new SqlParameter("@IFShare", SqlDbType.VarChar,5000),
|
|||
|
|
new SqlParameter("@CusBakA", SqlDbType.VarChar,8000),
|
|||
|
|
new SqlParameter("@CusBakB", SqlDbType.VarChar,8000),
|
|||
|
|
new SqlParameter("@CusBakC", SqlDbType.VarChar,8000),
|
|||
|
|
new SqlParameter("@CusBakD", SqlDbType.VarChar,8000),
|
|||
|
|
new SqlParameter("@CusBakE", SqlDbType.VarChar,8000)};
|
|||
|
|
parameters[0].Value = CustomName;
|
|||
|
|
parameters[1].Value = FuWuTitle;
|
|||
|
|
parameters[2].Value = FuWuType;
|
|||
|
|
parameters[3].Value = FuWuResult;
|
|||
|
|
parameters[4].Value = FuWuTime;
|
|||
|
|
parameters[5].Value = UserName;
|
|||
|
|
parameters[6].Value = TimeStr;
|
|||
|
|
parameters[7].Value = IFShare;
|
|||
|
|
parameters[8].Value = CusBakA;
|
|||
|
|
parameters[9].Value = CusBakB;
|
|||
|
|
parameters[10].Value = CusBakC;
|
|||
|
|
parameters[11].Value = CusBakD;
|
|||
|
|
parameters[12].Value = CusBakE;
|
|||
|
|
|
|||
|
|
object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
|
|||
|
|
if (obj == null)
|
|||
|
|
{
|
|||
|
|
return 1;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
return Convert.ToInt32(obj);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public void Update()
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql=new StringBuilder();
|
|||
|
|
strSql.Append("update ERPCustomFuWu set ");
|
|||
|
|
strSql.Append("CustomName=@CustomName,");
|
|||
|
|
strSql.Append("FuWuTitle=@FuWuTitle,");
|
|||
|
|
strSql.Append("FuWuType=@FuWuType,");
|
|||
|
|
strSql.Append("FuWuResult=@FuWuResult,");
|
|||
|
|
strSql.Append("FuWuTime=@FuWuTime,");
|
|||
|
|
strSql.Append("UserName=@UserName,");
|
|||
|
|
strSql.Append("TimeStr=@TimeStr,");
|
|||
|
|
strSql.Append("IFShare=@IFShare,");
|
|||
|
|
strSql.Append("CusBakA=@CusBakA,");
|
|||
|
|
strSql.Append("CusBakB=@CusBakB,");
|
|||
|
|
strSql.Append("CusBakC=@CusBakC,");
|
|||
|
|
strSql.Append("CusBakD=@CusBakD,");
|
|||
|
|
strSql.Append("CusBakE=@CusBakE");
|
|||
|
|
strSql.Append(" where ID=@ID ");
|
|||
|
|
SqlParameter[] parameters = {
|
|||
|
|
new SqlParameter("@ID", SqlDbType.Int,4),
|
|||
|
|
new SqlParameter("@CustomName", SqlDbType.VarChar,100),
|
|||
|
|
new SqlParameter("@FuWuTitle", SqlDbType.VarChar,500),
|
|||
|
|
new SqlParameter("@FuWuType", SqlDbType.VarChar,500),
|
|||
|
|
new SqlParameter("@FuWuResult", SqlDbType.VarChar,5000),
|
|||
|
|
new SqlParameter("@FuWuTime", SqlDbType.VarChar,500),
|
|||
|
|
new SqlParameter("@UserName", SqlDbType.VarChar,50),
|
|||
|
|
new SqlParameter("@TimeStr", SqlDbType.DateTime),
|
|||
|
|
new SqlParameter("@IFShare", SqlDbType.VarChar,5000),
|
|||
|
|
new SqlParameter("@CusBakA", SqlDbType.VarChar,8000),
|
|||
|
|
new SqlParameter("@CusBakB", SqlDbType.VarChar,8000),
|
|||
|
|
new SqlParameter("@CusBakC", SqlDbType.VarChar,8000),
|
|||
|
|
new SqlParameter("@CusBakD", SqlDbType.VarChar,8000),
|
|||
|
|
new SqlParameter("@CusBakE", SqlDbType.VarChar,8000)};
|
|||
|
|
parameters[0].Value = ID;
|
|||
|
|
parameters[1].Value = CustomName;
|
|||
|
|
parameters[2].Value = FuWuTitle;
|
|||
|
|
parameters[3].Value = FuWuType;
|
|||
|
|
parameters[4].Value = FuWuResult;
|
|||
|
|
parameters[5].Value = FuWuTime;
|
|||
|
|
parameters[6].Value = UserName;
|
|||
|
|
parameters[7].Value = TimeStr;
|
|||
|
|
parameters[8].Value = IFShare;
|
|||
|
|
parameters[9].Value = CusBakA;
|
|||
|
|
parameters[10].Value = CusBakB;
|
|||
|
|
parameters[11].Value = CusBakC;
|
|||
|
|
parameters[12].Value = CusBakD;
|
|||
|
|
parameters[13].Value = CusBakE;
|
|||
|
|
|
|||
|
|
DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// ɾ<><C9BE>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public void Delete(int ID)
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql=new StringBuilder();
|
|||
|
|
strSql.Append("delete ERPCustomFuWu ");
|
|||
|
|
strSql.Append(" where ID=@ID ");
|
|||
|
|
SqlParameter[] parameters = {
|
|||
|
|
new SqlParameter("@ID", SqlDbType.Int,4)};
|
|||
|
|
parameters[0].Value = ID;
|
|||
|
|
|
|||
|
|
DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>õ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
|||
|
|
/// </summary>
|
|||
|
|
public void GetModel(int ID)
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql=new StringBuilder();
|
|||
|
|
strSql.Append("select ID,CustomName,FuWuTitle,FuWuType,FuWuResult,FuWuTime,UserName,TimeStr,IFShare,CusBakA,CusBakB,CusBakC,CusBakD,CusBakE ");
|
|||
|
|
strSql.Append(" FROM ERPCustomFuWu ");
|
|||
|
|
strSql.Append(" where ID=@ID ");
|
|||
|
|
SqlParameter[] parameters = {
|
|||
|
|
new SqlParameter("@ID", SqlDbType.Int,4)};
|
|||
|
|
parameters[0].Value = ID;
|
|||
|
|
|
|||
|
|
DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
|
|||
|
|
if(ds.Tables[0].Rows.Count>0)
|
|||
|
|
{
|
|||
|
|
if(ds.Tables[0].Rows[0]["ID"].ToString()!="")
|
|||
|
|
{
|
|||
|
|
ID=int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
|
|||
|
|
}
|
|||
|
|
CustomName=ds.Tables[0].Rows[0]["CustomName"].ToString();
|
|||
|
|
FuWuTitle=ds.Tables[0].Rows[0]["FuWuTitle"].ToString();
|
|||
|
|
FuWuType=ds.Tables[0].Rows[0]["FuWuType"].ToString();
|
|||
|
|
FuWuResult=ds.Tables[0].Rows[0]["FuWuResult"].ToString();
|
|||
|
|
FuWuTime=ds.Tables[0].Rows[0]["FuWuTime"].ToString();
|
|||
|
|
UserName=ds.Tables[0].Rows[0]["UserName"].ToString();
|
|||
|
|
if(ds.Tables[0].Rows[0]["TimeStr"].ToString()!="")
|
|||
|
|
{
|
|||
|
|
TimeStr=DateTime.Parse(ds.Tables[0].Rows[0]["TimeStr"].ToString());
|
|||
|
|
}
|
|||
|
|
IFShare=ds.Tables[0].Rows[0]["IFShare"].ToString();
|
|||
|
|
CusBakA=ds.Tables[0].Rows[0]["CusBakA"].ToString();
|
|||
|
|
CusBakB=ds.Tables[0].Rows[0]["CusBakB"].ToString();
|
|||
|
|
CusBakC=ds.Tables[0].Rows[0]["CusBakC"].ToString();
|
|||
|
|
CusBakD=ds.Tables[0].Rows[0]["CusBakD"].ToString();
|
|||
|
|
CusBakE=ds.Tables[0].Rows[0]["CusBakE"].ToString();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public DataSet GetList(string strWhere)
|
|||
|
|
{
|
|||
|
|
StringBuilder strSql=new StringBuilder();
|
|||
|
|
strSql.Append("select [ID],[CustomName],[FuWuTitle],[FuWuType],[FuWuResult],[FuWuTime],[UserName],[TimeStr],[IFShare],[CusBakA],[CusBakB],[CusBakC],[CusBakD],[CusBakE] ");
|
|||
|
|
strSql.Append(" FROM ERPCustomFuWu ");
|
|||
|
|
if(strWhere.Trim()!="")
|
|||
|
|
{
|
|||
|
|
strSql.Append(" where "+strWhere);
|
|||
|
|
}
|
|||
|
|
return DbHelperSQL.Query(strSql.ToString());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|