代码修改后的版本,全部提交
This commit is contained in:
83
Mtxfw.DAL/User_Errlog.cs
Normal file
83
Mtxfw.DAL/User_Errlog.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace Mtxfw.DAL
|
||||
{
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD>:User_Errlog
|
||||
/// </summary>
|
||||
public partial class User_Errlog : Mtxfw.Utility.Myabstract
|
||||
{
|
||||
public User_Errlog()
|
||||
: base("User_Errlog")
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public int Add(Mtxfw.Model.User_Errlog model)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("insert into User_Errlog(");
|
||||
strSql.Append("DLID,ErrType,addtime,ErrBody,ErrBody2)");
|
||||
strSql.Append(" values (");
|
||||
strSql.Append("@DLID,@ErrType,@addtime,@ErrBody,@ErrBody2)");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@DLID", SqlDbType.Int),
|
||||
new SqlParameter("@ErrType", SqlDbType.VarChar,50),
|
||||
new SqlParameter("@addtime", SqlDbType.DateTime),
|
||||
new SqlParameter("@ErrBody", SqlDbType.Text),
|
||||
new SqlParameter("@ErrBody2", SqlDbType.Text)};
|
||||
parameters[0].Value = model.DLID;
|
||||
parameters[1].Value = model.ErrType;
|
||||
parameters[2].Value = model.addtime;
|
||||
parameters[3].Value = model.ErrBody;
|
||||
parameters[4].Value = model.ErrBody2;
|
||||
object obj = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
|
||||
if (obj == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToInt32(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ɾ<><C9BE>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public bool Delete(Int64 Id)
|
||||
{
|
||||
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("delete from User_Errlog ");
|
||||
int rows = 0;
|
||||
if (Id > 0)
|
||||
{
|
||||
strSql.Append(" where Id=@Id");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@Id", SqlDbType.BigInt)};
|
||||
parameters[0].Value = Id;
|
||||
|
||||
rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
|
||||
}
|
||||
else
|
||||
{
|
||||
rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString());
|
||||
}
|
||||
if (rows > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user