代码修改后的版本,全部提交
This commit is contained in:
85
Mtxfw.DAL/User_CZ_log.cs
Normal file
85
Mtxfw.DAL/User_CZ_log.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace Mtxfw.DAL
|
||||
{
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD>:User_CZ_log
|
||||
/// </summary>
|
||||
public partial class User_CZ_log : Mtxfw.Utility.Myabstract
|
||||
{
|
||||
public User_CZ_log()
|
||||
: base("User_CZ_log")
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public int Add(Mtxfw.Model.User_CZ_log model)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("insert into User_CZ_log(");
|
||||
strSql.Append("MemberId,AddTime,IP,Body,UType,gtype)");
|
||||
strSql.Append(" values (");
|
||||
strSql.Append("@MemberId,@AddTime,@IP,@Body,@UType,@gtype)");
|
||||
SqlParameter[] parameters = {
|
||||
new SqlParameter("@MemberId", SqlDbType.Int),
|
||||
new SqlParameter("@AddTime", SqlDbType.DateTime),
|
||||
new SqlParameter("@IP", SqlDbType.VarChar,50),
|
||||
new SqlParameter("@Body", SqlDbType.VarChar,800),
|
||||
new SqlParameter("@UType", SqlDbType.Int),
|
||||
new SqlParameter("@gtype", SqlDbType.Int)};
|
||||
parameters[0].Value = model.MemberId;
|
||||
parameters[1].Value = model.AddTime;
|
||||
parameters[2].Value = model.IP;
|
||||
parameters[3].Value = model.Body;
|
||||
parameters[4].Value = model.UType;
|
||||
parameters[5].Value = model.gtype;
|
||||
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_CZ_log ");
|
||||
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